【Linux】时间同步设置+防火墙设置+SELinux设置

时间同步设置

在大数据集群环境中,要求每台集群的时间必须是同步的,这样我们就会要求每台集群的时间必须和一台服务的时间是同步的。接下来介绍一下步骤:
1,设置ntp客户端

yum -y install ntp 安装ntp时间同步软件
systemctl enable ntpd 使软件可用
systemctl start ntpd 启动ntp软件

2,编辑/etc/ntp.conf文件

vi /etc/ntp.conf

重点修改以下内容

# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
#server 0.centos.pool.ntp.org iburst
 
server 192.168.243.133   ------->(此处需要修改,以哪台为准就写那台的IP)
 
restrict 192.168.243.133 nomodify notrap noquery------->(此处需要修改,以哪台为准就写那台的IP)
 
server 192.168.243.***     ------->(本机IP是多少就写多少)
fudge 192.168.243.*** ------->(本机IP是多少就写多少) stratum 10

3,重启ntpd服务:

systemctl restart ntpd

4,启动后,查看同步情况:

 ntpq -p
 ntpstat 
防火墙设置

关闭firewall:

临时关闭防火墙: systemctl stop firewalld 
永久关闭防火墙: systemctl disable firewalld.service

关闭iptables:

关闭命令: service iptables stop 
永久关闭防火墙:chkconfig iptables off 
检查防火墙状态:service iptables status 

查看防火墙状态:

检查firewall的状态:systemctl status firewalld.service
检查iptables状态:service iptables status 
SELinux设置

1,临时关闭SELinux:

setenforce 0

2,永久关闭SELinux:

vi /etc/selinux/config
将配置文件中SELINUX=enforcing改为SELINUX=disabled
注:修改配置文件需要重启机器,但我们已临时关闭SELinux,等下次机器重启后,配置文件自动生效

修改前:
这里写图片描述
修改后:
这里写图片描述

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 14
    评论
评论 14
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值