Skip to content

Instantly share code, notes, and snippets.

@Gaafar
Last active September 10, 2019 11:15
Show Gist options
  • Save Gaafar/c335546e2719cfc6888270727d2a1a2a to your computer and use it in GitHub Desktop.
Save Gaafar/c335546e2719cfc6888270727d2a1a2a to your computer and use it in GitHub Desktop.
couchbase labs
############
# setup ssh key
chmod 400 Amazon-Private-Key2.pem
ssh -i Amazon-Private-Key2.pem ec2-user@xxxx
# change hostname
sudo -i
hostname
hostnamectl set-hostname Couchbase01
exit
logout
# ssh again
hostname
# check memory & disk
free -mh
sudo fdisk -l
# set swappiness
sudo -i
cat /proc/sys/vm/swappiness
echo 0 > /proc/sys/vm/swappiness
echo '' >> /etc/sysctl.conf
echo '#Set swappiness to 0 to avoid swapping' >> /etc/sysctl.conf
echo 'vm.swappiness = 0' >> /etc/sysctl.conf
# disable firewall
systemctl status firewalld
systemctl stop firewalld
# disable THP
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/defrag
# install CB
yum install wget -y
exit
wget http://packages.couchbase.com/releases/6.0.0/couchbase-server-enterprise-6.0.0-centos7.x86_64.rpm
sudo rpm --install couchbase-server-enterprise-6.0.0-centos7.x86_64.rpm
systemctl status couchbase-server
# cluster & bucket info
couchbase-cli server-list --cluster=ec2-35-171-167-152.compute-1.amazonaws.com:8091 --user=Administrator --password=couchbase
couchbase-cli server-info --cluster=ec2-35-171-167-152.compute-1.amazonaws.com:8091 --user=Administrator --password=couchbase
sudo ls -alh /opt/couchbase/var/lib/couchbase/index
sudo ls -alh /opt/couchbase/var/lib/couchbase/index/@indexes
sudo ls -alh /opt/couchbase/var/lib/couchbase/index/@indexes/beer-sample
sudo ls -alh /opt/couchbase/var/lib/couchbase/data
sudo ls -al /opt/couchbase/var/lib/couchbase/data/beer-sample
sudo ls -al /opt/couchbase/var/lib/couchbase/data/beer-sample | wc -l
sudo /opt/couchbase/bin/couch_dbdump /opt/couchbase/var/lib/couchbase/data/beer-sample/0.couch.1 | head -20
sudo /opt/couchbase/bin/couch_dbinfo /opt/couchbase/var/lib/couchbase/data/beer-sample/0.couch.1
# shut down CB server
sudo systemctl stop couchbase-server
sudo -s
cd /opt/couchbase/var/lib/couchbase/logs
ls -alh
tail -21 info.log
exit
# start CB again
sudo systemctl start couchbase-server
sudo systemctl status couchbase-server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment