1、防火墙设置。
集群化软件之间需要通过端口互相通讯,为了避免出现网络不通的问题,我们可以简单的在集群内部关闭防火墙。每台机器都要执行。
systemctl stop firewalld
systemctl disable firewalld
2、SELinux修改。
Linux有一个安全模块:SELinux,用以限制用户和程序的相关权限,来确保系统的安全稳定。
在当前,我们只需要关闭SELinux功能,避免导致后面的软件运行出现问题即可。
每台机器都要执行。
vim /etc/sysconfig/selinux
将“SELINUX=enforcing”改为“SELINUX=disabled”,保存退出,单词别写错,不然可能无法重启系统。
# 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 values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
3、时间同步。
3.1 安装ntp软件;
yum install -y ntp
3.2 删除原时间信息;
rm -f /etc/localtime
3.3 配置为上海时区;
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
3.4 同步时间
ntpdate -u ntp.aliyun.com
3.5 开启ntp服务并设置开机自启
systemctl start ntpd
systemctl enable ntpd