创建单机 PolarDB-X 集群
pxd 只能用于测试
https://doc.polardbx.com/quickstart/topics/quickstart-pxd-cluster.html
#安装 docker
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
#docker 镜像加速
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": [
"https://hub-mirror.c.163.com",
"https://mirror.baidubce.com",
"https://ccr.ccs.tencentyun.com"
]
}
EOF
sudo systemctl restart docker
#配置普通用户访问 docker
sudo groupadd docker
sudo gpasswd -a ${USER} docker
newgrp docker
#安装 pxd
sudo apt install python3-pip
pip install -i https://mirrors.aliyun.com/pypi/simple/ pxd
新终端
pxd version
#安装集群
pxd create -file polardbx.yaml
polardbx.yaml 1cn 3dn 1cdc 1gms
version: v1
type: polardbx
cluster:
name: pxc_test
gms:
image: polardbx/polardbx-engine-2.0:latest
host_group: [127.0.0.1]
cn:
image: polardbx/polardbx-sql:latest
replica: 1
nodes:
- host: 127.0.0.1
resources:
mem_limit: 2G
dn:
image: polardbx/polardbx-engine-2.0:latest
replica: 3
nodes:
- host_group: [127.0.0.1]
- host_group: [127.0.0.1]
- host_group: [127.0.0.1]
resources:
mem_limit: 2G
cdc:
image: polardbx/polardbx-cdc:latest
replica: 1
nodes:
- host: 127.0.0.1
resources:
mem_limit: 2G