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

相关推荐
山峰哥18 分钟前
数据库工程:Explain执行计划对比实战指南‌
数据库·sql·oracle·深度优先·宽度优先
crisps_ww26 分钟前
自媒体运营分析-BI可视化仪表盘制作
数据库
Geek-Chow38 分钟前
微服务认证与授权:01 — 概念
java·前端·数据库
烤代码的吐司君1 小时前
Redis IO 多路复用原理与引入原因深度解析
数据库·redis·php
Database_Cool_2 小时前
单库瓶颈解决方案首选:阿里云 PolarDB-X 平滑替代分库分表
数据库·阿里云
2503_931712482 小时前
10m/s超高速电梯:西奥XO-NEWIII如何树立行业速度标杆
java·大数据·数据库
无小道3 小时前
Redis——redis和mysql的数据同步
数据库·redis·mysql
AI的探索之旅3 小时前
从 Ubuntu 14.04 到 24.04:TI AM335x 开发环境完整迁移与 Agent 接管方案
linux·数据库·嵌入式硬件·ubuntu·postgresql
辰合软件3 小时前
通达OA目录结构与核心文件解析
android·数据库·oracle
名不经传的养虾人4 小时前
从0到1:企业级AI项目迭代日记 Vol.61|记忆不是越多越好,装一道门比装满更重要
数据库·人工智能·ai编程·ai工作流·企业ai