Skip to content

Instantly share code, notes, and snippets.

@rayhassan
Last active October 23, 2017 13:29
Show Gist options
  • Save rayhassan/619057969435d8b2a12f834ea2cbae4e to your computer and use it in GitHub Desktop.
Save rayhassan/619057969435d8b2a12f834ea2cbae4e to your computer and use it in GitHub Desktop.
Couchbase prod install notes
]# rpm -ivh couchbase-server-enterprise-3.1.0-centos6.x86_64.rpm
Preparing... ################################# [100%]
Warning: Transparent hugepages looks to be active and should not be.
Please look at http://bit.ly/1hTySfg as for how to PERMANENTLY alter this setting.
Warning: Swappiness is not set to 0.
Please look at http://bit.ly/1hTySfg as for how to PERMANENTLY alter this setting.
Minimum RAM required : 4 GB
System RAM configured : 15.52 GB
Minimum number of processors required : 4 cores
Number of processors on the system : 4 cores
Updating / installing...
1:couchbase-server-3.1.0-1776 ################################# [100%]
Starting couchbase-server (via systemctl): [ OK ]
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: 11211, 11210, 11209, 4369,
8091, 8092, 18091, 18092, 11214, 11215 and from 21100 to 21299.
By using this software you agree to the End User License Agreement.
See /opt/couchbase/LICENSE.txt.
sudo firewall-cmd --permanent --add-port=11211/tcp
sudo firewall-cmd --permanent --add-port=11210/tcp
sudo firewall-cmd --permanent --add-port=11209/tcp
sudo firewall-cmd --permanent --add-port=4369/tcp
sudo firewall-cmd --permanent --add-port=8091/tcp
sudo firewall-cmd --permanent --add-port=8092/tcp
sudo firewall-cmd --permanent --add-port=18092/tcp
sudo firewall-cmd --permanent --add-port=11214/tcp
sudo firewall-cmd --permanent --add-port=11215/tcp
sudo firewall-cmd --permanent --add-port=21100-21299/tcp
sudo firewall-cmd --reload
# firewall-cmd --zone=public --list-all
public (default, active)
interfaces: eth0
sources:
services: dhcpv6-client ssh
ports: 443/tcp 80/tcp 18092/tcp 4369/tcp 11210/tcp 11211/tcp 11214/tcp 8092/tcp 11209/tcp 11215/tcp 21100-21299/tcp 8091/tcp
masquerade: no
forward-ports:
icmp-blocks:
rich rules:
[root@localhost ~]# lsscsi
[0:0:0:0] cd/dvd QEMU QEMU DVD-ROM 1.5. /dev/sr0
[2:0:0:0] disk NUTANIX VDISK 0 /dev/sda
[2:0:1:0] disk NUTANIX VDISK 0 /dev/sdb
[2:0:2:0] disk NUTANIX VDISK 0 /dev/sdc
[2:0:3:0] disk NUTANIX VDISK 0 /dev/sdd
[2:0:4:0] disk NUTANIX VDISK 0 /dev/sde
[2:0:5:0] disk NUTANIX VDISK 0 /dev/sdf
[2:0:6:0] disk NUTANIX VDISK 0 /dev/sdg
]# lsscsi | awk '{print $6}' | grep /dev/sd | grep -v sda | xargs pvcreate -y
Wiping dos signature on /dev/sdb.
Physical volume "/dev/sdb" successfully created
Wiping dos signature on /dev/sdc.
Physical volume "/dev/sdc" successfully created
Wiping dos signature on /dev/sdd.
Physical volume "/dev/sdd" successfully created
Wiping dos signature on /dev/sde.
Physical volume "/dev/sde" successfully created
Wiping dos signature on /dev/sdf.
Physical volume "/dev/sdf" successfully created
Wiping dos signature on /dev/sdg.
Physical volume "/dev/sdg" successfully created
[root@localhost ~]# vgcreate couchdata /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf /dev/sdg
Volume group "couchdata" successfully created
[root@localhost ~]# lvcreate -i 6 -l 100%VG -n couchdata couchdata
Using default stripesize 64.00 KiB.
Logical volume "couchdata" created.
]# mkfs.xfs /dev/mapper/couchdata-couchdata
meta-data=/dev/mapper/couchdata-couchdata isize=256 agcount=32, agsize=9830192 blks
= sectsz=512 attr=2, projid32bit=1
= crc=0 finobt=0
data = bsize=4096 blocks=314566144, imaxpct=5
= sunit=16 swidth=96 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=0
log =internal log bsize=4096 blocks=153600, version=2
= sectsz=512 sunit=16 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
pvcreate /dev/sdh /dev/sdi /dev/sdj
]# vgcreate couchidx /dev/sdh /dev/sdi /dev/sdj
Volume group "couchidx" successfully created
]# lvcreate -i 3 -l 100%VG -n couchidx couchidx
Using default stripesize 64.00 KiB.
Logical volume "couchidx" created.
sudo apt-get install xfsprogs
]# mkfs.xfs /dev/mapper/couchidx-couchidx
meta-data=/dev/mapper/couchidx-couchidx isize=256 agcount=32, agsize=4915088 blks
= sectsz=512 attr=2, projid32bit=1
= crc=0 finobt=0
data = bsize=4096 blocks=157282816, imaxpct=25
= sunit=16 swidth=48 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=0
log =internal log bsize=4096 blocks=76800, version=2
= sectsz=512 sunit=16 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
mkdir -p /couchdb30/index
<should already be there from rpm install>
# useradd couchbase
# groupadd couchbase
# chown -R couchbase:couchdbase /couchdb30
# CouchDB 3.0 mount points
/dev/mapper/couchdata-couchdata /couchdb30/data xfs defaults 0 0
/dev/mapper/couchidx-couchidx /couchdb30/index xfs defaults 0 0
#disable THP at boot time
if test -f /sys/kernel/mm/redhat_transparent_hugepage/enabled; then
echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled
fi
if test -f /sys/kernel/mm/redhat_transparent_hugepage/defrag; then
echo never > /sys/kernel/mm/redhat_transparent_hugepage/defrag
fi
yum install libhugetlbfs-utils
hugeadm --thp-never
Linux /opt/couchbase/var/lib/couchbase/data
couchbase-cli node-init -c 10.5.2.54:8091 \
--node-init-data-path=new_path \
-u user -p password
Linux /opt/couchbase
curl -X POST -u Administrator:password \
-d 'index_path=/var/tmp/test_indexpath' \
http://127.0.0.1:8091/nodes/self/controller/settings
do export workload=workloade export workloadHost=52.40.153.4 export workloadThreads=21 export workloadThreadGroup=21 export runnumber=1 vagrant ssh $h -c "cd /opt/ycsb*; ./bin/ycsb run couchbase2 -P workloads/${workload} -p couchbase.host=${workloadHost} -threads ${workloadThreads} -p couchbase.epoll=true -p couchbase.boost=16 -p maxexecutiontime=1200 -p operationcount=900000000 -p couchbase.upsert=true
./bin/ycsb run couchbase2 -P workloads/${workload} -p couchbase.host=${workloadHost} -threads ${workloadThreads} -p couchbase.epoll=true -p couchbase.boost=16 -p maxexecutiontime=1200 -p operationcount=900000000 -jvm-args="-Dcom.couchbase.kvTimeout=50000" 2>&1 > ${workload}-${workloadThreadGroup}-${runnumber}.log
for h in 1 2 3 … hostN; do vagrant ssh host${h} -s "curl -v http://localhost:8093/query/service -d 'statement=CREATE PRIMARY INDEX idx${h} ON default'" done
vagrant ssh ycsb1 cd /opt/ycsb-0.10.0-SNAPSHOT export workload=workloade export workloadHost=52.40.153.4 ./bin/ycsb load couchbase2 -s -threads 35 -P workloads/workloade -p couchbase.host=${workloadHost}
/bin/ycsb run couchbase2 -P workloads/${workload} -p couchbase.host=${workloadHost} -threads ${workloadThreads} -p couchbase.epoll=true -p couchbase.boost=16 -p maxexecutiontime=1200 -p operationcount=900000000 -p couchbase.upsert=true
export CB_REST_USERNAME=Administrator; export CB_REST_PASSWORD=nutanix/4u; \
/opt/couchbase/bin/couchbase-cli bucket-list -c 10.68.64:8091
/opt/couchbase/bin/couchbase-cli bucket-create -c 10.68.64.64:8091 \
--bucket=test_bucket \
--bucket-type=couchbase \
--bucket-port=11222 \
--bucket-ramsize=200 \
--bucket-replica=1 \
--bucket-priority=low \
--wait \
-u Administrator -p password
In general, you will have one replica for clusters up to 5 data nodes, one or two replicas in clusters from 5 to 10 data nodes and three replicas only in clusters with 10 or more data nodes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment