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集羣