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

相关推荐
NineData3 分钟前
日常巡检 Oracle 时,ChatDBA 怎么把会话、SQL 和等待事件一起看
数据库·sql·oracle·ninedata·故障排查·chatdba·实例巡检
海天一色y8 分钟前
深入理解 RAG 技术:从语义张量到向量数据库,Milvus 与 FAISS 全面对比
数据库·milvus·faiss
爱吃羊的老虎9 分钟前
【数据库】模块二:SQL 语句、高级特性与优化
数据库·oracle
Rain5099 分钟前
2.4. PostgreSQL 数据库连接与实战指南
前端·数据库·人工智能·后端·postgresql·数据分析
爱喝水的鱼丶15 分钟前
SAP-ABAP:SAP表与视图权限管控方案:表维护权限、视图访问权限配置实操
运维·数据库·性能优化·sap·abap·权限·表和视图
tomcoding15 分钟前
深入解析Oracle数据块的内部结构
数据库·oracle
pixcarp10 小时前
知识库系统的内容资产闭环怎么设计
服务器·数据库·后端·golang
JosieBook10 小时前
【数据库】时序预测能力的分级进化:TimechoAI如何让每一类用户都能精准预见未来
java·开发语言·数据库
吴声子夜歌12 小时前
SQL经典实例——使用多张表
数据库·sql
倔强的石头_13 小时前
《Kingbase护城河》——深度解密数据库行锁冲突与等待事件架构
数据库