Ceph安装

# 拉取镜像
docker pull ceph/daemon:v3.2.12-stable-3.2-luminous-centos-7

# 创建配置 数据 日志目录
mkdir -p  /etc/ceph/  /var/lib/ceph/  /var/log/ceph/  
chmod 777 -R /var/log/ceph/

# 部署mon
docker run -d --net=host --name=mon -v /var/log/ceph:/var/log/ceph -v /etc/ceph:/etc/ceph -v /var/lib/ceph/:/var/lib/ceph  -v /etc/localtime:/etc/localtime -e MON_IP=172.24.35.68 -e CEPH_PUBLIC_NETWORK=172.24.0.0/16 ceph/daemon:v3.2.12-stable-3.2-luminous-centos-7 mon

# 部署osd
docker run -d --net=host --name=osd --privileged=true -v /etc/ceph:/etc/ceph -v /etc/localtime:/etc/localtime  -v /var/lib/ceph:/var/lib/ceph -v /dev/:/dev/ -v /app:/var/lib/ceph/osd ceph/daemon:v3.2.12-stable-3.2-luminous-centos-7 osd_directory

# 部署rgw
docker run -d --net=host --name=rgw -v /etc/ceph:/etc/ceph -v /etc/localtime:/etc/localtime  -v /var/lib/ceph/:/var/lib/ceph  ceph/daemon:v3.2.12-stable-3.2-luminous-centos-7 rgw 

# 部署mgr
docker run -d --net=host --name=mgr -v /etc/localtime:/etc/localtime -v /etc/ceph:/etc/ceph -v /var/lib/ceph/:/var/lib/ceph ceph/daemon:v3.2.12-stable-3.2-luminous-centos-7 mgr

# 查看集群状态
docker exec mon ceph -s

# 创建用户,指定ak、sk
docker exec mon radosgw-admin user create --uid="rgwuser" --display-name="This is first rgw test user" --access_key=DDEIW4ASTJ5UDY2D4UFI --secret=DJFeHXvqYgsNK5ZDqy5nf5UwpMZSZWFnqPOdiYvV

# 其余节点
拷贝/etc/ceph
拷贝/var/lib/ceph/bootstrap*

# 安装s3cmd
yum install -y epel-release
yum install -y s3cmd
# 配置s3cmd
cd
cat <<"EOF" >.s3cfg
[default]
access_key= xxx
secret_key= xxxxxxx
host_base = 172.24.35.68:8080
host_bucket = 172.24.35.68:8080
use_https = False
signature_v2=True
EOF

# 测试
s3cmd ls

你可能感兴趣的:(Ceph安装)