当前位置: 首页 > news >正文

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

http://www.lryc.cn/news/185314.html

相关文章:

  • MySQL、Oracle、SQL Server / MS Access 中的 NULL函数用法
  • App Store审核被拒原因与解决方案
  • ​LeetCode解法汇总121. 买卖股票的最佳时机
  • 【Go】go-es统计接口被刷数和ip访问来源
  • debian 安装 pg --chatGpt
  • 商城小程序代客下单程序开发演示
  • SpringBoot 整合 jetcache缓存
  • HTML5+CSS3+移动web 前端开发入门笔记(二)HTML标签详解
  • Maven 配置阿里云镜像
  • 矢量图绘制软件EazyDraw mac中文版软件介绍
  • Cocos Creator3.8 项目实战(四)巧用九宫格图像拉伸
  • 怎么使用jenkins设置web自动打包
  • 完美解决 flex 实现一行三个,显示多行,左对齐
  • 初识Spring
  • Mybatis 使用参数时$与#的区别
  • java基本数据类型和包装类型区别
  • 解锁Spring Boot的强大配置功能:@ConfigurationProperties与@PropertySources详解
  • Java和Vue字符串加密
  • Java:java版结巴分词:jieba-analysis
  • java生成一个符合密码学和安全性的随机秘钥
  • C++ - 右值引用 和 移动拷贝
  • 项目成员积分规则
  • Linux CentOS7 vim多窗口编辑
  • git使用,一点点
  • 第五章:最新版零基础学习 PYTHON 教程—Python 字符串操作指南(第八节 - 如何在 C/C++、Python 和 Java 中分割字符串?)
  • 【Java】语法特性篇
  • Vim教程
  • selenium查找网页如何处理网站资源一直加载非常卡或者失败的情况
  • 并发工具类库使用的常见问题
  • GD32F10X ----RTC