linux版本
➜ ansible ansible -i hosts cache -u root -m shell -a 'uname -a '
10.39.47.62 | SUCCESS | rc=0 >>
Linux i-ec0m1585 3.10.0-327.4.5.el7.x86_64 #1 SMP Mon Jan 25 22:07:14 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
10.39.47.60 | SUCCESS | rc=0 >>
Linux i-knnb6822 3.10.0-327.4.5.el7.x86_64 #1 SMP Mon Jan 25 22:07:14 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
10.39.47.63 | SUCCESS | rc=0 >>
Linux i-gsnsfm8y 3.10.0-327.4.5.el7.x86_64 #1 SMP Mon Jan 25 22:07:14 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
10.39.47.61 | SUCCESS | rc=0 >>
Linux i-39x6lylx 3.10.0-327.4.5.el7.x86_64 #1 SMP Mon Jan 25 22:07:14 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
机器列表
hostname | ip |
---|---|
couchbase-60 | 10.39.47.60 |
couchbase-61 | 10.39.47.61 |
couchbase-62 | 10.39.47.62 |
couchbase-63 | 10.39.47.63 |
检查防火墙是否关闭
➜ ansible ansible -i hosts cache -u root -m shell -a 'systemctl status firewalld'
10.39.47.63 | FAILED | rc=4 >>
Unit firewalld.service could not be found.non-zero return code
10.39.47.61 | FAILED | rc=4 >>
Unit firewalld.service could not be found.non-zero return code
10.39.47.62 | FAILED | rc=4 >>
Unit firewalld.service could not be found.non-zero return code
10.39.47.60 | FAILED | rc=4 >>
Unit firewalld.service could not be found.non-zero return code
如果没有关闭就关闭
systemctl stop firewalld
更新源
ansible -i hosts cache -u root -m shell -a 'yum update -y '
开始安装
下载Couchbase
[root@couchbase-60 ~]# wget https://packages.couchbase.com/releases/4.6.2/couchbase-server-enterprise-4.6.2-centos7.x86_64.rpm
安装包依赖检查
#安装pkgconfig
ansible -i hosts cache -u root -m shell -a 'yum -y install pkgconfig '
#查看OpenSSL是否安装
ansible -i hosts cache -u root -m shell -a 'rpm -qa | grep "openssl"'
#如果没有安装,用下面命令安装
[root@apollo ~]# ansible -i hosts cache -u root -m shell -a 'yum -y install openssl'
使用rpm包安装couchbase
[root@couchbase-60 ~]# rpm -ivh couchbase-server-enterprise-4.6.2-centos7.x86_64.rpm.2
Preparing... ################################# [100%]
Warning: Transparent hugepages looks to be active and should not be.
Please look at http://bit.ly/1ZAcLjD as for how to PERMANENTLY alter this setting.
Warning: Swappiness is not set to 0.
Please look at http://bit.ly/1k2CtNn as for how to PERMANENTLY alter this setting.
Minimum RAM required : 4 GB
System RAM configured : 3.70 GB
Minimum number of processors required : 4 cores
Number of processors on the system : 2 cores
Updating / installing...
1:couchbase-server-4.6.2-3905 ################################# [100%]
Created symlink from /etc/systemd/system/multi-user.target.wants/couchbase-server.service to /usr/lib/systemd/system/couchbase-server.service.
You have successfully installed Couchbase Server.
Please browse to http://couchbase-60:8091/ to configure your server.
Please refer to http://couchbase.com for additional resources.
Please note that you have to update your firewall configuration to
allow connections to the following ports:
4369, 8091 to 8094, 9100 to 9105, 9998, 9999, 11209 to 11211,
11214, 11215, 18091 to 18093, and from 21100 to 21299.
By using this software you agree to the End User License Agreement.
See /opt/couchbase/LICENSE.txt.
安装完成之后,直接在浏览器访问http://10.39.47.60:8091/ui/index.html
至此,单机版的couchbase安装成功,后文将持续讲解couchbase的集群与使用。
接下来部署集群
根据couchbase的安装经验,couchbase集群必须初始化。你可以通过以下方法来初始化couchbase集群:
- Couchbase的web控制台 (Couchbase Web Console)
- Couchbase的命令行 (Couchbase Command Line Interface)
- Couchbase的富API接口(Couchbase REST API)
通过界面操作之后,最后启动couchbase集群成功的标志如下:
接下来添加其他机器
下载couchbase软件包
ansible -i hosts cache -u root -m shell -a 'wget https://packages.couchbase.com/releases/4.6.2/couchbase-server-enterprise-4.6.2-centos7.x86_64.rpm'
添加63节点
如果遇到问题
如下
直接点击右上角的rebalance按钮就可以解决
最终如下
参考:
官网
centos6.8 内存数据库Couchbase集群部署详细操作
CentOS7.0配置couchbase集群