PXD 部署 阿里云 PolarDB-X 集群(企业版、标准版)教程

简介: 本文详细演示了使用PXD在Ubuntu 24.04上部署PolarDB-X企业版和标准版集群的完整流程,涵盖环境准备、Docker与Python配置、PXD安装、集群创建、连接测试及销毁等步骤,并附多篇主流操作系统安装指南,助力快速搭建分布式数据库环境。

install polardb-x by pxd

好习惯,附上之前 9 篇


参考

1. env

这里拿 1 台机器来测试,多台机器同理

  • basic env
root@iZbp1b2hnsd51fdnun2vwzZ:~# cat /etc/issue
Ubuntu 24.04.3 LTS \n \l

root@iZbp1b2hnsd51fdnun2vwzZ:~# free -h
               total        used        free      shared  buff/cache   available
Mem:           7.5Gi       766Mi       4.4Gi       1.9Mi       2.6Gi       6.7Gi
Swap:          4.0Gi        67Mi       3.9Gi
root@iZbp1b2hnsd51fdnun2vwzZ:~#
root@iZbp1b2hnsd51fdnun2vwzZ:~# lscpu |grep "^CPU(s):"
CPU(s):                               4
root@iZbp1b2hnsd51fdnun2vwzZ:~#
root@iZbp1b2hnsd51fdnun2vwzZ:~# nproc
4
root@iZbp1b2hnsd51fdnun2vwzZ:~#
root@iZbp1b2hnsd51fdnun2vwzZ:~# uname -a
Linux iZbp1b2hnsd51fdnun2vwzZ 6.8.0-88-generic #89-Ubuntu SMP PREEMPT_DYNAMIC Sat Oct 11 01:02:46 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
root@iZbp1b2hnsd51fdnun2vwzZ:~#
root@iZbp1b2hnsd51fdnun2vwzZ:~# hostnamectl
 Static hostname: iZbp1b2hnsd51fdnun2vwzZ
       Icon name: computer-vm
         Chassis: vm 🖴
      Machine ID: 288205f3ac2746c996481c00e4b807a0
         Boot ID: bbaa83d0b0de4c8180d1a1d0d51cf923
  Virtualization: kvm
Operating System: Ubuntu 24.04.3 LTS
          Kernel: Linux 6.8.0-88-generic
    Architecture: x86-64
 Hardware Vendor: Alibaba Cloud
  Hardware Model: Alibaba Cloud ECS
Firmware Version: 2.0.0
   Firmware Date: Tue 2024-04-23
    Firmware Age: 1y 8month 4w 1d
root@iZbp1b2hnsd51fdnun2vwzZ:~#
root@iZbp1b2hnsd51fdnun2vwzZ:~# hostname -i
172.16.0.2
root@iZbp1b2hnsd51fdnun2vwzZ:~#
root@iZbp1b2hnsd51fdnun2vwzZ:~# hostname -f
iZbp1b2hnsd51fdnun2vwzZ
root@iZbp1b2hnsd51fdnun2vwzZ:~# cat  /etc/hosts
127.0.0.1 localhost

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

172.16.0.2 iZbp1b2hnsd51fdnun2vwzZ

root@iZbp1b2hnsd51fdnun2vwzZ:~#
  • install docker

集群模式下,docker engine 版本需要大于等于 18.04,小于等于 28.x

目前还不能安装 docker 最新 29.x 版本,因为 docker 从29.x 版本开始,docker api 版本升级为 1.52 不再支持 返回 IPAddress,刚好 pxd 0.7.1 版本及以下版本 需要这个字段

aly dz 大佬说 pxd 要再发个版本 适配 最新版 docker 了

root@iZbp1b2hnsd51fdnun2vwzZ:~# cat /etc/apt/sources.list.d/docker.list
deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://mirrors.aliyun.com/docker-ce/linux/ubuntu   questing stable
root@iZbp1b2hnsd51fdnun2vwzZ:~#
root@iZbp1b2hnsd51fdnun2vwzZ:~# cat install_docker_v28.sh
apt install docker-ce=5:28.5.2-1~ubuntu.25.10~questing docker-ce-cli=5:28.5.2-1~ubuntu.25.10~questing
root@iZbp1b2hnsd51fdnun2vwzZ:~#
root@iZbp1b2hnsd51fdnun2vwzZ:~# sh install_docker_v28.sh
root@iZbp1b2hnsd51fdnun2vwzZ:~# docker version
Client: Docker Engine - Community
 Version:           28.5.2
 API version:       1.51
 Go version:        go1.25.3
 Git commit:        ecc6942
 Built:             Wed Nov  5 14:43:19 2025
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          28.5.2
  API version:      1.51 (minimum version 1.24)
  Go version:       go1.25.3
  Git commit:       89c5e8f
  Built:            Wed Nov  5 14:43:19 2025
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v2.2.1
  GitCommit:        dea7da592f5d1d2b7755e3a161be07f43fad8f75
 runc:
  Version:          1.3.4
  GitCommit:        v1.3.4-0-gd6d73eb8
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
root@iZbp1b2hnsd51fdnun2vwzZ:~#
  • install python3.7
root@iZbp1b2hnsd51fdnun2vwzZ:~# apt install -y vim wget gcc make zip zlib* libffi-dev
root@iZbp1b2hnsd51fdnun2vwzZ:~# wget https://repo.huaweicloud.com/python/3.7.3/Python-3.7.3.tgz
root@iZbp1b2hnsd51fdnun2vwzZ:~# mkdir /usr/local/python37
root@iZbp1b2hnsd51fdnun2vwzZ:~# tar -zxf Python-3.7.3.tgz
root@iZbp1b2hnsd51fdnun2vwzZ:~# cd Python-3.7.3/
root@iZbp1b2hnsd51fdnun2vwzZ:~# ./configure --prefix=/usr/local/python37 --enable-optimizations --with-openssl=/usr --with-system-ffi --enable-loadable-sqlite-extensions
root@iZbp1b2hnsd51fdnun2vwzZ:~# make -j4
root@iZbp1b2hnsd51fdnun2vwzZ:~# make install -j4
root@iZbp1b2hnsd51fdnun2vwzZ:~# /usr/local/python37/bin/python3.7 -V
root@iZbp1b2hnsd51fdnun2vwzZ:~# /usr/local/python37/bin/pip3.7 -V
qc@iZbp1b2hnsd51fdnun2vwzZ:~$ cat <<EOF>> ~/.bashrc

alias python37="/usr/local/python37/bin/python3.7"
alias pip37="/usr/local/python37/bin/pip3.7"
EOF
qc@iZbp1b2hnsd51fdnun2vwzZ:~$ source ~/.bashrc

qc@iZbp1b2hnsd51fdnun2vwzZ:~$ python37 -V
Python 3.7.3
qc@iZbp1b2hnsd51fdnun2vwzZ:~$ pip37 -V
pip 19.0.3 from /usr/local/python37/lib/python3.7/site-packages/pip (python 3.7)
qc@iZbp1b2hnsd51fdnun2vwzZ:~$
  • config ssh remote

因为只有本地一台机器,所以免密自己

su - qc
ssh-keygen -t rsa
ssh-copy-id qc@172.16.0.2
  • before install pxd
qc@iZbp1b2hnsd51fdnun2vwzZ:~$ python37 -m venv venv
qc@iZbp1b2hnsd51fdnun2vwzZ:~$ source venv/bin/activate
(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~$ python -V
Python 3.7.3
(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~$ pip -V
pip 19.0.3 from /usr/local/python37/lib/python3.7/site-packages/pip (python 3.7)
(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~$

(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~$ mkdir ~/.pip
(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~$ cat ~/.pip/pip.conf
[global]
index-url=http://mirrors.cloud.aliyuncs.com/pypi/simple/

[install]
trusted-host=mirrors.cloud.aliyuncs.com

(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~$

(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~$ pip install --upgrade pip
(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~$ pip -V
pip 24.0 from /home/qc/venv/lib/python3.7/site-packages/pip (python 3.7)
(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~$
  • install pxd
(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~$ pip install pxd
(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~$ pip list
Package            Version
------------------ ---------
asttokens          2.4.1
bcrypt             4.2.1
certifi            2021.5.30
cffi               1.15.1
charset-normalizer 2.0.4
click              8.0.1
colorama           0.4.4
cryptography       45.0.7
docker             5.0.0
humanfriendly      10.0
icontract          2.7.2
idna               3.2
importlib-metadata 6.7.0
packaging          24.0
paramiko           2.12.0
pip                24.0
pxd                0.7.1
pycparser          2.21
pycryptodomex      3.10.1
PyMySQL            1.0.2
PyNaCl             1.5.0
PyYAML             5.4.1
requests           2.26.0
retrying           1.3.3
setuptools         40.8.0
six                1.16.0
spur               0.3.20
spurplus           2.3.4
temppathlib        1.2.0
typing_extensions  4.7.1
urllib3            1.26.6
websocket-client   1.2.1
zipp               3.15.0

[notice] A new release of pip is available: 24.0 -> 25.3
[notice] To update, run: pip install --upgrade pip
(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~$
(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~$ pxd version
/home/qc/venv/lib/python3.7/site-packages/paramiko/transport.py:33: CryptographyDeprecationWarning: Python 3.7 is no longer supported by the Python core team and support for it is deprecated in cryptography. The next release of cryptography will remove support for Python 3.7.
  from cryptography.hazmat.backends import default_backend
/home/qc/venv/lib/python3.7/site-packages/paramiko/pkey.py:82: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from cryptography.hazmat.primitives.ciphers.algorithms in 48.0.0.
  "cipher": algorithms.TripleDES,
/home/qc/venv/lib/python3.7/site-packages/paramiko/transport.py:253: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from cryptography.hazmat.primitives.ciphers.algorithms in 48.0.0.
  "class": algorithms.TripleDES,
pxd version: 0.7.1
commit id: 93fbbe8
(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~$

2. setup polardb-x 企业版 cluster by pxd

  • 配置文件
(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~/pxd$ cat pxd-com.yaml
version: v1
type: polardbx
cluster:
  name: pxc_test_aly
  gms:
    image: polardbx-opensource-registry.cn-beijing.cr.aliyuncs.com/polardbx/polardbx-engine:v2.4.2_8.4.19
    host_group: [172.16.0.2]
  cn:
    image: polardbx-opensource-registry.cn-beijing.cr.aliyuncs.com/polardbx/polardbx-sql:v2.4.2_5.4.19
    replica: 1
    nodes:
      - host: 172.16.0.2
    resources:
      mem_limit: 1G
  dn:
    image: polardbx-opensource-registry.cn-beijing.cr.aliyuncs.com/polardbx/polardbx-engine:v2.4.2_8.4.19
    replica: 1
    nodes:
      - host_group: [172.16.0.2]
    resources:
      mem_limit: 1G
  cdc:
    image: polardbx-opensource-registry.cn-beijing.cr.aliyuncs.com/polardbx/polardbx-cdc:v2.4.2_5.4.19
    replica: 1
    nodes:
      - host: 172.16.0.2
    resources:
      mem_limit: 1G
(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~/pxd$
  • 编写启动脚本
(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~/pxd$ cat create-com.sh

pxd create -f ./pxd-com.yaml  -repo="polardbx-opensource-registry.cn-beijing.cr.aliyuncs.com/polardbx/"

(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~/pxd$
  • 启动 企业版集群
(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~/pxd$ sh create-com.sh
/home/qc/venv/lib/python3.7/site-packages/paramiko/transport.py:33: CryptographyDeprecationWarning: Python 3.7 is no longer supported by the Python core team and support for it is deprecated in cryptography. The next release of cryptography will remove support for Python 3.7.
  from cryptography.hazmat.backends import default_backend
/home/qc/venv/lib/python3.7/site-packages/paramiko/pkey.py:82: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from cryptography.hazmat.primitives.ciphers.algorithms in 48.0.0.
  "cipher": algorithms.TripleDES,
/home/qc/venv/lib/python3.7/site-packages/paramiko/transport.py:253: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from cryptography.hazmat.primitives.ciphers.algorithms in 48.0.0.
  "class": algorithms.TripleDES,
/home/qc/venv/lib/python3.7/site-packages/deployer
yaml file: ./pxd-com.yaml.bak-aly
Processing  [------------------------------------]    0%    pre check
Processing  [##----------------------------------]    7%    generate topology
Processing  [#####-------------------------------]   14%    check docker engine version
Processing  [#######-----------------------------]   21%    pull images
Pull image: polardbx-opensource-registry.cn-beijing.cr.aliyuncs.com/polardbx/polardbx-engine:v2.4.2_8.4.19 at 172.16.0.2

... 此处省略一大部分内容

e3172cab5c41:Extracting [============================>                      ]  69.63MB/122.9MB
e3172cab5c41:Extracting [==========================================>        ]  105.3MB/122.9MB
e3172cab5c41:Extracting [==================================================>]  122.9MB/122.9MB
e3172cab5c41:Pull complete
095a75859683:Extracting [==================================================>]     236B/236B
095a75859683:Extracting [==================================================>]     236B/236B
095a75859683:Pull complete
Digest: sha256:a137cec08150c7f6920abdcaa739b923cfdac0d7f274d96ef99d3e4cafcba7cd
Status: Downloaded newer image for polardbx-opensource-registry.cn-beijing.cr.aliyuncs.com/polardbx/polardbx-cdc:v2.4.2_5.4.19
Processing  [##########--------------------------]   28%    create gms node
Processing  [############------------------------]   35%    create gms db and tables
Processing  [###############---------------------]   42%    create PolarDB-X root account
Processing  [##################------------------]   50%    create dn
Processing  [####################----------------]   57%    register dn to gms
Processing  [#######################-------------]   64%    create cn
Processing  [#########################-----------]   71%    wait cn ready
Processing  [############################--------]   78%    create cdc containers
Processing  [##############################------]   85%    create columnar containers
Processing  [#################################---]   92%    wait PolarDB-X ready
Processing  [####################################]  100%


PolarDB-X cluster create successfully, you can try it out now.
Connect PolarDB-X using the following command:

    mysql -h172.16.0.2 -P60731 -upolardbx_root -pNRJAaNga
(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~/pxd$
  • 连接测试
(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~/pxd$ mysql -h172.16.0.2 -P60731 -upolardbx_root -pNRJAaNga
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 73
Server version: 8.0.3 Tddl Server (ALIBABA)

Copyright (c) 2000, 2025, 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.3-PXC-5.4.19-20250825 |
+---------------------------+
1 row in set (0.00 sec)

mysql> select * from information_schema.schemata;
+--------------+--------------------+----------------------------+------------------------+----------+--------------------+
| CATALOG_NAME | SCHEMA_NAME        | DEFAULT_CHARACTER_SET_NAME | DEFAULT_COLLATION_NAME | SQL_PATH | DEFAULT_ENCRYPTION |
+--------------+--------------------+----------------------------+------------------------+----------+--------------------+
| def          | information_schema | utf8mb4                    | utf8mb4_general_ci     | NULL     | NO                 |
+--------------+--------------------+----------------------------+------------------------+----------+--------------------+
1 row in set (0.03 sec)

mysql> show master status ;
+---------------+----------+--------------+------------------+-------------------+
| FILE          | POSITION | BINLOG_DO_DB | BINLOG_IGNORE_DB | EXECUTED_GTID_SET |
+---------------+----------+--------------+------------------+-------------------+
| binlog.000001 |     5098 |              |                  |                   |
+---------------+----------+--------------+------------------+-------------------+
1 row in set (0.58 sec)

mysql> show storage ;
+-------------------+------------------+------------+-----------+----------+-------------+--------+-----------+-------+--------+
| STORAGE_INST_ID   | LEADER_NODE      | IS_HEALTHY | INST_KIND | DB_COUNT | GROUP_COUNT | STATUS | DELETABLE | DELAY | ACTIVE |
+-------------------+------------------+------------+-----------+----------+-------------+--------+-----------+-------+--------+
| pxc_test_aly-dn-0 | 172.16.0.2:14818 | true       | MASTER    | 1        | 2           | 0      | false     | null  | null   |
| pxc_test_aly-gms  | 172.16.0.2:17029 | true       | META_DB   | 2        | 2           | 0      | false     | null  | null   |
+-------------------+------------------+------------+-----------+----------+-------------+--------+-----------+-------+--------+
2 rows in set (0.00 sec)

mysql> show mpp ;
+--------------+------------------+------+--------+
| ID           | NODE             | ROLE | LEADER |
+--------------+------------------+------+--------+
| pxc_test_aly | 172.16.0.2:60731 | W    | Y      |
+--------------+------------------+------+--------+
1 row in set (0.00 sec)

mysql>
mysql> create database polarx_example partition_mode='partitioning';
Query OK, 1 row affected (0.39 sec)

mysql> use polarx_example;
Database changed
mysql> create table example (
    ->   `id` bigint(11) auto_increment NOT NULL,
    ->   `name` varchar(255) DEFAULT NULL,
    ->   `score` bigint(11) DEFAULT NULL,
    ->   primary key (`id`)
    -> ) engine=InnoDB default charset=utf8
    -> partition by hash(id)
    -> partitions 8;
Query OK, 0 rows affected (1.13 sec)

mysql> insert into example values(null,'lily',375),(null,'lisa',400),(null,'ljh',500);
Query OK, 3 rows affected (0.05 sec)

mysql> select * from example;
+----+------+-------+
| id | name | score |
+----+------+-------+
|  1 | lily |   375 |
|  2 | lisa |   400 |
|  3 | ljh  |   500 |
+----+------+-------+
3 rows in set (0.03 sec)

mysql> show topology from example;
+------+-----------------------------+--------------------+----------------+-------------------+-----------------------+-------------------+-------------------+
| ID   | GROUP_NAME                  | TABLE_NAME         | PARTITION_NAME | SUBPARTITION_NAME | PHY_DB_NAME           | DN_ID             | STORAGE_POOL_NAME |
+------+-----------------------------+--------------------+----------------+-------------------+-----------------------+-------------------+-------------------+
|    0 | POLARX_EXAMPLE_P00000_GROUP | example_NGE9_00000 | p1             |                   | polarx_example_p00000 | pxc_test_aly-dn-0 | _default          |
|    1 | POLARX_EXAMPLE_P00000_GROUP | example_NGE9_00001 | p2             |                   | polarx_example_p00000 | pxc_test_aly-dn-0 | _default          |
|    2 | POLARX_EXAMPLE_P00000_GROUP | example_NGE9_00002 | p3             |                   | polarx_example_p00000 | pxc_test_aly-dn-0 | _default          |
|    3 | POLARX_EXAMPLE_P00000_GROUP | example_NGE9_00003 | p4             |                   | polarx_example_p00000 | pxc_test_aly-dn-0 | _default          |
|    4 | POLARX_EXAMPLE_P00000_GROUP | example_NGE9_00004 | p5             |                   | polarx_example_p00000 | pxc_test_aly-dn-0 | _default          |
|    5 | POLARX_EXAMPLE_P00000_GROUP | example_NGE9_00005 | p6             |                   | polarx_example_p00000 | pxc_test_aly-dn-0 | _default          |
|    6 | POLARX_EXAMPLE_P00000_GROUP | example_NGE9_00006 | p7             |                   | polarx_example_p00000 | pxc_test_aly-dn-0 | _default          |
|    7 | POLARX_EXAMPLE_P00000_GROUP | example_NGE9_00007 | p8             |                   | polarx_example_p00000 | pxc_test_aly-dn-0 | _default          |
+------+-----------------------------+--------------------+----------------+-------------------+-----------------------+-------------------+-------------------+
8 rows in set (0.00 sec)

mysql>
  • check cluster
(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~/pxd$ pxd list
/home/qc/venv/lib/python3.7/site-packages/paramiko/transport.py:33: CryptographyDeprecationWarning: Python 3.7 is no longer supported by the Python core team and support for it is deprecated in cryptography. The next release of cryptography will remove support for Python 3.7.
  from cryptography.hazmat.backends import default_backend
/home/qc/venv/lib/python3.7/site-packages/paramiko/pkey.py:82: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from cryptography.hazmat.primitives.ciphers.algorithms in 48.0.0.
  "cipher": algorithms.TripleDES,
/home/qc/venv/lib/python3.7/site-packages/paramiko/transport.py:253: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from cryptography.hazmat.primitives.ciphers.algorithms in 48.0.0.
  "class": algorithms.TripleDES,
/home/qc/venv/lib/python3.7/site-packages/deployer
NAME                          CN        DN        CDC       STATUS
pxc_test_aly                  1         1         1         running
(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~/pxd$
  • delete cluster

必须授权,否则 待会 delete 会报错

(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~/pxd$ sudo chown -R qc: /home/qc/
(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~$ pxd delete pxc_test_aly
(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~$ pxd list
/home/qc/venv/lib/python3.7/site-packages/paramiko/transport.py:33: CryptographyDeprecationWarning: Python 3.7 is no longer supported by the Python core team and support for it is deprecated in cryptography. The next release of cryptography will remove support for Python 3.7.
  from cryptography.hazmat.backends import default_backend
/home/qc/venv/lib/python3.7/site-packages/paramiko/pkey.py:82: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from cryptography.hazmat.primitives.ciphers.algorithms in 48.0.0.
  "cipher": algorithms.TripleDES,
/home/qc/venv/lib/python3.7/site-packages/paramiko/transport.py:253: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from cryptography.hazmat.primitives.ciphers.algorithms in 48.0.0.
  "class": algorithms.TripleDES,
/home/qc/venv/lib/python3.7/site-packages/deployer
NAME                          CN        DN        CDC       STATUS
(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~$

3. setup polardb-x 标准版 cluster by pxd

  • 编写配置文件和启动脚本
(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~/pxd$ cat create-std.sh

pxd create -f ./pxd-std.yaml  -repo="polardbx-opensource-registry.cn-beijing.cr.aliyuncs.com/polardbx/"

(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~/pxd$ cat pxd-std.yaml
version: v1
type: polardbx
cluster:
  name: pxc_test_standard
  dn:
    image: polardbx-opensource-registry.cn-beijing.cr.aliyuncs.com/polardbx/polardbx-engine:v2.4.2_8.4.19
    replica: 1
    nodes:
      - host_group: [172.16.0.2]
    resources:
      mem_limit: 2G
(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~/pxd$
  • 启动 标准版 polardb-x
(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~/pxd$ sh create-std.sh
/home/qc/venv/lib/python3.7/site-packages/paramiko/transport.py:33: CryptographyDeprecationWarning: Python 3.7 is no longer supported by the Python core team and support for it is deprecated in cryptography. The next release of cryptography will remove support for Python 3.7.
  from cryptography.hazmat.backends import default_backend
/home/qc/venv/lib/python3.7/site-packages/paramiko/pkey.py:82: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from cryptography.hazmat.primitives.ciphers.algorithms in 48.0.0.
  "cipher": algorithms.TripleDES,
/home/qc/venv/lib/python3.7/site-packages/paramiko/transport.py:253: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from cryptography.hazmat.primitives.ciphers.algorithms in 48.0.0.
  "class": algorithms.TripleDES,
/home/qc/venv/lib/python3.7/site-packages/deployer
yaml file: ./pxd-std.yaml
Processing  [------------------------------------]    0%    pre check
Processing  [##----------------------------------]    7%    generate topology
Processing  [#####-------------------------------]   14%    check docker engine version
Processing  [#######-----------------------------]   21%    pull images
Pull image: polardbx-opensource-registry.cn-beijing.cr.aliyuncs.com/polardbx/polardbx-engine:v2.4.2_8.4.19 at 172.16.0.2


v2.4.2_8.4.19:Pulling from polardbx/polardbx-engine
Digest: sha256:ec0c8df5a017e7074929e31e185dad7d5aa31c5b2073fe38473ee29ec690c04a
Status: Image is up to date for polardbx-opensource-registry.cn-beijing.cr.aliyuncs.com/polardbx/polardbx-engine:v2.4.2_8.4.19
Pull image: polardbx-opensource-registry.cn-beijing.cr.aliyuncs.com/polardbx/xstore-tools:latest at 172.16.0.2


latest:Pulling from polardbx/xstore-tools
Digest: sha256:e7d6b7697a0de92db2a032064130c6ff605e576ce4b5830990f145da07745ea2
Status: Image is up to date for polardbx-opensource-registry.cn-beijing.cr.aliyuncs.com/polardbx/xstore-tools:latest
Processing  [##################------------------]   50%    create dn
Processing  [#################################---]   92%    wait PolarDB-X ready
Processing  [####################################]  100%


PolarDB-X cluster create successfully, you can try it out now.
Connect PolarDB-X using the following command:

    mysql -h172.16.0.2 -P15197 -uadmin -pbBREONPu
(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~/pxd$
  • 连接测试
(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~/pxd$ mysql -h172.16.0.2 -P15197 -uadmin -pbBREONPu
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 25
Server version: 8.0.32-X-Cluster-8.4.19-20250825 Source distribution

Copyright (c) 2000, 2025, 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>
mysql> select version();
+----------------------------------+
| version()                        |
+----------------------------------+
| 8.0.32-X-Cluster-8.4.19-20250825 |
+----------------------------------+
1 row in set (0.00 sec)

mysql> select host,user from mysql.user;
+-----------+------------------+
| host      | user             |
+-----------+------------------+
| %         | admin            |
| localhost | mysql.infoschema |
| localhost | mysql.session    |
| localhost | mysql.sys        |
| localhost | root             |
+-----------+------------------+
5 rows in set (0.00 sec)

mysql> select * from information_schema.schemata;
+--------------+--------------------+----------------------------+------------------------+----------+--------------------+
| CATALOG_NAME | SCHEMA_NAME        | DEFAULT_CHARACTER_SET_NAME | DEFAULT_COLLATION_NAME | SQL_PATH | DEFAULT_ENCRYPTION |
+--------------+--------------------+----------------------------+------------------------+----------+--------------------+
| def          | mysql              | utf8mb3                    | utf8mb3_general_ci     |     NULL | NO                 |
| def          | information_schema | utf8mb3                    | utf8mb3_general_ci     |     NULL | NO                 |
| def          | performance_schema | utf8mb4                    | utf8mb4_0900_ai_ci     |     NULL | NO                 |
| def          | __recycle_bin__    | utf8mb4                    | utf8mb4_0900_ai_ci     |     NULL | NO                 |
| def          | sys                | utf8mb4                    | utf8mb4_0900_ai_ci     |     NULL | NO                 |
+--------------+--------------------+----------------------------+------------------------+----------+--------------------+
5 rows in set (0.01 sec)

mysql> show master status ;
+------------------+----------+--------------+------------------+------------------------------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set                        |
+------------------+----------+--------------+------------------+------------------------------------------+
| mysql_bin.000001 |     1032 |              |                  | 56e21f50-f66d-11f0-8dfb-00163e20cb2a:1-2 |
+------------------+----------+--------------+------------------+------------------------------------------+
1 row in set (0.00 sec)

mysql>
  • 检查集群
(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~/pxd$ pxd list
/home/qc/venv/lib/python3.7/site-packages/paramiko/transport.py:33: CryptographyDeprecationWarning: Python 3.7 is no longer supported by the Python core team and support for it is deprecated in cryptography. The next release of cryptography will remove support for Python 3.7.
  from cryptography.hazmat.backends import default_backend
/home/qc/venv/lib/python3.7/site-packages/paramiko/pkey.py:82: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from cryptography.hazmat.primitives.ciphers.algorithms in 48.0.0.
  "cipher": algorithms.TripleDES,
/home/qc/venv/lib/python3.7/site-packages/paramiko/transport.py:253: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from cryptography.hazmat.primitives.ciphers.algorithms in 48.0.0.
  "class": algorithms.TripleDES,
/home/qc/venv/lib/python3.7/site-packages/deployer
NAME                          CN        DN        CDC       STATUS
pxc_test_standard             0         1         0         running
(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~/pxd$
  • 删除集群

必须授权,否则待会 delete 会报错权限不足

(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~/pxd$ sudo chown -R qc: /home/qc/
(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~/pxd$ pxd delete pxc_test_standard
/home/qc/venv/lib/python3.7/site-packages/paramiko/transport.py:33: CryptographyDeprecationWarning: Python 3.7 is no longer supported by the Python core team and support for it is deprecated in cryptography. The next release of cryptography will remove support for Python 3.7.
  from cryptography.hazmat.backends import default_backend
/home/qc/venv/lib/python3.7/site-packages/paramiko/pkey.py:82: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from cryptography.hazmat.primitives.ciphers.algorithms in 48.0.0.
  "cipher": algorithms.TripleDES,
/home/qc/venv/lib/python3.7/site-packages/paramiko/transport.py:253: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from cryptography.hazmat.primitives.ciphers.algorithms in 48.0.0.
  "class": algorithms.TripleDES,
/home/qc/venv/lib/python3.7/site-packages/deployer
Prepare to delete PolarDB-X cluster: pxc_test_standard
stop and remove container: pxc_test_standard-dn-0-Cand-15197, id: 8bb20f6c2e at 172.16.0.2
container: 8bb20f6c2e is not existing at 172.16.0.2.
(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~/pxd$
(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~/pxd$ pxd list
/home/qc/venv/lib/python3.7/site-packages/paramiko/transport.py:33: CryptographyDeprecationWarning: Python 3.7 is no longer supported by the Python core team and support for it is deprecated in cryptography. The next release of cryptography will remove support for Python 3.7.
  from cryptography.hazmat.backends import default_backend
/home/qc/venv/lib/python3.7/site-packages/paramiko/pkey.py:82: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from cryptography.hazmat.primitives.ciphers.algorithms in 48.0.0.
  "cipher": algorithms.TripleDES,
/home/qc/venv/lib/python3.7/site-packages/paramiko/transport.py:253: CryptographyDeprecationWarning: TripleDES has been moved to cryptography.hazmat.decrepit.ciphers.algorithms.TripleDES and will be removed from cryptography.hazmat.primitives.ciphers.algorithms in 48.0.0.
  "class": algorithms.TripleDES,
/home/qc/venv/lib/python3.7/site-packages/deployer
NAME                          CN        DN        CDC       STATUS
(venv) qc@iZbp1b2hnsd51fdnun2vwzZ:~/pxd$

在此感谢阿里云数据库迪哲大佬支持,20260120晚上帮忙排查问题(docker 最新版本 29.x 开始,api 版本升级至 1.52 不再支持 返回 容器的 IPAddress)

lQLPKd3CViy62_vNAfbNCCSwqnxOLMF1O8QJSIIulOMKAA_2084_502.png

Docker API 1.52 版本不再返回 NetworkSettings.IPAddress 字段,导致报错: https://docs.docker.com/reference/api/engine/version-history/#v152-api-changes


我们下期见,拜拜!

相关文章
|
8天前
|
人工智能 JavaScript Linux
【Claude Code 全攻略】终端AI编程助手从入门到进阶(2026最新版)
Claude Code是Anthropic推出的终端原生AI编程助手,支持40+语言、200k超长上下文,无需切换IDE即可实现代码生成、调试、项目导航与自动化任务。本文详解其安装配置、四大核心功能及进阶技巧,助你全面提升开发效率,搭配GitHub Copilot使用更佳。
|
2天前
|
JSON API 数据格式
OpenCode入门使用教程
本教程介绍如何通过安装OpenCode并配置Canopy Wave API来使用开源模型。首先全局安装OpenCode,然后设置API密钥并创建配置文件,最后在控制台中连接模型并开始交互。
|
10天前
|
存储 人工智能 自然语言处理
OpenSpec技术规范+实例应用
OpenSpec 是面向 AI 智能体的轻量级规范驱动开发框架,通过“提案-审查-实施-归档”工作流,解决 AI 编程中的需求偏移与不可预测性问题。它以机器可读的规范为“单一真相源”,将模糊提示转化为可落地的工程实践,助力开发者高效构建稳定、可审计的生产级系统,实现从“凭感觉聊天”到“按规范开发”的跃迁。
1485 16
|
8天前
|
人工智能 JavaScript 前端开发
【2026最新最全】一篇文章带你学会Cursor编程工具
本文介绍了Cursor的下载安装、账号注册、汉化设置、核心模式(Agent、Plan、Debug、Ask)及高阶功能,如@引用、@Doc文档库、@Browser自动化和Rules规则配置,助力开发者高效使用AI编程工具。
1202 5
|
6天前
|
云安全 安全
免费+限量+领云小宝周边!「阿里云2026云上安全健康体检」火热进行中!
诚邀您进行年度自检,发现潜在风险,守护云上业务连续稳健运行
1177 2
|
9天前
|
消息中间件 人工智能 Kubernetes
阿里云云原生应用平台岗位急招,加入我们,打造 AI 最强基础设施
云原生应用平台作为中国最大云计算公司的基石,现全面转向 AI,打造 AI 时代最强基础设施。寻找热爱技术、具备工程极致追求的架构师、极客与算法专家,共同重构计算、定义未来。杭州、北京、深圳、上海热招中,让我们一起在云端,重构 AI 的未来。
|
12天前
|
IDE 开发工具 C语言
【2026最新】VS2026下载安装使用保姆级教程(附安装包+图文步骤)
Visual Studio 2026是微软推出的最新Windows专属IDE,启动更快、内存占用更低,支持C++、Python等开发。推荐免费的Community版,安装简便,适合初学者与个人开发者使用。
1243 11

热门文章

最新文章