go-ceph: add cephfs to docker

* Adds metadata server (mds) for cephfs to Dockerfile
* Enables cephfs tests
This commit is contained in:
Lincoln Thurlow 2018-10-09 20:56:52 -07:00
parent 92d7415a65
commit b7c7659ec4
2 changed files with 16 additions and 2 deletions

View File

@ -2,6 +2,7 @@
set -e
rm -rf /tmp/ceph
mkdir /tmp/ceph
/micro-osd.sh /tmp/ceph
export CEPH_CONF=/tmp/ceph/ceph.conf
@ -12,4 +13,4 @@ go get -t -v ./...
diff -u <(echo -n) <(gofmt -d -s .)
#go vet ./...
#go list ./...
go test -v $(go list ./... | grep -v cephfs)
GOCACHE=off go test -v ./...

View File

@ -25,8 +25,10 @@ pkill ceph || true
rm -rf ${DIR}/*
LOG_DIR=${DIR}/log
MON_DATA=${DIR}/mon
MDS_DATA=${DIR}/mds
OSD_DATA=${DIR}/osd
mkdir ${LOG_DIR} ${MON_DATA} ${OSD_DATA}
mkdir ${LOG_DIR} ${MON_DATA} ${OSD_DATA} ${MDS_DATA}
MDS_NAME="Z"
# cluster wide parameters
cat >> ${DIR}/ceph.conf <<EOF
@ -39,6 +41,9 @@ auth service required = none
auth client required = none
osd pool default size = 1
[mds.${MDS_NAME}]
host = localhost
[mon.a]
log file = ${LOG_DIR}/mon.log
chdir = ""
@ -71,6 +76,14 @@ ceph osd crush add osd.${OSD_ID} 1 root=default host=localhost
ceph-osd --id ${OSD_ID} --mkjournal --mkfs
ceph-osd --id ${OSD_ID}
# start an mds for cephfs
ceph auth get-or-create mds.${MDS_NAME} mon 'profile mds' mgr 'profile mds' mds 'allow *' osd 'allow *' > ${MDS_DATA}/keyring
ceph osd pool create cephfs_data 8
ceph osd pool create cephfs_metadata 8
ceph fs new cephfs cephfs_metadata cephfs_data
ceph fs ls
ceph-mds -i ${MDS_NAME}
# start a manager
ceph-mgr --id x