docker run --network pgsqlnetwork --name pgmaster -h pgsqlmaster -p 5432:5432 -e 'TZ=Asia/Shanghai' -e "POSTGRES_PASSWORD=chen1210" -v /data0/psql/master:/var/lib/postgresql/data -d postgres:12
docker run --network pgsqlnetwork --name pgslave -h pgslave -p 5433:5432 -e 'TZ=Asia/Shanghai' -e "POSTGRES_PASSWORD=chen1210" -v /data0/psql/slave:/var/lib/postgresql/data -v /data0/psql/repl:/var/lib/postgresql/repl -d postgres:12
docker run --network pgsqlnetwork --ip 172.18.0.11 --name pgslave2 -h pgslave2 -p 5434:5432 -e 'TZ=Asia/Shanghai' -e "POSTGRES_PASSWORD=chen1210" -v /data0/psql/slave2:/var/lib/postgresql/data -v /data0/psql/repl:/var/lib/postgresql/repl -d postgres:12
导出数据库
pg_dump -h 10.120.16.144 -U sense senseusers > ./144.sql
X8j3AhJ45w7W
导入
psql -U postgres -d postgres < ?C:\Users\lenovo\Desktop\pg\allms.sql
网友评论