首页 > 数据库 > > 在CentOS上部署多节点Citus集群
# Add Citus repository for package manager curl https://install.citusdata.com/community/rpm.sh | sudo bash
# install PostgreSQL with Citus extension sudo yum install -y citus72_10 # initialize system database (using RHEL 6 vs 7 method as necessary) sudo service postgresql-10 initdb || sudo /usr/pgsql-10/bin/postgresql-10-setup initdb # preload citus extension echo "shared_preload_libraries = 'citus'" | sudo tee -a /var/lib/pgsql/10/data/postgresql.conf
sudo vi /var/lib/pgsql/10/data/postgresql.conf
# Uncomment listen_addresses for the changes to take effect listen_addresses = '*'
sudo vi /var/lib/pgsql/10/data/pg_hba.conf
local all all peer
local replication all peer
host all all 192.168.99.1/24 trust
host all all 0.0.0.0/0 md5
firewall-cmd --zone=public --query-port=5432/tcp
firewall-cmd --zone=public --add-port=5432/tcp --permanent
firewall-cmd --reload
# start the db server sudo service postgresql-10 restart # and make it start automatically when computer does sudo chkconfig postgresql-10 on
sudo -i -u postgres psql -c "CREATE EXTENSION citus;"
postgres=# \password postgres #给postgres用户设置密码 Enter new password: Enter it again:
sudo -i -u postgres psql -c "SELECT * from master_add_node('192.168.99.101', 5432);" sudo -i -u postgres psql -c "SELECT * from master_add_node('192.168.99.102', 5432);"
sudo -i -u postgres psql -c "SELECT * FROM master_get_active_worker_nodes();"
sudo -i -u postgres psql
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26692020/viewspace-3167373/ ,如需转载,请注明出处,否则将追究法律责任。