• 【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,等下次机器重启后,配置文件自动生效
    

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

  • 相关阅读:
    iOS 之 内存管理
    php的异步并行扩展swoole
    如何用php实现qq登陆网站
    php分页类
    php的分页代码
    一个小的投票系统
    php如何判断两个时间戳是一天
    PHP中出现Notice: Undefined index的三种解决办法
    vmvare如何安装xp虚拟机
    windows2003安装
  • 原文地址:https://www.cnblogs.com/zll-0405/p/10786615.html
Copyright © 2020-2023  润新知