Rate This Document
Findability
Accuracy
Completeness
Readability

Configuring the Environment

This section uses three servers and three clients as an example.

  1. Set the host name on each node.
    1
    2
    3
    4
    5
    6
    hostnamectl set-hostname ceph1
    hostnamectl set-hostname ceph2
    hostnamectl set-hostname ceph3
    hostnamectl set-hostname client1
    hostnamectl set-hostname client2
    hostnamectl set-hostname client3
    
  2. Configure machine name resolution on ceph1 to ceph3.
    1. Open the following file.
      1
      vim /etc/hosts
      
    2. Press i to enter the insert mode and add the following content to the file:
      1
      2
      3
      4
      5
      6
      192.168.3.166 ceph1
      192.168.3.167 ceph2
      192.168.3.168 ceph3
      192.168.3.160 client1
      192.168.3.161 client2
      192.168.3.162 client3
      
      • The example IP addresses are those planned in Environment Networking. Replace them with the actual ones. You can run the ip a command to query the actual IP addresses.
      • In this document, the cluster consists of three server nodes and three client nodes. Modify the commands based on the actual number of nodes.
    3. Press Esc to exit the insert mode. Type :wq! and press Enter to save and exit the file.
  3. Run the following commands on ceph1, ceph2, and ceph3 respectively to configure password-free login:
    1
    2
    ssh-keygen -t rsa 
    for i in {1..3};do ssh-copy-id ceph$i;done
    
  4. Disable the firewall.
    1
    2
    3
    systemctl stop firewalld
    systemctl disable firewalld
    systemctl status firewalld
    
  5. Disable SELinux.
    1
    2
    setenforce 0
    sed -i 's/=permissive/=disabled/g' /etc/selinux/config
    
  6. Configure clock synchronization on ceph1, ceph2, and ceph3.
    1. Install the chrony service.
      1
      dnf install -y chrony
      
    2. Back up the configuration file.
      1
      mv /etc/chrony.conf /etc/chrony.conf.bak
      
    3. Modify the configuration file.
      1
      2
      3
      4
      5
      cat > /etc/chrony.conf <<EOF
      server [IP1] iburst
      allow [IP/MASK]
      local stratum 10
      EOF
      
      • [IP1] indicates the IP address or domain name of the server that provides the clock service on the network, for example, 192.168.3.166.
      • [IP/MASK] indicates the IP address range of the local network, for example, 192.168.1.0/24. Only devices within this subnet can synchronize the clock with the server.
    4. Restart chrony.
      1
      2
      systemctl restart chronyd
      systemctl enable chronyd
      
    5. Check the time synchronization status.
      1
      2
      3
      chronyc -a makestep  # Forcibly synchronize the system time.
      chronyc sourcestats   # Display the synchronization statistics of the current time source.
      chronyc sources -v    # Display detailed information about the current time source.