先在有网络的机器上下载rpm
citus10 + postgresql13
# Add Citus repository for package manager
curl https://install.citusdata.com/community/rpm.sh | sudo bash
# 安装使用yumdownloader下载安装包
yum -y install yum-utils
# 下载安装包以及依赖
yumdownloader citus100_13 --resolve --destdir /home/citus100_13
postgis3.1
# yum -y install wget
wget https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
yum -y install pgdg-redhat-repo-latest.noarch.rpm
yum -y install epel-release
yumdownloader postgis31_13 --resolve --destdir /home/postgis31_13
# 在线安装
yum -y install postgis31_13
无网络安装
把下载的包复制到机器上
cd /home/citus100_13
yum -y install *.rpm
cd /home/postgis31_13
yum -y install *.rpm
初始化集群
# install PostgreSQL with Citus extension
sudo yum install -y citus100_13
# initialize system database (using RHEL 6 vs 7 method as necessary)
sudo service postgresql-13 initdb || sudo /usr/pgsql-13/bin/postgresql-13-setup initdb
# preload citus extension
echo "shared_preload_libraries = 'citus'" | sudo tee -a /var/lib/pgsql/13/data/postgresql.conf
sudo vi /var/lib/pgsql/13/data/postgresql.conf
# Uncomment listen_addresses for the changes to take effect
listen_addresses = '*'
sudo vi /var/lib/pgsql/13/data/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 10.0.0.0/8 trust
# Also allow the host unrestricted access to connect to itself
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
sudo service postgresql-13 restart
# and make it start automatically when computer does
sudo chkconfig postgresql-13 on
sudo -i -u postgres psql -c "CREATE EXTENSION citus;"
sudo -i -u postgres psql -c "SELECT * from citus_add_node('worker-101', 5432);"
sudo -i -u postgres psql -c "SELECT * from citus_add_node('worker-102', 5432);"