步驟序号 | 步骤说明 | 详细解答 |
---|---|---|
3 | 镜像制作 | 3 |
5 | 启动容器 | 5 |
6 | 组建集群 | 6 |
7 | 批量停止 | 7 |
docker build --no-cache --network host -t kylin10:proxy_T4 -f dockerfile_root_proxy .
docker build --no-cache --network host -t kylin10:db_T4 -f dockerfile_root_db .
docker build --no-cache --network host -t kylin10:gtm_T4 -f dockerfile_root_gtm .
docker build --no-cache --network host -t kylin10:lds_T4 -f dockerfile_root_lds .
docker run --name db_192.168.100.100 -v /etc/localtime:/etc/localtime:ro --net icbc --ip 192.168.100.100 --privileged=true --restart=unless-stopped -tid kylin10:db_T4 /sbin/init
docker run --name db_192.168.100.101 -v /etc/localtime:/etc/localtime:ro --net icbc --ip 192.168.100.101 --privileged=true --restart=unless-stopped -tid kylin10:db_T4 /sbin/init
docker run --name db_192.168.100.102 -v /etc/localtime:/etc/localtime:ro --net icbc --ip 192.168.100.102 --privileged=true --restart=unless-stopped -tid kylin10:db_T4 /sbin/init
docker run --name db_192.168.100.103 -v /etc/localtime:/etc/localtime:ro --net icbc --ip 192.168.100.103 --privileged=true --restart=unless-stopped -tid kylin10:db_T4 /sbin/init
docker exec -ti gtm_192.168.100.115 /bin/bash -c "echo root:'db1x@NJ+1'|chpasswd";echo ;
docker exec -ti gtm_192.168.100.114 /bin/bash -c "echo root:'db1x@NJ+1'|chpasswd";echo ;
docker exec -ti gtm_192.168.100.113 /bin/bash -c "echo root:'db1x@NJ+1'|chpasswd";echo ;
docker exec -ti gtm_192.168.100.112 /bin/bash -c "echo root:'db1x@NJ+1'|chpasswd";echo ;
docker run --name db_192.168.100.121 -v /etc/localtime:/etc/localtime:ro --net network_drliu --ip 192.168.100.121 --privileged=true --restart=always -tid kylin10:db_198 /sbin/init;
docker run --name proxy_192.168.100.123 -v /etc/localtime:/etc/localtime:ro --net network_drliu --ip 192.168.100.123 --privileged=true --restart=always -tid kylin10:proxy_198 /sbin/init;
docker run --name lds_192.168.100.124 -v /etc/localtime:/etc/localtime:ro --net network_drliu --ip 192.168.100.124 --privileged=true --restart=always -tid kylin10:lds_198 /sbin/init;
docker run --name gtm_192.168.100.122 -v /etc/localtime:/etc/localtime:ro --net network_drliu --ip 192.168.100.122 --privileged=true --restart=always -tid kylin10:gtm_198 /sbin/init;
docker exec -ti db_192.168.100.121 /bin/bash -c "echo root:'db1x@NJ+1'|chpasswd";echo ;
docker exec -ti proxy_192.168.100.123 /bin/bash -c "echo root:'db1x@NJ+1'|chpasswd";echo ;
docker exec -ti lds_192.168.100.124 /bin/bash -c "echo root:'db1x@NJ+1'|chpasswd";echo ;
docker exec -ti gtm_192.168.100.122 /bin/bash -c "echo root:'db1x@NJ+1'|chpasswd";echo;
docker network create -d macvlan --subnet=10.229.43.0/24 --gateway=10.229.43.1 -o parent=ens192 drliu
docker network create -d macvlan --subnet=10.229.31.0/24 --gateway=10.229.31.1 -o parent=enp3s0f1 drliu
docker run --name db_10.229.44.40 -v /etc/localtime:/etc/localtime:ro --net drliu --ip 10.229.44.40 --privileged=true --restart=always -tid goldendb-release-docker.artnj.zte.com.cn/build/centos7.8/alldev:db /sbin/init
docker run --name db_10.229.31.110 -v /etc/localtime:/etc/localtime:ro --net drliu --ip 10.229.31.110 --privileged=true --restart=always -tid goldendb-release-docker.artnj.zte.com.cn/build/centos7.8/alldev:db /sbin/init
docker run --name proxy_10.229.31.111 -v /etc/localtime:/etc/localtime:ro --net drliu --ip 10.229.31.111 --privileged=true --restart=always -tid goldendb-release-docker.artnj.zte.com.cn/build/centos7.8/alldev:proxy /sbin/init
docker run --name lds_10.229.31.112 -v /etc/localtime:/etc/localtime:ro --net drliu --ip 10.229.31.112 --privileged=true --restart=always -tid goldendb-release-docker.artnj.zte.com.cn/build/centos7.8/alldev:lds /sbin/init
docker run --name gtm_10.229.31.113 -v /etc/localtime:/etc/localtime:ro --net drliu --ip 10.229.31.113 --privileged=true --restart=always -tid goldendb-release-docker.artnj.zte.com.cn/build/centos7.8/alldev:gtm /sbin/init
docker exec -ti db_10.229.31.110 /bin/bash -c "echo root:'db1x@NJ+1'|chpasswd";echo;
docker exec -ti proxy_10.229.31.111 /bin/bash -c "echo root:'db1x@NJ+1'|chpasswd";echo;
docker exec -ti lds_10.229.31.112 /bin/bash -c "echo root:'db1x@NJ+1'|chpasswd";echo;
docker exec -ti gtm_10.229.31.113 /bin/bash -c "echo root:'db1x@NJ+1'|chpasswd";echo
docker ps -a |grep drliu|grep -v grep|awk '{print $1}'|xargs docker stop
docker images|grep base|grep -v grep|awk '{print $3}'|xargs docker rmi -f