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

Configuring the Environment

In this document, three server nodes and three client nodes are planned for the Ceph cluster.

  1. Configure the mirror source on all server nodes.

    Skip this step if the Internet access is available.

    1. Configure the openEuler local source.

      Upload the everything mirror source file of the OS to the server. Specifically, use an SFTP tool to upload openEuler-***-everything-aarch64-dvd.iso to the /root directory of the server.

      1
      2
      mkdir -p /iso
      mount /root/openEuler-***-everything-aarch64-dvd.iso /iso
      
    2. Create a mirror Yum source.
      1
      vi /etc/yum.repos.d/openEuler.repo
      
    3. Add the following content to the file:
      1
      2
      3
      4
      5
      6
      [Base]
      name=Base 
      baseurl=file:///iso 
      enabled=1
      gpgcheck=0
      priority=1
      
  2. Download compat-openssl10-1.0.2o-5.fc30.aarch64.rpm and install it.
    Download address: https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/30/Everything/aarch64/os/Packages/c/
    wget https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/30/Everything/aarch64/os/Packages/c/compat-openssl10-1.0.2o-5.fc30.aarch64.rpm --no-check-certificate
    rpm -ivh compat-openssl10-1.0.2o-5.fc30.aarch64.rpm
  3. Disable the firewall.

    To disable the firewall on the current node, run the following commands on all server and client nodes:

    1
    2
    3
    systemctl stop firewalld
    systemctl disable firewalld
    systemctl status firewalld
    

  4. Configure host names.
    Configure the permanent static host names. Set the names of the server nodes to ceph1 to ceph3 and that of the client nodes to client1 to client3.
    1. Configure node names.
      1. ceph1:
        1
        hostnamectl --static set-hostname ceph1
        
      2. client1:
        1
        hostnamectl --static set-hostname client1 
        

        Configure other nodes in the same way.

    2. Modify the domain name resolution file.
      1
      vi /etc/hosts
      

      Add the following content to the /etc/hosts file on all server and client nodes:

      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 preceding IP addresses are only examples. Replace them as required. You can run the ip a command to query the actual IP address. You are advised to set the host names of the three server nodes to ceph1 to ceph3 and the host names of the three client nodes to client1 to client3. The preceding example uses three servers and three clients. Change the number of nodes based on the site requirements.

  5. Configure Network Time Protocol (NTP).
    Ceph automatically checks the time between storage nodes. If the time difference between different nodes is large, an alarm is generated. Therefore, configure clock synchronization between nodes.
    1. Install the NTP service.
      1. Install NTP on all server and client nodes.
        1
        yum -y install ntp ntpdate
        
      2. Back up the original configurations of all server and client nodes.
        1
        cd /etc && mv ntp.conf ntp.conf.bak
        
      3. Create an NTP file on ceph1, which serves as the NTP server.
        1
        vi /etc/ntp.conf
        
        Add the following content to the NTP file:
        1
        2
        3
        4
        5
        6
        7
        8
        9
        restrict 127.0.0.1 
        restrict ::1 
        restrict 192.168.3.0 mask 255.255.255.0
        server 127.127.1.0 
        fudge 127.127.1.0 
        stratum 8
        restrict default kod nomodify notrap nopeer noquery
        interface ignore wildcard
        interface listen x.x.x.x (IP address of the server)
        

        The line restrict 192.168.3.0 mask 255.255.255.0 indicates the network segment and subnet mask of the ceph1 node.

      4. Create an NTP file on ceph2, ceph3, and all client nodes.
        1
        vi /etc/ntp.conf
        
        Add the following content in which the IP address is the IP address of ceph1:
        1
        server 192.168.3.166 
        
    2. Start the NTP service.
      1. Start the NTP service on ceph1 and check the service status.
        1
        2
        3
        systemctl start ntpd 
        systemctl enable ntpd 
        systemctl status ntpd 
        

      2. Forcibly synchronize the NTP server (ceph1) time to all the other nodes.
        1
        ntpdate ceph1 
        
      3. Write the hardware clock to all nodes except ceph1 to prevent configuration failures after the restart.
        1
        hwclock -w 
        
      4. Install and start the crontab tool on all nodes except ceph1.
        1
        2
        3
        4
        yum install -y crontabs
        systemctl enable crond.service
        systemctl start crond 
        crontab -e 
        
      5. Add the following content so that all the other nodes automatically synchronize time with ceph1 every 10 minutes:
        1
        */10 * * * * /usr/sbin/ntpdate 192.168.3.166
        
  6. Configure password-free login.

    Generate a public key on ceph1 and deliver it to each other server node and client node.

    • For a three-node network of ceph1, ceph2, ceph3, client1, client2, and client3:
      1
      2
      3
      ssh-keygen -t rsa 
      for i in {1..3};do ssh-copy-id ceph$i;done
      for i in {1..3};do ssh-copy-id client$i;done
      
    • For a network of ceph1 and client1:
      1
      2
      3
      ssh-keygen -t rsa
      ssh-copy-id ceph1
      ssh-copy-id client1
      

    After entering the first command ssh-keygen -t rsa, press Enter to use the default configuration.

  7. Set the permissive mode.

    Set the permissive mode on all server and client nodes.

    • Temporarily disable the SELinux function. The setting becomes invalid after the OS is restarted.
      1
      setenforce permissive
      

    • Set the permissive mode permanently. The configuration takes effect upon the next restart.
      1
      vi /etc/selinux/config
      

      Set SELINUX to permissive.