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

相关推荐
APIshop9 分钟前
实战代码解析:item_get——获取某鱼商品详情接口
java·linux·数据库
洛_尘10 分钟前
MySQL 5:增删改查操作
数据库·mysql
老邓计算机毕设21 分钟前
SSM养老院老人健康信息管理系统t4p4x(程序+源码+数据库+调试部署+开发环境)带论文文档1万字以上,文末可获取,系统界面在最后面
数据库·计算机毕业设计·ssm 框架·养老院老人健康管理系统
AC赳赳老秦23 分钟前
跨境科技服务的基石:DeepSeek赋能多语言技术文档与合规性说明的深度实践
android·大数据·数据库·人工智能·科技·deepseek·跨境
理智的煎蛋31 分钟前
达梦数据库全流程操作指南
数据库·oracle
FreeBuf_40 分钟前
欧盟漏洞数据库正式上线,采用去中心化模式运营
数据库·去中心化·区块链
东方轧线43 分钟前
给 AI 安装高速缓存:实战 MCP 对接 Redis,实现热点数据的毫秒级读取与状态共享
数据库·人工智能·redis
2401_832298101 小时前
腾讯云TSearch存算分离,破解日志分析算力瓶颈
大数据·运维·数据库
Leo July1 小时前
【MySQL】MySQL数据库调优实战指南:从基础优化到架构升级
数据库·mysql·架构
l1t1 小时前
DeepSeek总结的在单节点上处理 1TB Parquet 数据方法
数据库·人工智能·duckdb