blob: 6285ac410b213c23883d7d1c0a81992ea262153f (
plain)
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 | #!/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` ############################################################################################################ # 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 || 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 relation-set hostname=`hostname -f` replset=${DEFAULT_REPLSET_NAME} install-time=`facter install-time` echo $JUJU_REMOTE_UNIT joined
|