广告合作
  • 今日头条

    今日头条

  • 百度一下

    百度一下,你就知道

  • 新浪网

    新浪网 - 提供新闻线索,重大新闻爆料

  • 搜狐

    搜狐

  • 豆瓣

    豆瓣

  • 百度贴吧

    百度贴吧——全球领先的中文社区

  • 首页 尚未审核订阅工具 订阅

    postgresql集群搭建方法

    来源:网络收集  点击:  时间:2024-07-10
    【导读】:
    本文是通过ansible自动化同时安装postgresql几个节点,首先要配置好ansible,通过命令cat /etc/ansible/hosts查看节点ip工具/原料morepostgresqlCentos7方法/步骤1/8分步阅读

    创建用户postgres

    ansible all -m shell -a useradd postgres

    2/8

    修改postgres用户的密码

    ansible all -m shell -a echo postgres:postgres | chpasswd

    3/8

    批量安装基础软件包

    ansible all -m shell -a yum install -y flex bison readline-devel zlib-devel openjade docbook-style-dsssl gcc

    4/8

    在每个节点上获取安装软件,并解压缩

    5/8

    全部节点都创建pgxc路径,用来存放postgres文件

    ansible all -m shell -a su - postgres -c mkdir -p /home/postgres/pgxc/nodes/

    6/8

    修改每个节点的.bashrc文件

    su - postgres

    vi .bashrc

    export PGHOME=/home/postgres/pgxl

    export PGUSER=postgres

    export LD_LIBRARY_PATH=$PGHOME/lib:$LD_LIBRARY_PATH

    export PATH=$PGHOME/bin:$PATH

    source ~/.bashrc

    7/8

    关闭iptables

    systemctl stop iptables.service

    systemctl disable iptables.service

    关闭SELinux

    setenforce 0

    8/8

    pgxc_ctl -c pgxc_ctl.conf init all

    注意事项

    安装完成注意开放防火墙的一些端口

    POSTGRESQL数据库
    本文关键词:

    版权声明:

    1、本文系转载,版权归原作者所有,旨在传递信息,不代表看本站的观点和立场。

    2、本站仅提供信息发布平台,不承担相关法律责任。

    3、若侵犯您的版权或隐私,请联系本站管理员删除。

    4、文章链接:http://www.1haoku.cn/art_946422.html

    相关资讯

    ©2019-2020 http://www.1haoku.cn/ 国ICP备20009186号05-05 06:02:57  耗时:0.026
    0.0258s