- 注意(创建postgres用户后,要从root进入postges,进行后边的操作,注意用户,主要使用的是和数据库有关的用户)
- 数据库主从配置:
- 对于主数据库安装完成后,要重新初始化,对于从数据库,不要进行初始化,对于原来初始化的主数据库,从数据库,删除默认的data文件夹,之后重新配置。
- 启动,停止,重启服务
- systemctl start postgresql-10.service
- systemctl stop postgresql-10.service
- systemctl restart postgresql-10.service
- #查看一个服务的状态
- systemctl status postgresql-10.service
- #开机时启用一个服务
- systemctl enable postgresql-10.service
- #开机时关闭一个服务
- systemctl disable postgresql-10.service
- #查看服务是否开机启动
- systemctl is-enabled postgresql-10.service
- 配置参考:https://www.cnblogs.com/hxlasky/p/12192612.html . (亲测可用)
- 在pg_basebackup的时候,会出现pg_basebackup 无法联结到服务器:没有到主机的路由
- 解决方式1,
- 查看防火墙,确保防火墙是关闭的 。 参考路径:https://jingyan.baidu.com/article/64d05a0297aede9e55f73bd7.html
- 关闭防火墙:systemctl stop firewalld.service . 查看状态:systemctl status firewalld.service
- 解决方式1,