mkdir /pgdata
./configure --prefix=/usr/pgsql9.6
问题
1、readline library not found
yum install readline;
yum install readline-dev;
[root@BJBJ-TYCJ-C22 postgresql-9.6.6]# yum install readline;
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
ftp://172.26.32.144/pub/repodata/repomd.xml: [Errno 14] FTP Error 530 - Access denied: 530
Trying other mirror.
Package readline-6.2-10.el7.x86_64 already installed and latest version
Nothing to do
[root@BJBJ-TYCJ-C22 postgresql-9.6.6]# rpm -qa | grep readline
readline-6.2-10.el7.x86_64
[root@BJBJ-TYCJ-C22 postgresql-9.6.6]# yum search readline
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
======================================================================== N/S matched: readline ========================================================================
readline-devel.x86_64 : Files needed to develop programs which use the readline library
perl-Term-UI.noarch : Term::ReadLine user interface made easy
readline.x86_64 : A library for editing typed command lines
Name and summary matches only, use "search all" for everything.
根据提示,有一个包引起了注意 "readline-devel", 猜想可能与这个包有关
yum install -y readline-devel 问题解决
make
make install
useradd -U postgres
配置用户环境变量
export PATH=/usr/pgsql/bin:$PATH
export LD_LIBRARY_PATH=/usr/pgsql/lib:$LD_LIBRARY_PATH
export PGDATA=/pgdata/
export PGHOST=/tmp
将数据库数据目录和安装目录分别准备好
[root@GuangFa_PG9 ~]# mkdir /pgdata
[root@GuangFa_PG9 ~]# cd /usr/
[root@GuangFa_PG9 usr]# ln -s pgsql9.6 pgsql
[root@GuangFa_PG9 usr]# chown -R postgres:postgres /pgdata
[root@GuangFa_PG9 usr]# chown -R postgres:postgres pgsql
[root@GuangFa_PG9 usr]# chown -R postgres:postgres pgsql9.6
[root@GuangFa_PG9 usr]# chmod 700 /pgdata/
[root@BJBJ-TYCJ-C22 usr]# su - postgres
[postgres@BJBJ-TYCJ-C22 ~]$ ll
total 0
[postgres@BJBJ-TYCJ-C22 ~]$ initdb
在初始化完成之后,Pg默认时不会打开日志的,所以报错或是提示什么的就直接输出到屏幕上,这对运维当然是不方便,所以可以配置一下日志策略
将日志收集打开
logging_collector = on
log_directory = 'pg_log'
1
2
这两个参数要设置好,这个参数修改是需要重启的。
一般情况下这三个策略是可以满足一般的日志要求了。如下
每天生成一个新的文件
log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'
log_truncate_on_rotation = off
log_rotation_age = 1d
log_rotation_size = 0
pg_ctl start
Server端配置
配置PG环境
安装好pg,且在root和postgres下都配置好pg的环境变量,以供后续使用
在hba控制文件中直接加入这一行
host zabbix zabbix 192.168.0.0/24 trust
host all all 127.0.0.1/32 md5
groupadd zabbix
useradd -g zabbix zabbix
passwd zabbix
zabbix
ddddddddddddddddddd
最新推荐文章于 2022-02-09 17:40:02 发布