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. 第16 天 JavaWEB过滤器和监听器技术

    Day16 JavaWEB过滤器和监听器技术 复习: 1.大结果集分页mysql的实现,是使用那个关键字,从user表中取第一页的数据,长度为10,sql语句怎么写? 2.分页查询的起始位置(star ...

  2. scp免密码传送文件

    一.单向 ssh-keygen -t rsa 单向无密码访问远程服务器操作比较简单,比如服务器A需要无密码访问服务器B(A–>B),那么只需要在服务器A生成密钥对,将生成的公钥上传到服务器B的相 ...

  3. HTTP Basic Authentication认证的各种语言 后台用的

    访问需要HTTP Basic Authentication认证的资源的各种语言的实现 无聊想调用下嘀咕的api的时候,发现需要HTTP Basic Authentication,就看了下. 什么是HT ...

  4. 第九十八节,JavaScript语法、关键保留字及变量

    JavaScript语法.关键保留字及变量 学习要点: 1.语法构成 2.关键字保留字 3.变量 任何语言的核心都必然会描述这门语言最基本的工作原理.而JavaScript的语言核心就是ECMAScr ...

  5. js 对象 视频 插入元素

    <!DOCTYPE html><html lang="en"><head>  <meta charset="UTF-8" ...

  6. POJ 2413 How many Fibs?#二分+大数加法

    http://poj.org/problem?id=2413 #include<iostream> #include<cstdio> #include<cstring&g ...

  7. Java 集合 HashMap & HashSet 拾遗

    Java 集合 HashMap & HashSet 拾遗 @author ixenos 摘要:HashMap内部结构分析 Java HashMap采用的是冲突链表方式 从上图容易看出,如果选择 ...

  8. webapi中的路由约束

    Route Constraints Route constraints let you restrict how the parameters in the route template are ma ...

  9. Excel教程(5) - 日期与时间函数

    DATE 用途:返回代表特定日期的序列号. 语法:DATE(year,month,day) 参数:year 为一到四位,根据使用的日期系统解释该参 数.默认情况下,Excel for Windows ...

  10. c/c++常用的几个关键字总结

    一.volatile volatile提醒编译器它后面所定义的变量随时都有可能改变,因此编译后的程序每次需要存储或读取这个变量的时候,都会直接从变量地址中读取数据.如果没有volatile关键字,则编 ...