-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnew_setup_env
executable file
·31 lines (20 loc) · 976 Bytes
/
new_setup_env
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
CEPH_DIR=$HOME/ceph/build/src
[ "$1" == "" ] && echo "usage: $0 <env>" && exit 1
subdir="$HOME/scripts/env.$1"
[ -d $subdir ] || ( echo "ERROR: subdir $subdir does not exist"; exit 1 )
env_name=$1
$CEPH_DIR/radosgw-admin realm create --realm myrealm
$CEPH_DIR/radosgw-admin realm set-default --realm myrealm
for r in `ls $subdir/regions`; do
$CEPH_DIR/radosgw-admin zonegroup set < $subdir/regions/$r
done
for z in `ls $subdir/zones`; do
$CEPH_DIR/radosgw-admin zone set --zone=${z%.zone} < $subdir/zones/$z
done
[ -e $subdir/default-region ] && $CEPH_DIR/radosgw-admin zonegroup default --zonegroup=`cat $subdir/default-region`
$CEPH_DIR/rados -p .rgw.root rm zonegroup_info.default > /dev/null 2>&1
$CEPH_DIR/rados -p .rgw.root rm zone_info.default > /dev/null 2>&1
$CEPH_DIR/rados -p rgw.root rm zonegroup_info.default > /dev/null 2>&1
$CEPH_DIR/rados -p rgw.root rm zone_info.default > /dev/null 2>&1
$CEPH_DIR/radosgw-admin zonegroupmap update