pgxl 集群搭建

一 预备
1 下载安装解压源码 /opt/
curl -O http://files.postgres-xl.org/postgres-xl95r1beta1.tar.gz
tar -zxvf postgres-xl95r1beta1.tar.gz
mv postgres-xl95r1beta1.tar.gz postgres-xl
2 编译
$ yum -y gcc
$ cd postgres-xl
$ pwd
/opt/postgres-xl
$ ./configure
报错 :configure: error: readline library not found
解决 : $ rpm -qa | grep readline
readline-6.2-9.el7.x86_64
$ yum search readline

$ yum install -y readline-devel

$ ./configure
报错 :configure: error: zlib library not found
解决 : 思路同上
$ yum install -y

$ ./configure
OK!
$ make
报错 : ERROR: `Perl' is missing on your system.
解决 : $ yum install -y perl
$ ./configure

依次需要安装 flex bison
$ make install
默认安装目录 /usr/local/pgsql 可以 ./configure --prefix= path 指定目录
3 安装集群管理工具 pgxc_ctl
cd /opt/postgres-xl/contrib/pgxc_ctl/
$ make
$ make install

二 环境变量
$ vi /etc/profile.d/pgxl.sh
export PGHOME=/usr/local/pgsql
export PGUSER=postgres
export LD_LIBRARY_PATH=$PGHOME/lib
export PATH=$PGHOME/bin:$PATH
export dataDirRoot=$HOME/DATA/pgxl/nodes

$ chmod 777 /etc/profile.d/pgxl.sh
$ source /etc/profile.d/pgxl.sh
三 创建新用户
$ useradd postgres
$ passwd postgres
四 修改 目录权限
chown -R postgres:postgres /usr/local/pgsql
五 免密码登录
$ su - postgres
$ ssh-keygen -t dsa
$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
$ chmod 710 a~/.ssh/authorized_keys
验证 ssh localhost
注意当前用户是postgres
六 使用pgxc_ctl 命令工具
$ pgxc_ctl 进入管理工具
参考
Hello world 例子
http://files.postgres-xl.org/documentation/tutorial-createcluster.html
具体操作
http://files.postgres-xl.org/documentation/pgxc-ctl.html
备注 slave coordinator/datanode 启动失败

postgres: Postgres-XL: must start as either a Coordinator (--coordinator) or Data Node (--datanode)
pg_ctl: could not determine the data directory using command ""/usr/local/pgsql/bin/postgres" -C data_directory -D "/home/postgres/DATA/pgxl/nodes/dir.1" "

refer

http://blog.csdn.net/liuzongxi/article/details/46380985

http://blog.csdn.net/jj_tyro/article/details/45219007

常用命令

查看状态 monitor all

初始化 init xx

停止 stop  xx

启动 start xx

清除 clean xx

xx 为 monitor 显示的全名称,特例 gtm proxy 改为 gtm_proxy

postgres-xl 集体搭建的更多相关文章

  1. postgres-xl 集体搭建(2)

    $ pgxc_ctl prepare config minimal 生成一个单机伪分布集群配置简单模板 根据该模板进行简单修改就可以配置成一个集群 $ pgxc_ctl init all $ pgxc ...

  2. postgres-xl 集体搭建(1)

    安装并编辑脚本 cd /opt/curl -O http://files.postgres-xl.org/postgres-xl95r1beta1.tar.gztar -zxvf postgres-x ...

  3. 以windows服务方式快速部署免安装版Postgres数据库

    目录 以windows服务方式快速部署免安装版Postgres数据库 1.下载Postgresql数据库免安装包 2.安装环境准备及验证 解压文件 测试环境依赖 3.创建并初始化数据目录 创建数据目录 ...

  4. 2021 年写 JavaScript 代码的 17 个优化技巧

    我们经常会写一些 JavaScript 代码,但是如何写出干净又易维护的代码呢?本文将讲解 17 个 JavaScript 代码的技术帮助你提高编程水平,此外,本文可以帮助您为 2021 年的 Jav ...

  5. Postgres 主从复制搭建步骤

    系统版本: CentOS Linux release 7.5.1804 (Core) 数据库 psql (PostgreSQL) 10.5 2台机器ip : 172.17.0.3 /172.17.0. ...

  6. Android学习——windows下搭建Cygwin环境

    在上一篇博文<Android学习——windows下搭建NDK_r9环境>中,我们详细的讲解了在windows下进行Android NDK开发环境的配置,我们也讲到了在NDk r7以后,我 ...

  7. Android学习——windows下搭建NDK_r9环境

    1. NDK(Native Development Kit) 1.1 NDK简介 Android NDK是一套允许开发人员使用本地代码(如C/C++)进行Android APP功能开发的工具,通过这个 ...

  8. Socket实现仿QQ聊天(可部署于广域网)附源码(4)-加入数据库系统搭建完成

    1.前言 这是本系列的第四篇文章,上一篇我们讲到实现了客户端对客户端的抖屏与收发各种类型文件,本篇文章我们加入SQLServer数据库实现登录与好友的添加等功能,并对界面做了美化处理.向往常一样我会把 ...

  9. centos6搭建gitlab

    前言 原来的项目放在公网的gitlab上,处于安全考虑,在内网搭建一套,有图形界面,可以直接从外网git导入进来,使用了一下觉得挺方便,把安装流程记录下来,参考官网:https://gitlab.co ...

随机推荐

  1. A. Alyona and Numbers(CF ROUND 358 DIV2)

    A. Alyona and Numbers time limit per test 1 second memory limit per test 256 megabytes input standar ...

  2. 纯 CSS 实现三角形尖角箭头的实例

    上次无意中发现了个使用纯 CSS 实现三角形尖角箭头的方法 http://blog.csdn.net/zhouzme/article/details/18901943 ,但没有怎么用上,也没有详细完整 ...

  3. 一个突发性的误解C# 引用类型

    最近再看IOCP,结果里面的一个赋值过程,造成了误解. test t1 = new test(); test t2 = new test(); test t4 = new test(); t1= t2 ...

  4. 实验吧Web-天网管理系统

    笔记 == : 比较运算符号  不会检查条件式的表达式的类型 ===:  恒等计算符 , 同时检查表达式的值与类型.(会检查表达式类型,如bool) PHP序列化与反序列化serialize() 对输 ...

  5. 第三节,入门知识和windows系统安装python环境

    1.使用Linux的好处(稳定)不容易死机,可以长达几年不间断运行(安全)相对windows系统更安全,相对更不容受到各种攻击(开源)免费使用2.安装好虚拟机VMware软件,和Linux系统,以及X ...

  6. C#.NET的微信功能开发学习

    对于新手的我来说,我不是申请一个微信公众号认证后进行开发,我是申请一个订阅号,然后通过自己申请的订阅号的公众平台测试号来学习. 一,申请后成功后,打开开发者工具-公众平台测试号 二,进去公众平台测试号 ...

  7. 遮盖层实现(jQuery+css+html)

    <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title&g ...

  8. Modernizr 测试浏览器是否兼容相应属性

    Modernizr  测试浏览器是否兼容相应属性

  9. Android常用Permission

    位置相关: android.permission.WRITE_GSERVICES 允许程序修改Google服务地图(Allows an application to modify the Google ...

  10. jquery.cookie.js 的配置

    一个轻量级的cookie 插件,可以读取.写入.删除 cookie. jquery.cookie.js 的配置 首先包含jQuery的库文件,在后面包含 jquery.cookie.js 的库文件. ...