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

相关推荐
静听山水11 小时前
StarRocks高级特性
数据库
范纹杉想快点毕业11 小时前
从单片机基础到程序框架:全方位技术深度解析
数据库·mongodb
晚风_END11 小时前
Linux|操作系统|elasticdump的二进制方式部署
运维·服务器·开发语言·数据库·jenkins·数据库开发·数据库架构
devmoon11 小时前
Polkadot SDK 自定义 Pallet Benchmark 指南:生成并接入 Weight
开发语言·网络·数据库·web3·区块链·波卡
数据知道11 小时前
PostgreSQL 故障排查:紧急排查与 SQL 熔断处理(CPU 占用 100% 等情况)
数据库·sql·postgresql
静听山水11 小时前
Redis的Pipeline (管道)
数据库·redis·php
数据知道11 小时前
PostgreSQL 性能优化: I/O 瓶颈分析,以及如何提高数据库的 I/O 性能?
数据库·postgresql·性能优化
繁华落尽,寻一世真情11 小时前
【基于 AI 的智能小说创作助手】MuMuAINovel-sqlite 基于 AI 的智能小说创作助手
数据库·人工智能·sqlite
TOPGO智能11 小时前
在腾讯CloudStudio上成功部署Moltbot接入飞书
数据库
云边有个稻草人11 小时前
关系数据库替换用金仓:数据迁移过程中的完整性与一致性风险
数据库·国产数据库·kingbasees·金仓数据库·关系数据库替换用金仓