postgres-xl 集体搭建
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 集体搭建的更多相关文章
- postgres-xl 集体搭建(2)
$ pgxc_ctl prepare config minimal 生成一个单机伪分布集群配置简单模板 根据该模板进行简单修改就可以配置成一个集群 $ pgxc_ctl init all $ pgxc ...
- postgres-xl 集体搭建(1)
安装并编辑脚本 cd /opt/curl -O http://files.postgres-xl.org/postgres-xl95r1beta1.tar.gztar -zxvf postgres-x ...
- 以windows服务方式快速部署免安装版Postgres数据库
目录 以windows服务方式快速部署免安装版Postgres数据库 1.下载Postgresql数据库免安装包 2.安装环境准备及验证 解压文件 测试环境依赖 3.创建并初始化数据目录 创建数据目录 ...
- 2021 年写 JavaScript 代码的 17 个优化技巧
我们经常会写一些 JavaScript 代码,但是如何写出干净又易维护的代码呢?本文将讲解 17 个 JavaScript 代码的技术帮助你提高编程水平,此外,本文可以帮助您为 2021 年的 Jav ...
- Postgres 主从复制搭建步骤
系统版本: CentOS Linux release 7.5.1804 (Core) 数据库 psql (PostgreSQL) 10.5 2台机器ip : 172.17.0.3 /172.17.0. ...
- Android学习——windows下搭建Cygwin环境
在上一篇博文<Android学习——windows下搭建NDK_r9环境>中,我们详细的讲解了在windows下进行Android NDK开发环境的配置,我们也讲到了在NDk r7以后,我 ...
- Android学习——windows下搭建NDK_r9环境
1. NDK(Native Development Kit) 1.1 NDK简介 Android NDK是一套允许开发人员使用本地代码(如C/C++)进行Android APP功能开发的工具,通过这个 ...
- Socket实现仿QQ聊天(可部署于广域网)附源码(4)-加入数据库系统搭建完成
1.前言 这是本系列的第四篇文章,上一篇我们讲到实现了客户端对客户端的抖屏与收发各种类型文件,本篇文章我们加入SQLServer数据库实现登录与好友的添加等功能,并对界面做了美化处理.向往常一样我会把 ...
- centos6搭建gitlab
前言 原来的项目放在公网的gitlab上,处于安全考虑,在内网搭建一套,有图形界面,可以直接从外网git导入进来,使用了一下觉得挺方便,把安装流程记录下来,参考官网:https://gitlab.co ...
随机推荐
- 第四天 内置函数2 随机码 装饰器 迭代器、生成器 递归 冒泡算法 JSON
关于函数的return li = [11,22,33,44] def f1(arg): arg.append(55) li = f1(li) print(li) 因为li = f1(li) 实际赋值的 ...
- Gulp构建
整理自 https://markpop.github.io/2014/09/17/Gulp%E5%85%A5%E9%97%A8%E6%95%99%E7%A8%8B/ 已经有package.json 第 ...
- L3-001. 凑零钱
L3-001. 凑零钱 题目链接:https://www.patest.cn/contests/gplt/L3-001 动态规划 这道题一看就知道应该用背包思想来做,不过想了好久没什么思路(dp实在是 ...
- HUST 1404 Hamming Distance(字符串)
Hamming Distance Description Have you ever heard of the Hamming distance. It is the number of positi ...
- Leetcode 074 Search a 2D Matrix
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the follo ...
- redis win版安装
直接来看看redis怎么安装到windows系统上,并开启他的服务. 可以在这里下载https://github.com/dmajkic/redis/downloads. 我用的是64位的,解压后的结 ...
- Objective-C中关于请求返回NSData数据解析成NSDictionary或NSArray的方法
1.如果后台返回的是字典或数组的data型,直接使用以下方法转换: { // Data 转成 字典 其中responseObject为返回的data数据 NSDictionary *resultDic ...
- #define const extern
将父类中的常量放到. m文件,子类就不会重复包含了.之后再.h文件中用extern NSSting * const ILScoreShowStartTime;// extern 用来声明变量和函数.c ...
- Laravel框架开发规范-修订版
1.PHP编码规范 1.1 标签 PHP 程序可以使用<?php ?>或<?= ?>来界定PHP代码 在HTML 页面中嵌入纯变量时,使用<?= ?>这样的形式 纯 ...
- 查看Android下生成的.db数据库
1.在cmd中找到sdk中的platform-tools文件夹. 2.输入adb shell命令. 3.再输入sqlite3 /data/data/com.svs.db/databases/svs.d ...