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/replica-set-relation-joined | |
| 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/replica-set-relation-joined')
| -rwxr-xr-x | hooks/replica-set-relation-joined | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/hooks/replica-set-relation-joined b/hooks/replica-set-relation-joined deleted file mode 100755 index ecf1e71..0000000 --- a/hooks/replica-set-relation-joined +++ /dev/null @@ -1,28 +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` -INSTALL_ORDER=$(echo ${JUJU_UNIT_NAME} | awk -F/ '{ print $2 }') -HOSTNAME=`unit-get public-address` - -############################################################################################################ -# Reconfigure the upstart script to include the replica-set option. -# We'll need this so, when we add nodes, they can all talk to each other. -# Replica sets can only talk to each other if they all belong to the same -# set. In our case, we have defaulted to "myset". -############################################################################################################ -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 - -relation-set hostname=${HOSTNAME} replset=${DEFAULT_REPLSET_NAME} install-order=${INSTALL_ORDER} - -echo $JUJU_REMOTE_UNIT joined |
