鲲鹏社区首页
中文
注册
开发者
我要评分
文档获取效率
文档正确性
内容完整性
文档易理解
在线提单
论坛求助

环境准备

编译部署3FS之前,需要进行关闭防火墙和设置SELinux、修改hostname与设置Hosts及集群时间同步设置。

关闭防火墙与设置SELinux模式

在所有节点进行该操作。

  1. 关闭防火墙。
    systemctl stop firewalld 
    systemctl disable firewalld 
    systemctl status firewalld 

  2. 设置SELinux为permissive模式。
    1. 打开“/etc/selinux/config”文件。
      vi /etc/selinux/config  
    2. “i”进入编辑模式,在文件中修改如下内容。
      SELINUX=permissive
    3. “Esc”键退出编辑模式,输入:wq!,按“Enter”键保存退出文件
      图1 设置SELinux为permissive模式
    4. 重启服务器,使配置生效。

修改hostname与设置hosts

在所有节点进行该操作。

  1. 根据集群环境规划,按照名称对每个节点进行对应的设置,例如将Meta节点名称修改为如下所示。
    hostnamectl --static set-hostname meta
  2. 将Meta对应的IP地址填入每个节点的“/etc/hosts”
    1. 打开“/etc/hosts”文件。
      vi /etc/hosts
    2. “i”进入编辑模式,在文件中填入以下信息。
      192.168.65.10 meta
    3. “Esc”键退出编辑模式,输入:wq!,按“Enter”键保存退出文件

集群时间同步

在所有节点进行该操作。

  1. 安装NTP与ntpdate工具。
    yum install -y ntp ntpdate 
  2. 在所有节点备份旧配置。
    cd /etc && mv ntp.conf ntp.conf.bak 
  3. 在Meta节点编辑NTP配置文件。
    1. 打开NTP配置文件。
      vi /etc/ntp.conf
    2. “i”进入编辑模式,参考如下信息编辑配置文件。
      restrict 127.0.0.1 
      restrict ::1 
      restrict 192.168.65.10 mask 255.255.255.0 
      server 127.127.1.0 
      fudge 127.127.1.0 stratum 8 
      # Hosts on local network are less restricted.
      restrict 192.168.65.10 mask 255.255.255.0 nomodify notrap  
    3. “Esc”键退出编辑模式,输入:wq!,按“Enter”键保存退出文件
  4. 在Meta节点开启NTPD服务。
    systemctl start ntpd 
    systemctl enable ntpd 
    systemctl status ntpd 

  5. 在除Meta外的节点编辑NTP配置文件。
    1. 打开NTP配置文件。
      vi /etc/ntp.conf
    2. “i”进入编辑模式,在配置文件中添加Meta节点IP地址。
      server 192.168.65.10 
    3. “Esc”键退出编辑模式,输入:wq!,按“Enter”键保存退出文件。
    4. 在除Meta的所有节点强制同步server时间。
      ntpdate meta 

      这里需要等待5min,否则会报错(no server suitable for synchronization found)。

    5. 在除Meta外的所有节点写入硬件时钟,避免重启后失效。
      hwclock -w 
    6. 安装并启动crontab工具。
      yum install -y crontabs 
      chkconfig crond on 
      systemctl start crond 
      crontab -e 
    7. 每隔10分钟与Meta节点同步一次时间。
      */10 * * * * /usr/sbin/ntpdate 192.168.65.10