pg数据库主备安装(异步同步)
主库配置:
1:在主服务器安装PostgreSQL,主服务器初始化并启动PostgreSQL并作如下配置。
# su - postgres
$ pg_ctl start
$ psql
2:主PostgreSQL上,创建备份用户,并设置权限:
postgres=# create user standby_u...
\l # 查看所有数据库
\c # 切换数据库
\di # 查看索引
\dt # 查看表
\ds # 查看序列
\q # 推出
\timing on # 开机sql查询时间
\dns # 查看schema
\du # 查看用户
$ ps -ef|grep postgres
$ psql -Upostgres -d...
下载地址:https://www.postgresql.org/ftp/source/
编译安装
设置主机名
hostnamectl set-hostname pg01
PostgreSQL编译安装
1:安装必要工具包 readline-devel、zlib-devel、gcc 支持
# yum install readline-dev...