Skip to content

VasiliyLiao/ceph-docker-compose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

This docker-compose for deploy ceph version 13.2.1 & Container version v3.1.0-stable-3.1-mimic-centos-7

Setup

more info

Quick Start

  1. configuration .env
cp env-example .env && vim .env
  1. create bridge network
docker network create --driver bridge ceph-cluster-net
  1. up monitor and manager
docker-compose up -d mon1 mgr
  1. chnage max object namespace len
vim ${VOLUMES_PATH}/ceph/ceph.conf
osd pool default min size = 2
max open files = 655350
cephx cluster require signatures = false
cephx service require signatures = false

osd max object name len = 256
osd max object namespace len = 64
  1. restart monitor and manager
docker-compose restart mon1 mgr
  1. up all Object Storage Daemon
docker-compose up -d osd1 osd2 osd3
  1. up RADOS Gateway
docker-compose up -d rgw1
  1. up Metadata Server
docker-compose up -d mds1
  1. enable mgr dashboard module
docker-compose exec mon1 ceph mgr module enable dashboard
  1. create dashboard signed cert
docker-compose exec mon1 ceph dashboard create-self-signed-cert
  1. restart mgr dashboard module
docker-compose exec mon1 ceph mgr module disable dashboard
docker-compose exec mon1 ceph mgr module enable dashboard
  1. bind dashport port and domain
docker-compose exec mon1 ceph config set mgr mgr/dashboard/server_addr mgr
docker-compose exec mon1 ceph config set mgr mgr/dashboard/server_port 8443
  1. get all mgr register services
docker-compose exec mon1 ceph mgr services
  1. create dashboard account
docker-compose exec mon1 ceph dashboard set-login-credentials <ACCOUNT> <PASSWORD>
  1. create rados gateway user
docker-compose exec mon1 radosgw-admin user create --uid=<UID> --display-name=<DISPLAYNAME> --system
  1. bind rados gatway user to dashboard
docker-compose exec mon1 ceph dashboard set-rgw-api-access-key <ACCESS_KEY>
docker-compose exec mon1 ceph dashboard  set-rgw-api-secret-key <SECRET_KEY>

Install

create bridge network

docker network create --driver bridge ceph-cluster-net

edit environment

cp env-example .env

set your environment in .env

vim .env

read .env file if using docker cmd

source .env

up monitor and manager

docker-compose

docker-compose up -d mon1 mgr

docker

docker run -d --net=ceph-cluster-net --name=mon1 -v ${VOLUMES_PATH}/ceph:/etc/ceph/ -v ${VOLUMES_PATH}/lib/ceph/:/var/lib/ceph/ -e MON_IP=${MON1_IP} -e CEPH_PUBLIC_NETWORK=${MON1_CEPH_PUBLIC_NETWORK} ceph/daemon:${CEPH_CONTAINER_VERSION} mon
docker run -d --net=ceph-cluster-net --name=mgr -v ${VOLUMES_PATH}/ceph:/etc/ceph -v ${VOLUMES_PATH}/lib/ceph/:/var/lib/ceph -p ${DASHBOARD_PORT}:${INTERNAL_DASHBOARD_PORT} ceph/daemon:${CEPH_CONTAINER_VERSION} mgr

up all osds

docker-compose

docker-compose up -d osd1 osd2 osd3

docker

docker run -d --net=ceph-cluster-net --name=osd1 --privileged=true --pid=host -v ${VOLUMES_PATH}/ceph:/etc/ceph -v ${VOLUMES_PATH}/lib/ceph/:/var/lib/ceph/ -v ${OSD_PATH}/osd1:/var/lib/ceph/osd ceph/daemon:${CEPH_CONTAINER_VERSION} osd_directory
docker run -d --net=ceph-cluster-net --name=osd2 --privileged=true --pid=host -v ${VOLUMES_PATH}/ceph:/etc/ceph -v ${VOLUMES_PATH}/lib/ceph/:/var/lib/ceph/ -v ${OSD_PATH}/osd2:/var/lib/ceph/osd ceph/daemon:${CEPH_CONTAINER_VERSION} osd_directory
docker run -d --net=ceph-cluster-net --name=osd3 --privileged=true --pid=host -v ${VOLUMES_PATH}/ceph:/etc/ceph -v ${VOLUMES_PATH}/lib/ceph/:/var/lib/ceph/ -v ${OSD_PATH}/osd3:/var/lib/ceph/osd ceph/daemon:${CEPH_CONTAINER_VERSION} osd_directory

up radosgw

docker-compose

docker-compose up -d rgw1

docker

docker run -d --net=ceph-cluster-net --name=rgw1 -v ${VOLUMES_PATH}/lib/ceph/:/var/lib/ceph/ -v ${VOLUMES_PATH}/ceph:/etc/ceph -p ${RGW_PORT}:8080 ceph/daemon:${CEPH_CONTAINER_VERSION} rgw

up Metadata Server

docker-compose

docker-compose up -d mds1

docker

docker run -d --net=ceph-cluster-net --name=mds1 -v ${VOLUMES_PATH}/lib/ceph/:/var/lib/ceph/ -v ${VOLUMES_PATH}/ceph:/etc/ceph -e CEPHFS_CREATE=1 ceph/daemon:${CEPH_CONTAINER_VERSION} mds

Create Dashboard account

docker-compose

docker-compose exec mon1 ceph dashboard set-login-credentials <user_name> <password>

docker

docker exec -ti mon1 ceph dashboard set-login-credentials <user_name> <password>

Create RGW user

docker-compose

docker-compose exec mon1 radosgw-admin user create --uid="<user_id>" --display-name="<display_name>" --email="<email>"

docker

docker exec -ti mon1 radosgw-admin user create --uid="<user_id>" --display-name="<display_name>" --email="<email>"

show user info and set radosgw api keys

docker-compose

docker-compose exec mon1 radosgw-admin user info --uid=<user_id>
docker-compose exec mon1 ceph dashboard set-rgw-api-access-key <access_key>
docker-compose exec mon1 ceph dashboard set-rgw-api-secret-key <secret_key>

docker

docker exec -ti mon1 radosgw-admin user info --uid=<user_id>
docker exec -ti mon1 ceph dashboard set-rgw-api-access-key <access_key>
docker exec -ti mon1 ceph dashboard set-rgw-api-secret-key <secret_key>