centos7 + citus12 + postgresql 14 安装

1 安装及编译

yum install -y centos-release-scl-rh epel-release

yum update -y

yum groupinstall -y 'Development Tools'

yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm

yum install -y postgresql14-devel postgresql14-server postgresql14-contrib \

git libcurl-devel libxml2-devel libxslt-devel \

libzstd-devel llvm-toolset-7-clang llvm5.0 lz4-devel \

openssl-devel pam-devel readline-devel

git clone https://github.com/citusdata/citus.git

cd citus

PG_CONFIG=/usr/pgsql-14/bin/pg_config ./configure

make

make install

2 所有节点:postgresql配置修改

pg_hba.conf

Allow unrestricted access to nodes in the local network. The following ranges

correspond to 24, 20, and 16-bit blocks in Private IPv4 address spaces.

host all all 192.168.56.0/24 trust

postgresql.conf:

Uncomment listen_addresses for the changes to take effect

listen_addresses = '*'

shared_preload_libraries = 'citus'

3 重启postgresql:

pg_ctl restart

4 所有节点:创建扩展citus

psql:

CREATE EXTENSION citus;

5 对应的节点上,修改hosts文件

vi /etc/hosts:

192.168.56.90 cn1

192.168.56.91 wn1

192.168.56.92 wn2

6 配置 coordinator node

Register the hostname that future workers will use to connect

to the coordinator node.

You'll need to change the example, 'coord.example.com',

to match the actual hostname

psql:

SELECT citus_set_coordinator_host('cn1', 5432);

Add the worker nodes.

Similarly, you'll need to change 'worker-101' and 'worker-102' to the

actual hostnames

SELECT * from citus_add_node('wn1', 5432);

SELECT * from citus_add_node('wn2', 5432);

-- rebalance the shards over the new worker nodes

SELECT rebalance_table_shards();

Verify that installation has succeeded:

SELECT * FROM citus_get_active_worker_nodes();

相关推荐
wno7046 分钟前
Spring Boot中JdbcTemplate与Mybatis使用PostgreSQL
spring boot·postgresql·mybatis
Random Glow9 分钟前
聚簇索引:为什么主键顺序决定插入性能
数据库·mysql·性能优化·innodb·索引
软件技术NINI10 分钟前
基于PHP和MySQL的快递代收点管理系统的设计与实现
开发语言·javascript·数据库·mysql·毕业设计·php·毕设
吹什么轩34 分钟前
MySQL 增删改查(CRUD)完全指南:从 INSERT 到 GROUP BY
数据库·mysql
为思念酝酿的痛1 小时前
MySQL表的约束
数据库·mysql
时间售卖铺1 小时前
MySQL存储过程流程控制全解析
运维·数据库·mysql·云原生
拾起零碎1 小时前
U8/触发器,把自定义项写入批次档案
数据库
IT19959 小时前
Fail2Ban 防护 MySQL 实战|登录失败 3 次,IP 封禁 24 小时
数据库·mysql
夕除9 小时前
redis--IO 多路复用(select + poll)
数据库·sql
lzhdim13 小时前
100条常用SQL语句
数据库·sql·mysql·mybatis