上一篇写道 CentOS 7.9 Linux 环境 Polardb-X 数据库 单机版 rpm 包 安装教程
本篇文章是基于 国产银河麒麟V10操作系统
基本步骤和上一篇基本相似,以下是详细过程
[root@kylinv10sp1 ~]# cat /etc/kylin-release
Kylin Linux Advanced Server release V10 (Tercel)
[root@kylinv10sp1 ~]#
[root@kylinv10sp1 ~]# nkvers
############## Kylin Linux Version #################
Release:
Kylin Linux Advanced Server release V10 (Tercel)
Kernel:
4.19.90-17.ky10.x86_64
Build:
Kylin Linux Advanced Server
release V10 (SP1) /(Tercel)-x86_64-Build04/20200711
#################################################
[root@kylinv10sp1 ~]#
[root@kylinv10sp1 ~]# ll t-polardbx-engine-8.4.19-20250825_17558853.el7.x86_64.rpm
-rw------- 1 root root 674397380 Jan 8 14:43 t-polardbx-engine-8.4.19-20250825_17558853.el7.x86_64.rpm
[root@kylinv10sp1 ~]#
[root@kylinv10sp1 ~]# yum install t-polardbx-engine-8.4.19-20250825_17558853.el7.x86_64.rpm
Last metadata expiration check: 1:05:23 ago on Thu 08 Jan 2026 01:39:16 PM CST.
Dependencies resolved.
======================================================================================================================================
Package Architecture Version Repository Size
======================================================================================================================================
Installing:
t-polardbx-engine x86_64 8.4.19-20250825_17558853.el7 @commandline 643 M
Transaction Summary
======================================================================================================================================
Install 1 Package
Total size: 643 M
Installed size: 2.8 G
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Running scriptlet: t-polardbx-engine-8.4.19-20250825_17558853.el7.x86_64 1/1
Installing : t-polardbx-engine-8.4.19-20250825_17558853.el7.x86_64 1/1
Running scriptlet: t-polardbx-engine-8.4.19-20250825_17558853.el7.x86_64 1/1
Copying /u01/xcluster80_20250825_current to /u01/xcluster80
Copying /u01/xcluster80_20250825_current to /u01/xcluster80_20250825
Verifying : t-polardbx-engine-8.4.19-20250825_17558853.el7.x86_64 1/1
Installed:
t-polardbx-engine-8.4.19-20250825_17558853.el7.x86_64
Complete!
[root@kylinv10sp1 ~]# ll /opt/polardbx_engine/
total 704
drwxr-xr-x 2 root root 4096 Jan 8 14:45 bin
drwxr-xr-x 2 root root 87 Jan 8 14:45 docs
drwxr-xr-x 3 root root 282 Jan 8 14:45 include
drwxr-xr-x 6 root root 207 Jan 8 14:45 lib
-rwxr-xr-x 1 root root 283374 Jan 8 14:45 LICENSE
-rwxr-xr-x 1 root root 121462 Jan 8 14:45 LICENSE.router
-rwxr-xr-x 1 root root 283374 Jan 8 14:45 LICENSE-test
drwxr-xr-x 4 root root 30 Jan 8 14:45 man
-rwxr-xr-x 1 root root 1622 Jan 8 14:45 mysqlrouter-log-rotate
-rwxr-xr-x 1 root root 952 Jan 8 14:45 README
-rwxr-xr-x 1 root root 679 Jan 8 14:45 README.router
-rwxr-xr-x 1 root root 952 Jan 8 14:45 README-test
drwxr-xr-x 2 root root 6 Jan 8 14:45 run
drwxr-xr-x 28 root root 4096 Jan 8 14:45 share
drwxr-xr-x 2 root root 77 Jan 8 14:45 support-files
drwxr-xr-x 3 root root 17 Jan 8 14:45 var
[root@kylinv10sp1 ~]#
[root@kylinv10sp1 ~]# useradd -ms /bin/bash polarx
[root@kylinv10sp1 ~]# echo "polarx:polarx" | chpasswd
[root@kylinv10sp1 ~]# echo "polarx ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
[root@kylinv10sp1 ~]# su - polarx
[polarx@kylinv10sp1 ~]$ mkdir polardbx-engine
[polarx@kylinv10sp1 ~]$ cd polardbx-engine && mkdir log mysql run data tmp
[polarx@kylinv10sp1 polardbx-engine]$ ll
total 0
drwx------ 2 polarx polarx 6 Jan 8 14:49 data
drwx------ 2 polarx polarx 6 Jan 8 14:49 log
drwx------ 2 polarx polarx 6 Jan 8 14:49 mysql
drwx------ 2 polarx polarx 6 Jan 8 14:49 run
drwx------ 2 polarx polarx 6 Jan 8 14:49 tmp
[polarx@kylinv10sp1 polardbx-engine]$ vim my.cnf
[polarx@kylinv10sp1 polardbx-engine]$ cat my.cnf
[mysqld]
basedir = /opt/polardbx_engine
log_error_verbosity = 2
default_authentication_plugin = mysql_native_password
gtid_mode = ON
enforce_gtid_consistency = ON
log_bin = mysql-binlog
binlog_format = row
binlog_row_image = FULL
master_info_repository = TABLE
relay_log_info_repository = TABLE
# change me if needed
datadir = /home/polarx/polardbx-engine/data
tmpdir = /home/polarx/polardbx-engine/tmp
socket = /home/polarx/polardbx-engine/tmp.mysql.sock
log_error = /home/polarx/polardbx-engine/log/alert.log
port = 4886
cluster_id = 1234
cluster_info = 127.0.0.1:14886@1
server_id = 2712347953
[mysqld_safe]
pid_file = /home/polarx/polardbx-engine/run/mysql.pid
[polarx@kylinv10sp1 polardbx-engine]$
[polarx@kylinv10sp1 polardbx-engine]$ sudo yum install libaio-devel -y
Last metadata expiration check: 1:10:47 ago on Thu 08 Jan 2026 01:39:16 PM CST.
Dependencies resolved.
======================================================================================================================================
Package Architecture Version Repository Size
======================================================================================================================================
Installing:
libaio-devel x86_64 0.3.111-5.ky10 ks10-adv-os 10 k
Transaction Summary
======================================================================================================================================
Install 1 Package
Total download size: 10 k
Installed size: 8.9 k
Downloading Packages:
libaio-devel-0.3.111-5.ky10.x86_64.rpm 50 kB/s | 10 kB 00:00
--------------------------------------------------------------------------------------------------------------------------------------
Total 49 kB/s | 10 kB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : libaio-devel-0.3.111-5.ky10.x86_64 1/1
Running scriptlet: libaio-devel-0.3.111-5.ky10.x86_64 1/1
Verifying : libaio-devel-0.3.111-5.ky10.x86_64 1/1
Installed:
libaio-devel-0.3.111-5.ky10.x86_64
Complete!
[polarx@kylinv10sp1 polardbx-engine]$
[polarx@kylinv10sp1 polardbx-engine]$ /opt/polardbx_engine/bin/mysqld --defaults-file=my.cnf --initialize-insecure
[polarx@kylinv10sp1 polardbx-engine]$
[polarx@kylinv10sp1 polardbx-engine]$ /opt/polardbx_engine/bin/mysqld_safe --defaults-file=my.cnf &
[1] 13049
[polarx@kylinv10sp1 polardbx-engine]$ 2026-01-08T06:52:25.881512Z mysqld_safe Logging to '/home/polarx/polardbx-engine/log/alert.log'.
2026-01-08T06:52:25.903579Z mysqld_safe Starting mysqld daemon with databases from /home/polarx/polardbx-engine/data
[polarx@kylinv10sp1 polardbx-engine]$
[polarx@kylinv10sp1 polardbx-engine]$ netstat -antp|grep 4886
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp6 0 0 :::4886 :::* LISTEN 13366/mysqld
tcp6 0 0 :::14886 :::* LISTEN 13366/mysqld
[polarx@kylinv10sp1 polardbx-engine]$
[polarx@kylinv10sp1 polardbx-engine]$ /opt/polardbx_engine/bin/mysql -h127.0.0.1 -P4886 -uroot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 14
Server version: 8.0.32-X-Cluster-8.4.19-20250825 Source distribution
Copyright (c) 2000, 2023, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> select version();
+----------------------------------+
| version() |
+----------------------------------+
| 8.0.32-X-Cluster-8.4.19-20250825 |
+----------------------------------+
1 row in set (0.00 sec)
mysql> ^DBye
[polarx@kylinv10sp1 polardbx-engine]$ nkvers
############## Kylin Linux Version #################
Release:
Kylin Linux Advanced Server release V10 (Tercel)
Kernel:
4.19.90-17.ky10.x86_64
Build:
Kylin Linux Advanced Server
release V10 (SP1) /(Tercel)-x86_64-Build04/20200711
#################################################
[polarx@kylinv10sp1 polardbx-engine]$ date
Thu Jan 8 14:53:29 CST 2026
[polarx@kylinv10sp1 polardbx-engine]$ date -R
Thu, 08 Jan 2026 14:53:35 +0800
[polarx@kylinv10sp1 polardbx-engine]$