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


我们下期见,拜拜!

相关文章
|
9天前
|
人工智能 开发工具 iOS开发
Claude Code 新手完全上手指南:安装、国产模型配置与常用命令全解
Claude Code 是一款运行在终端环境中的 AI 编程助手,能够直接在命令行中完成代码生成、项目分析、文件修改、命令执行、Git 管理等开发全流程工作。它最大的特点是**任务驱动、终端原生、轻量高效、多模型兼容**,无需图形界面、不依赖 IDE 插件,能够深度融入开发者日常工作流。
3097 7
|
11天前
|
Shell API 开发工具
Claude Code 快速上手指南(新手友好版)
AI编程工具卷疯啦!Claude Code凭借任务驱动+终端原生的特性,成了开发者的效率搭子。本文从安装、登录、切换国产模型到常用命令,手把手带新手快速上手,全程避坑,30分钟独立用起来。
3172 20
|
5天前
|
人工智能 Linux BI
国内用 Claude Code 终于不用翻墙了:一行命令搞定,自动接 DeepSeek
JeecgBoot AI专题研究 一键脚本:Claude Code + JeecgBoot Skills + DeepSeek 全平台接入 一行命令装好 Claude Code + JeecgBoot Skills + DeepSeek 接入,无需翻墙使用 Claude Code,支持 Wind
2084 3
国内用 Claude Code 终于不用翻墙了:一行命令搞定,自动接 DeepSeek
|
24天前
|
人工智能 JSON 供应链
畅用7个月无影 JVS Claw |手把手教你把JVS改造成「科研与产业地理情报可视化大师」
LucianaiB分享零成本畅用JVS Claw教程(学生认证享7个月使用权),并开源GeoMind项目——将JVS改造为科研与产业地理情报可视化AI助手,支持飞书文档解析、地理编码与腾讯地图可视化,助力产业关系图谱构建。
23588 15
畅用7个月无影 JVS Claw |手把手教你把JVS改造成「科研与产业地理情报可视化大师」
|
1天前
|
人工智能 自然语言处理 文字识别
阿里云百炼Qwen3.7-Max简介:能力、优势、支持订阅计划参考
Qwen3.7-Max是阿里云百炼面向智能体时代推出的新一代旗舰模型,对标GPT-5.5、Claude Opus 4.7等闭源旗舰。该模型支持百万级token上下文窗口,具备顶级推理能力、多模态搜索与视觉理解增强、流式输出低延迟响应等核心优势,覆盖编程、办公、长周期自主执行等复杂场景。同时支持OpenAI接口兼容,便于系统快速迁移。用户可通过Token Plan团队版、Coding Plan或节省计划等订阅方式灵活调用,适合企业级高要求场景使用。
|
11天前
|
人工智能 JSON BI
DeepSeek V4-Pro 接入 Claude Code 完全实战:体验、测试与关键避坑指南
Claude Code 作为当前主流的 AI 编程辅助工具,凭借强大的代码理解、工程执行与自动化能力深受开发者喜爱,但原生模型的使用成本相对较高。为了在保持能力的同时进一步降低开销,不少开发者开始寻找兼容度高、价格更友好的替代模型。DeepSeek V4 系列的发布带来了新的选择,该系列包含 V4-Pro 与 V4-Flash 两款模型,并提供了与 Anthropic 完全兼容的 API 接口,理论上只需简单修改配置,即可让 Claude Code 无缝切换为 DeepSeek 引擎。
2588 3
|
3天前
|
人工智能 自然语言处理 安全
Claude Code 全攻略:命令大全+三种模式+记忆体系+实战工作流完整手册
Claude Code 是当前最流行的终端级 AI 编程助手,能够直接在命令行中完成代码生成、项目理解、文件修改、命令执行、错误修复等全流程开发工作。它不依赖图形界面、不占用额外资源,却能深度理解项目结构,自动生成规范代码,大幅提升研发效率。
736 2
|
9天前
|
人工智能 安全 开发工具
Claude Code 官方工作原理与使用指南
Claude Code 不是传统代码补全工具,而是 Anthropic 推出的终端 AI 代理,具备代理循环、双驱动架构(模型+工具)、全局项目感知、6 种权限模式等核心能力,本文基于官方文档系统解析其工作原理与高效使用技巧。
1422 0

热门文章

最新文章