Skip to content

Commit

Permalink
mkcephfs: copy ceph.conf to /etc/ceph/ceph.conf (when -a)
Browse files Browse the repository at this point in the history
You can disable this with --no-copy-conf.

Signed-off-by: Sage Weil <[email protected]>
  • Loading branch information
liewegas committed Oct 17, 2011
1 parent 84a6f6e commit 9c95604
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
5 changes: 5 additions & 0 deletions doc/man/8/mkcephfs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ Options
and (if it differs from "osd data") "btrfs path" options must be
defined.

.. option:: --no-copy-conf

By default, mkcephfs with -a will copy the new configuration to
/etc/ceph/ceph.conf on each node in the cluster. This option
disables that behavior.

Subcommands
===========
Expand Down
9 changes: 8 additions & 1 deletion man/mkcephfs.8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "MKCEPHFS" "8" "September 22, 2011" "dev" "Ceph"
.TH "MKCEPHFS" "8" "October 17, 2011" "dev" "Ceph"
.SH NAME
mkcephfs \- create a ceph file system
.
Expand Down Expand Up @@ -117,6 +117,13 @@ ceph.conf for OSD data storage using mkfs.btrfs. The "btrfs devs"
and (if it differs from "osd data") "btrfs path" options must be
defined.
.UNINDENT
.INDENT 0.0
.TP
.B \-\-no\-copy\-conf
By default, mkcephfs with \-a will copy the new configuration to
/etc/ceph/ceph.conf on each node in the cluster. This option
disables that behavior.
.UNINDENT
.SH SUBCOMMANDS
.sp
The sub\-commands performed during cluster setup can be run individually with
Expand Down
24 changes: 24 additions & 0 deletions src/mkcephfs.in
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ dir=""
moreargs=""
auto_action=0
manual_action=0
nocopyconf=0

while [ $# -ge 1 ]; do
case $1 in
Expand Down Expand Up @@ -132,6 +133,9 @@ case $1 in
--mkbtrfs)
mkbtrfs=1
;;
--no-copy-conf)
nocopyconf=1
;;
--conf | -c)
[ -z "$2" ] && usage_exit
shift
Expand Down Expand Up @@ -441,8 +445,18 @@ if [ $allhosts -eq 1 ]; then
do_cmd "mkdir -p $rdir"
scp -q $dir/conf $host:$rdir
scp -q $dir/monmap $host:$rdir

if [ $nocopyconf -eq 0 ]; then
# also put conf at /etc/ceph/ceph.conf
scp -q $dir/conf $host:/etc/ceph/ceph.conf
fi
else
rdir=$dir

if [ $nocopyconf -eq 0 ]; then
# also put conf at /etc/ceph/ceph.conf
cp $dir/conf /etc/ceph/ceph.conf
fi
fi

if [ $mkbtrfs -eq 1 ] && [ "$type" = "osd" ]; then
Expand Down Expand Up @@ -476,8 +490,18 @@ if [ $allhosts -eq 1 ]; then
echo pushing everything to $host
ssh $host mkdir -p $rdir
scp -q $dir/* $host:$rdir

if [ $nocopyconf -eq 0 ]; then
# also put conf at /etc/ceph/ceph.conf
scp -q $dir/conf $host:/etc/ceph/ceph.conf
fi
else
rdir=$dir

if [ $nocopyconf -eq 0 ]; then
# also put conf at /etc/ceph/ceph.conf
cp $dir/conf /etc/ceph/ceph.conf
fi
fi

do_root_cmd "$0 -d $rdir --init-daemon $name"
Expand Down

0 comments on commit 9c95604

Please sign in to comment.