Hi All
anyone help me installing Couchbase cluster via Ansible In Rhel8 please help me in this
if there any github link is there reference for RHEL8 for Couchbase via Ansible Please share the Link
Thanks
Nagasai
Hi All
anyone help me installing Couchbase cluster via Ansible In Rhel8 please help me in this
if there any github link is there reference for RHEL8 for Couchbase via Ansible Please share the Link
Thanks
Nagasai
Welcome to Couchbase forums @nagasai!
We use ansible to install couchbase on centos boxes for some of our testing but not for rhel8. But the install steps for both are not that different. Here is a snippet from our script that you can try out in your setup:
- hosts: centos
vars:
rpm_path: "/tmp/couchbase.rpm" (change this to your rpm location)
remote_user: <your username here>
tasks:
- name: set vm.swappiness to 0
shell: "echo 0 > /proc/sys/vm/swappiness"
- name: disable thp
shell: "echo never > /sys/kernel/mm/transparent_hugepage/enabled"
- name: remove core conf file if any
shell: "rm -f /etc/security/limits.d/core.conf"
ignore_errors: True
- name: create core conf file
shell: "touch /etc/security/limits.d/core.conf"
- name: append hard core limit
shell: "echo 'couchbase hard core unlimited' >> /etc/security/limits.d/core.conf"
- name: append soft core limit
shell: "echo 'couchbase soft core unlimited' >> /etc/security/limits.d/core.conf"
- name: set default limit core to infinity step 1
shell: "echo '[Manager]' > /etc/systemd/system.conf"
- name: set default limit core to infinity step 2
shell: "echo 'DefaultLimitCORE=infinity' >> /etc/systemd/system.conf"
- name: reload systemctl daemon
shell: "systemctl daemon-reexec"
- name: disable thp defrag
shell: "echo never > /sys/kernel/mm/transparent_hugepage/defrag"
- name: cleanup old pkg dirs
shell: "rm {{rpm_path}} 2>/dev/null"
ignore_errors: True
- pam_limits: domain=root limit_type='-' limit_item=core value=unlimited
- name: rm locks
shell: "rm -f /var/lib/rpm/.rpm.lock"
ignore_errors: True
- name: stop rpm
shell: "killall -9 rpm"
ignore_errors: True
- name: stop couchbase
shell: "ps aux | grep 'couchbase' | awk '{print $2}' | xargs kill -s 9"
ignore_errors: True
- name: stop memcached
shell: "ps aux | grep 'memcached' | awk '{print $2}' | xargs kill -s 9"
ignore_errors: True
- name: stop epmd
shell: "ps aux | grep 'epmd' | awk '{print $2}' | xargs kill -s 9"
ignore_errors: True
- name: uninstall couchbase
yum: name=couchbase-server state=absent
- name: rm opt dir
shell: "rm -rf /opt/couchbase"
- name: install couchbase
yum: name="{{rpm_path}}"
- name: alt start
shell: /opt/couchbase/etc/couchbase_init.d start
ignore_errors: True
- name: flush iptables
shell: iptables -F
- name: wait for install done
wait_for: port=8091 delay=10
Hosts file should like this:
[centos]
<hostname of machine>
[all:vars]
ansible_connection=ssh
ansible_ssh_user=<your username>
ansible_ssh_pass=<your password>