Rate This Document
Findability
Accuracy
Completeness
Readability

Configuring a Local Repository and Image

To start the Ceph cluster, the image needs to be dynamically pulled from the remote repository. To facilitate the normal startup of the cluster on the LAN, you need to configure a local image repository and import the created deployment image. Perform operations in this section on the physical machine of the ceph1 node.

  1. Pull registry:2 to the local repository.
    1
    podman pull docker.io/library/registry:2
    
    • If you cannot access the Internet, run the following commands or manually download the package and import it to the current node.
      1
      2
      3
      git config --global http.sslVerify false
      git config --global https.sslVerify false
      git clone https://github.com/NotGlop/docker-drag.git
      
    • Start the local repository.
      1
      podman load -i registry_2.tar
      
    • If the image cannot be pulled when a proxy is used to access the Internet, check the proxy setting. Podman depends on the environment variables HTTP_PROXY and HTTPS_PROXY for Internet access.
  2. Modify the container configuration file /etc/containers/registries.conf.
    1
    2
    3
    4
    5
    unqualified-search-registries = ["[IP]:5000", "quay.io"]
    short-name-mode="enforcing"
    [[registry]]
    location = "[IP]:5000"
    insecure = true
    

    Replace [IP] with the actual public network IP address of the current node.

  3. Modify the local repository settings.
    1
    2
    mkdir -p /home/registry-data
    podman run -d -p 5000:5000 -v /home/registry-data:/var/lib/registry --restart always --name registry docker.io/library/registry:2
    

    docker.io/library/registry is the image name used by the image repository configured in 1. You can run podman images to query.

  4. Import the Ceph deployment image generated in Creating a Deployment Image.
    1
    podman load -i ceph_release.tar
    
  5. Rename the image and upload it to the local repository.
    1
    2
    3
    podman tag 8bbba7d5cc80 [IP]:5000/ceph/ceph_release:v17.2.7
    podman push [IP]:5000/ceph/ceph_release:v17.2.7 [IP]:5000/ceph/ceph_release:v17.2.7
    podman rmi 8bbba7d5cc80
    
    • 8bbba7d5cc80 indicates the image ID corresponding to ceph_release.tar, and [IP] indicates the local IP address. Replace them with the actual values.
    • If the "Gateway Time-out" error is reported during the push, check whether any proxy is configured. If yes, run the following commands to disable proxy configurations:
      1
      2
      unset http_proxy
      unset https_proxy
      
    • After the image is pushed to the local repository, its tag may conflict with that of a package in the local repository. Therefore, you need to delete the local Ceph image.
  6. Modify DEFAULT_IMAGE in the cephadm file.
    1. Open the /usr/sbin/cephadm file.
      1
      vim /usr/sbin/cephadm
      
    2. Press i to enter the insert mode and modify DEFAULT_IMAGE as follows:
      DEFAULT_IMAGE = "[IP]:5000/ceph/ceph_release:v17.2.7"

      Replace [IP] with the IP address of the current image repository.

    3. Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
  7. Modify the container creation permission in cephadm.
    1
    Change if self.privileged to if self.privileged or not self.privileged
    
    • The /usr/sbin/cephadm file must have the SPDK patch applied in its source code.
    • The line to be modified is in the run_cmd function.
    • If you have performed 2, skip this step.
  8. Copy the ceph-17.2.7/src/cephadm/cephadm file applied with the SPDK patch from the compilation container on the compilation node to the /usr/sbin/ directory on physical machines of ceph1, ceph2, ceph3, client1, client2, and client3.