Files
Knowledge/其他/达梦数据库集群 docker 部署(启动报错).md

52 lines
1.3 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
**创建自定义网络**
使用network create来创建网络,创建命令如下:
docker network create --subnet=172.20.0.0/24 net1
**规划集群IP信息**
达梦Docker镜像支持部署一主多备,指定集群节点数和对应节点序号即可,这里介绍一主一备集群的部署过程,集群IP规划如下:
- 主节点(primary)  :172.20.0.3
- 备节点(standby):172.20.0.4
- 监视器(monitor):172.20.0.2
**启动**
 启动完成后,可通过如下命令输出日志来查看启动情况
#docker logs -f dmwatcher_primary //查看主数据库容器日志
#docker logs -f dmwatcher_standby //查看备数据库容器日志
#docker logs -f dmwatcher_monitor //查看监视器容器日志
可通过如下命令进入容器
#docker exec -it dmwatcher_primary /bin/bash //进入主数据库容器
#docker exec -it dmwatcher_standby /bin/bash //进入备数据库容器
#docker exec -it dmwatcher_monitor /bin/bash //进入监视器容器
**删除主备容器及挂载**
关闭容器:
#docker stop dmwatcher_primary dmwatcher_standby dmwatcher_monitor
查看全部容器:
#docker ps -a
删除容器:
#docker rm dmwatcher_primary dmwatcher_standby dmwatcher_monito
删除挂载:
#rm -rf /home/mnt/disks/dmwatcher_primary
#rm -rf /home/mnt/disks/dmwatcher_standby
#rm -rf /home/mnt/disks/dmwatcher_monitor