您好,登錄后才能下訂單哦!
couchbase是一個較新的、發展迅速的nosql數據庫技術。2014年,viber宣布使用couchbase替換mongodb,以適應10億級的用戶量,目前,couchbase已大量運用于生產環境,國內使用的公司主要有新浪,騰訊等。由于中文資料較少,閱讀了官方文檔中的部分介紹后,將資料翻譯和匯總如下。
couchbase是CouchDB和MemBase的合并。而memBase是基于Memcached的。因此couchbase聯合了couchbase的簡單可靠和memcached的高性能,以及membase的可擴展性。
couchbase可用于單機環境,也可以和其他服務器一起提供分布式的數據存儲。
一、安裝couchbase(node1、node2、node3)
1、關閉防火墻和selinux
[root@localhost ~]# systemctl stop firewalld [root@localhost ~]# systemctl disable firewalld Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service. Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service. [root@localhost ~]# vi /etc/sysconfig/selinux # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=disabled # SELINUXTYPE= can take one of three two values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted [root@localhost ~]# setenforce 0
2、下載couchbase
[root@localhost ~]# wget https://packages.couchbase.com/releases/4.6.2/couchbase-server-enterprise-4.6.2-centos7.x86_64.rpm
couchbase官網地址:https://×××w.couchbase.com/downloads
3、確認依賴包是否安裝,如果沒安裝yum安裝下。
[root@localhost ~]# rpm -qa | grep "pkgconfig" pkgconfig-0.27.1-4.el7.x86_64 [root@localhost ~]# rpm -qa | grep "openssl" openssl-libs-1.0.1e-42.el7.9.x86_64 openssl-1.0.1e-42.el7.9.x86_64
4、安裝couchbase
[root@localhost ~]# rpm -ivh couchbase-server-enterprise-4.6.2-centos7.x86_64.rpm 準備中... ################################# [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 : 0.95 GB Minimum number of processors required : 4 cores Number of processors on the system : 1 cores 正在升級/安裝... 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://localhost.localdomain: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.
5、服務狀態與開機自啟
[root@test1 ~]# systemctl status couchbase-server [root@test1 ~]# systemctl enable couchbase-server
二、couchbase集群配置(node1)
集群初始化有以下方式,這里我們以web控制臺方式為例:
* Couchbase的web控制臺 (Couchbase Web Console)
* Couchbase的命令行 (Couchbase Command Line Interface)
* Couchbase的API接口(Couchbase REST API)
1、瀏覽器輸入http://192.168.146.126:8091/訪問
2、選擇“Strat a new cluster”選項,這里主要是設置RAM Quota、Database path和Indexes path
在配置服務器界面,你有如下選項:
* 創建新的集群(Start a new cluster)
* 加入已有集群(Join a cluster now)
* 配置存儲(Configure Disk Storage)
* 配置服務器的主機名(Configure Server Hostname)
3、按照默認設置
4、缺省的bucket不建議分配過大,勾選Flush下的Enable復選框
5、勾選同意
6、設置后臺管理Administrator密碼
7、登陸后首頁
8、創建新的Bucket,RAM建議默認,默認會將除了default的所有內存分配給這個Bucket。勾選Flush下的Enable復選框
9、點擊剛才創建的bucket進行刷新,如下圖
10、新增集群節點,并同步
11、按照上一步的方法添加第三臺,效果如下:
其它鏈接:
http://rdc.hundsun.com/portal/article/736.html
http://rdc.hundsun.com/portal/article/761.html
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。