ddddddddddddddddddd

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



















































  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

貔貅526

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值