mirror of
https://github.com/ceph/go-ceph
synced 2025-01-11 08:39:50 +00:00
go-ceph: add cephfs to docker
* Adds metadata server (mds) for cephfs to Dockerfile * Enables cephfs tests
This commit is contained in:
parent
92d7415a65
commit
b7c7659ec4
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
rm -rf /tmp/ceph
|
||||||
mkdir /tmp/ceph
|
mkdir /tmp/ceph
|
||||||
/micro-osd.sh /tmp/ceph
|
/micro-osd.sh /tmp/ceph
|
||||||
export CEPH_CONF=/tmp/ceph/ceph.conf
|
export CEPH_CONF=/tmp/ceph/ceph.conf
|
||||||
@ -12,4 +13,4 @@ go get -t -v ./...
|
|||||||
diff -u <(echo -n) <(gofmt -d -s .)
|
diff -u <(echo -n) <(gofmt -d -s .)
|
||||||
#go vet ./...
|
#go vet ./...
|
||||||
#go list ./...
|
#go list ./...
|
||||||
go test -v $(go list ./... | grep -v cephfs)
|
GOCACHE=off go test -v ./...
|
||||||
|
15
micro-osd.sh
15
micro-osd.sh
@ -25,8 +25,10 @@ pkill ceph || true
|
|||||||
rm -rf ${DIR}/*
|
rm -rf ${DIR}/*
|
||||||
LOG_DIR=${DIR}/log
|
LOG_DIR=${DIR}/log
|
||||||
MON_DATA=${DIR}/mon
|
MON_DATA=${DIR}/mon
|
||||||
|
MDS_DATA=${DIR}/mds
|
||||||
OSD_DATA=${DIR}/osd
|
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
|
# cluster wide parameters
|
||||||
cat >> ${DIR}/ceph.conf <<EOF
|
cat >> ${DIR}/ceph.conf <<EOF
|
||||||
@ -39,6 +41,9 @@ auth service required = none
|
|||||||
auth client required = none
|
auth client required = none
|
||||||
osd pool default size = 1
|
osd pool default size = 1
|
||||||
|
|
||||||
|
[mds.${MDS_NAME}]
|
||||||
|
host = localhost
|
||||||
|
|
||||||
[mon.a]
|
[mon.a]
|
||||||
log file = ${LOG_DIR}/mon.log
|
log file = ${LOG_DIR}/mon.log
|
||||||
chdir = ""
|
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} --mkjournal --mkfs
|
||||||
ceph-osd --id ${OSD_ID}
|
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
|
# start a manager
|
||||||
ceph-mgr --id x
|
ceph-mgr --id x
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user