我要评分
获取效率
正确性
完整性
易理解

Preparing the Environment

Before compiling and deploying 3FS, you need to disable the firewall and configure SELinux, host names, hosts files, and cluster time synchronization.

Disabling the Firewall and Configuring SELinux

Perform this operation on all nodes.

  1. Disable the firewall.
    systemctl stop firewalld 
    systemctl disable firewalld 
    systemctl status firewalld 

  2. Set SELinux to the permissive mode.
    1. Open the /etc/selinux/config file.
      vi /etc/selinux/config  
    2. Press i to enter the insert mode and modify the configuration as follows.
      SELINUX=permissive
    3. Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
      Figure 1 Setting the permissive mode
    4. Restart the server for the configuration to take effect.

Configuring Host Names and the hosts File

Perform this operation on all nodes.

  1. Set the name of each node according to Cluster Environment Planning. For example, set the name of the Meta node as follows:
    hostnamectl --static set-hostname meta
  2. Enter the IP address of the Meta node in the /etc/hosts file of each node.
    1. Open the /etc/hosts file.
      vi /etc/hosts
    2. Press i to enter the insert mode and add the following content to the file:
      192.168.65.10 meta
    3. Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.

Synchronizing the Cluster Time

Perform this operation on all nodes.

  1. Install the NTP and ntpdate tools.
    yum install -y ntp ntpdate 
  2. Back up the original configuration on each node.
    cd /etc && mv ntp.conf ntp.conf.bak 
  3. Edit the NTP configuration file on the Meta node.
    1. Open the NTP configuration file.
      vi /etc/ntp.conf
    2. Press i to enter the insert mode and edit the configuration file according to the following content:
      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. Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
  4. Enable the NTPD service on the Meta node.
    systemctl start ntpd 
    systemctl enable ntpd 
    systemctl status ntpd 

  5. Edit the NTP configuration file on nodes other than Meta.
    1. Open the NTP configuration file.
      vi /etc/ntp.conf
    2. Press i to enter the insert mode and add the IP address of the Meta node to the file.
      server 192.168.65.10 
    3. Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
    4. Forcibly synchronize the time of Meta to all the other nodes.
      ntpdate meta 

      Wait for 5 minutes. Otherwise, an error message "no server suitable for synchronization found" is displayed.

    5. Write the hardware clock to all the nodes except Meta to prevent configuration failures after the restart.
      hwclock -w 
    6. Install and start the crontab tool.
      yum install -y crontabs 
      chkconfig crond on 
      systemctl start crond 
      crontab -e 
    7. Synchronize time with the Meta node every 10 minutes.
      */10 * * * * /usr/sbin/ntpdate 192.168.65.10