centos7 + citus12 + postgresql 14 安装

news/2024/7/9 22:38:14 标签: postgresql, 数据库


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.niftyadmin.cn/n/5069810.html

相关文章

Android12.0 app调用hal层接口功能实现系列三(frameworks层实现)

1.前言 在12.0的系统产品定制化开发中,对于一些需要在app中调用hal层的一些接口来实现某些功能而言,就需要打通app到hal的接口,实现功能需求,这一节首先讲在hal层中提供接口然后在jni层实现hal层接口调用,在framework层实现添加服务调用jni接口,接下来就实现第三部分的相…

AI:08-基于深度学习的车辆识别

随着汽车行业的迅速发展,车型识别在交通管理、智能驾驶和车辆安全等方面变得越来越重要。基于深度学习的车型识别技术为实现高效准确的车辆分类和检测提供了强大的工具。本文将介绍如何利用深度学习技术来实现车型识别,并提供相应的代码示例。 数据收集和预处理: 为了训练…

包装类?为什么需要包装类?

包装类是一种用于将基本数据类型(如整数、浮点数、字符等)封装成对象的类。在Java和许多其他编程语言中,基本数据类型是不具备面向对象特性的,它们不是对象,不能进行方法调用或参与泛型化。为了弥补这一不足,Java引入了包装类,允许基本数据类型被当作对象来处理。 Java…

TomCat关键技术

一、Tomcat 是什么 Tomcat 是一个 HTTP 服务器。通过前面的学习,我们知道HTTP 协议就是 HTTP 客户端和 HTTP 服务器之间的交互数据的格式,同时也通过 ajax 和 Java Socket 分别构造了 HTTP 客户端。HTTP 服务器我们也同样可以通过 Java Socket 来实现. 而 Tomcat 就是基于 J…

nodejs+vue晨拾酒馆管理系统elementui

晨拾酒馆管理系统,主要的模块包括管理员;系统首页、个人中心、用户管理、图书分类管理、图书信息管理、图书借阅管理、图书归还管理、图书入库管理、热门图书管理、论坛管理、系统管理,用户;系统首页、个人中心、图书借阅管理、图…

05.数据解析之正则表达式

1、正则表达式 ​ 正则表达式,又称规则表达式。(英语:Regular Expression,在代码中常简写为regex、regexp或RE),计算机科学的一个概念。正则表达式通常被用来检索、替换那些符合某个模式(规则)的文本。——…

C++设计模式-装饰器(Decorator)

目录 C设计模式-装饰器(Decorator) 一、意图 二、适用性 三、结构 四、参与者 五、代码 C设计模式-装饰器(Decorator) 一、意图 动态地给一个对象添加一些额外的职责。就增加功能来说,Decorator模式相比生成子…