前言
本文主要介绍了关于CentOS中部署多节点Citus集群的相关内容,分享出来供大家参考学习,下面话不多说了,来一起看看详细的介绍吧。
1、在所有节点执行以下步骤
Step 01 添加Citus Repostory
?
1
2 |
# Add Citus repository for package manager
curl https: //install .citusdata.com /community/rpm .sh | sudo bash |
Step 02 安装Citus并且初始化DB
?
1
2
3
4
5
6 |
# 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 |
Step 03 配置postgresql.conf
?
1 |
sudo vi /var/lib/pgsql/10/data/postgresql .conf |
?
1
2 |
# Uncomment listen_addresses for the changes to take effect
listen_addresses = '*' |
Step 04 配置pg_hba.conf
?
1 |
sudo vi /var/lib/pgsql/10/data/pg_hba .conf |
?
1
2
3
4 |
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 |
Step 05 配置防火墙
查看
?
1 |
firewall-cmd --zone=public --query-port=5432 /tcp |
添加5432端口(–permanent永久生效,没有此参数重启后失效)
?
1 |
firewall-cmd --zone=public --add-port=5432 /tcp --permanent |
重新载入
?
1 |
firewall-cmd --reload |
Step 06 启动服务
?
1
2
3
4 |
# start the db server
sudo service postgresql-10 restart
# and make it start automatically when computer does
sudo chkconfig postgresql-10 on |
Step 07 给需要的数据库安装Citus扩展
?
1 |
sudo -i -u postgres psql -c "CREATE EXTENSION citus;" |
Step 08 设置密码
?
1
2
3 |
postgres= # \\password postgres #给postgres用户设置密码
Enter new password:
Enter it again: |
2、在coordinator节点额外执行以下步骤
Step 01 添加worker节点信息
添加worker节点的IP地址(或者DNS名称)和端口号到pg_dist_node表。
?
1
2 |
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);" |
Step 02 验证安装是否成功
?
1 |
sudo -i -u postgres psql -c "SELECT * FROM master_get_active_worker_nodes();" |
Step 03 开始使用
?
1 |
sudo -i -u postgres psql |
总结
以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,如果有疑问大家可以留言交流,谢谢大家对快网idc的支持。
参考资料:
https://docs.citusdata.com/en/v7.2/installation/production_rhel.html
原文链接:http://www.cnblogs.com/MeteorSeed/p/8465536.html
相关文章
猜你喜欢
- ASP.NET自助建站系统的域名绑定与解析教程 2025-06-10
- 个人服务器网站搭建:如何选择合适的服务器提供商? 2025-06-10
- ASP.NET自助建站系统中如何实现多语言支持? 2025-06-10
- 64M VPS建站:如何选择最适合的网站建设平台? 2025-06-10
- ASP.NET本地开发时常见的配置错误及解决方法? 2025-06-10
TA的动态
- 2025-07-10 怎样使用阿里云的安全工具进行服务器漏洞扫描和修复?
- 2025-07-10 怎样使用命令行工具优化Linux云服务器的Ping性能?
- 2025-07-10 怎样使用Xshell连接华为云服务器,实现高效远程管理?
- 2025-07-10 怎样利用云服务器D盘搭建稳定、高效的网站托管环境?
- 2025-07-10 怎样使用阿里云的安全组功能来增强服务器防火墙的安全性?
快网idc优惠网
QQ交流群
您的支持,是我们最大的动力!
热门文章
-
2025-05-25 44
-
2025-05-25 14
-
2025-05-27 68
-
2025-05-29 11
-
2025-05-25 68
热门评论