diff options
| author | Juan L. Negron <juan.negron@canonical.com> | 2012-08-18 19:31:14 -0700 |
|---|---|---|
| committer | Juan L. Negron <juan.negron@canonical.com> | 2012-08-18 19:31:14 -0700 |
| commit | 211ad3cee33df8daa8821507b594bdbe6655d866 (patch) | |
| tree | 8d1a6e54ef6b6c18f50085f8e7354d831b07b863 /hooks/config-changed | |
| parent | f0c06e500182eed40e9811562ddc31985f69f7a3 (diff) | |
Refactor of the existing mongodb charm. Added most of the options in mongodb.conf as config.yaml options. Added sharding.
Diffstat (limited to 'hooks/config-changed')
| -rwxr-xr-x | hooks/config-changed | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/hooks/config-changed b/hooks/config-changed deleted file mode 100755 index df92ffb..0000000 --- a/hooks/config-changed +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -# This must be renamed to the name of the relation. The goal here is to -# affect any change needed by relationships being formed -# This script should be idempotent. - -set -ux - -DEFAULT_REPLSET_NAME=`config-get replicaset` -REPLICASET_MASTER=`config-get replicaset_master` -HOSTNAME=`unit-get public-address` - -############################################################################################################ -# Are we connecting to an existing replica set? -############################################################################################################ -if [ "${REPLICASET_MASTER}" != "auto" ]; then - grep "${DEFAULT_REPLSET_NAME}" /etc/init/mongodb.conf - if [ $? -ne 0 ];then - sed -i -e "s/ -- / -- --replSet ${DEFAULT_REPLSET_NAME} /" /etc/init/mongodb.conf - service mongodb stop - rm -f /var/lib/mongodb/mongod.lock - service mongodb start - fi - mongo --host ${REPLICASET_MASTER} --eval "rs.add(\""${HOSTNAME}"\")" -fi - |
