利用docker快速搭建ceph radosgw环境

安装docker

# step 1: 安装必要的一些系统工具
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
# Step 2: 添加软件源信息
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
# Step 3: 更新并安装 Docker-CE
sudo yum makecache fast
sudo yum -y install docker-ce
# Step 4: 开启Docker服务
sudo service docker start

配置阿里云的镜像加速器

sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["56px195b.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker

利用docker启动服务

The environment variables MON_NAME and MON_IP are required:

  • MON_NAME is the name of the monitor (DEFAULT: hostname)
  • MON_IP is the IP address of the monitor (public)
  • RGW_NAME is the name of rados gateway instance (DEFAULT: hostname)
  • RGW_CIVETWEB_PORT is the port of the rados gateway (DEFAULT: 80)
  • CLUSTER is the name of the cluster (DEFAULT: ceph)
  • CEPH_PUBLIC_NETWORK is the network where the OSD should communicate
  • CEPH_DEMO_UIDCEPH_DEMO_ACCESS_KEYCEPH_DEMO_SECRET_KEY, and CEPH_DEMO_BUCKET can be used to auto-provision an account.
docker run -d --name demo -e MON_IP=$IP -e CEPH_PUBLIC_NETWORK=$NETWORK --net=host -v /var/lib/ceph:/var/lib/ceph -v /etc/ceph:/etc/ceph ceph/demo demo

检查状态

# ceph -s
    cluster 6b05686e-7851-4619-8130-32ed5fb4e5fc
     health HEALTH_OK
     monmap e2: 1 mons at {10e131e69e15=172.28.8.15:6789/0}
            election epoch 4, quorum 0 10e131e69e15
      fsmap e5: 1/1/1 up {0=0=up:active}
        mgr active: 10e131e69e15 
     osdmap e13: 1 osds: 1 up, 1 in
            flags sortbitwise,require_jewel_osds,require_kraken_osds
      pgmap v16: 112 pgs, 7 pools, 3829 bytes data, 32 objects
            2398 MB used, 505 GB / 507 GB avail
                  96 active+clean
                  16 creating
原文地址:https://www.cnblogs.com/gushiren/p/9584895.html