Configuring Network Settings
Configuring Selinux
You’ll have to set Selinux mode to “disabled” by configuring the selinux file located in /etc/sysconfig directory.
Open the file and make changes:-
sudo vi /etc/sysconfig/selinuxUpdate the following line:-
SELINUX=disabledSave the file and exit.
Reboot the machine.
sudo rebootDisabling the Firewall
To disable the firewall on each host in your cluster, perform the following steps on each host.
For iptables, save the existing rule set:
sudo iptables-save > ~/firewall.rulesDisable the firewall:
RHEL 7 compatible:
sudo systemctl disable firewalld
sudo systemctl stop firewalldSet Static Hostname and edit Network Configuration
sudo hostnamectl set-hostname datacouch.training.io --staticNow verify…
hostname -fCreate and edit a file /usr/sbin/hosts.sh and set it executable
sudo touch /usr/sbin/hosts.sh
sudo chmod 755 /usr/sbin/hosts.sh
sudo vi /usr/sbin/hosts.shPaste the below script in hosts.sh
#!/bin/sh
#
# Script to determine the FQDN of a node in GCP and update hosts file
#
sudo hostnamectl set-hostname datacouch.training.io --static
myhost=`hostname -f`
ipaddr=`ifconfig eth0 | grep "inet " | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b" | head -1`
echo '127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4' > /etc/hosts.latest
echo $ipaddr ' ' $myhost >> /etc/hosts.latest
mv /etc/hosts /etc/hosts.old
mv /etc/hosts.latest /etc/hostsEdit rc.local to run the hosts.sh script at boot for CentOS 7+, rc.local is not set as executable by default!
sudo chmod +x /etc/rc.d/rc.local
sudo systemctl enable rc-local
sudo systemctl start rc-localAdd below command inside /etc/rc.d/rc.local
sudo sh /usr/sbin/hosts.shLast updated