Centos+Postgresql (Docker)

本文分享了使用Docker创建数据库容器的经验,特别是针对通过主从复制实现数据流复制的场景。文章提到了Windows家庭版不支持Docker CE,并讨论了解决安装过程中遇到的问题的方法。此外,还提供了一个解决运行PostgreSQL初始化设置时遇到D-Bus失败问题的具体命令。

To share the experiences to create docker containers of databases, for stream duplication of data via master and slave.

  • Windows home additon does not support Docker ce for windows.
    • You may encounter error when installing Docker with the installer downloaded from the official website.
  • Database services should be run standalone when the new container is created.
    • You may encounter D-Bus failure when you want to run the "posgresql*.*-setup initdb". This is solvable if your create a standalone command when creating the new container.
~$ sudo docker run -d --name=containername --privileged=true imagename:tagname /usr/sbin/init
    • "run" is equavilent to "create";
    • -d means the command is working at background;
    • --name gives the name of your container;
    • --privileged specifies the root privilege in the container;
    • imagename:tagname gives the image used to create the container;
    • /usr/sbin/init is the guard process running for -d.
  • "exec" works better than "attach".
    • attach does not have rich options to run script in the container.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值