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();

相关推荐
七牛开发者24 分钟前
为什么 Go 很适合 AI 辅助开发?
数据库·人工智能·python·elasticsearch·log4j
何以解忧,唯有..2 小时前
数据库索引失效的常见情况与优化策略
数据库·sql·oracle
这个DBA有点耶3 小时前
分布式数据库到底该不该上?从判断标准到架构选型的实战思考
数据库·架构·dba
01_ice3 小时前
MySQL库和表的操作
数据库·mysql
oradh4 小时前
Oracle UNDO表空间管理维护总结
数据库·oracle·undo表空间·undo表空间管理·undo表空间管理维护
布莱克6054 小时前
数据库索引分类:数据结构、物理存储与逻辑角度详解
数据结构·数据库
SelectDB4 小时前
DeepSeek Harness 接入 Litefuse:完善 Agent 可观测与评估能力
数据库
这个DBA有点耶5 小时前
从库延迟的“二次放大”效应:一次大事务,拖垮整个读写分离
数据库·mysql·架构
LearnYard5 小时前
自然语言驱动的数据图表生成:几款工具功能对比实践
数据库·百度·powerpoint
一个有温度的技术博主6 小时前
MySQL 三大日志协同机制:redo log、undo log 与 binlog 的联合运作
数据库·mysql·oracle