Skip to content

Commit

Permalink
Merge pull request #42 from knix-microfunctions/bug/40
Browse files Browse the repository at this point in the history
Bug/40
  • Loading branch information
Istemi Ekin Akkus authored Jun 16, 2020
2 parents 2e3baa2 + 1dda6a0 commit 8d3f0ed
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions riak/script/poststart.d/10-join-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Maybe join to a cluster
if [[ -z "$($RIAK_ADMIN cluster status | grep $HOSTNAME)" && ${COORDINATOR_NODE} != ${HOSTNAME}* && ${HOSTNAME} != ${COORDINATOR_NODE}* ]]; then
#if [[ -z "$($RIAK_ADMIN cluster status | grep $COORDINATOR_NODE_HOST)" && ${HOSTNAME} != ${COORDINATOR_NODE}* ]]; then
# Not already in this cluster and not the coordinator itself, so join
# If not coordinator, join it to form a cluster
# TODO: restart of coordinator node leaves it outside the cluster
if [[ ${COORDINATOR_NODE} != ${HOSTNAME}* && ${HOSTNAME} != ${COORDINATOR_NODE}* ]]; then
echo "Connecting to cluster coordinator $COORDINATOR_NODE"
ping -c 1 $COORDINATOR_NODE
curl -s http://$COORDINATOR_NODE:$RK_MFN1_SERVICE_PORT_HTTP >/dev/null
$RIAK_ADMIN cluster join riak@$COORDINATOR_NODE
if [[ ! -z "($RIAK_ADMIN cluster status | grep ${HOSTNAME} | grep 'joining')" ]]; then
if [[ -z "$($RIAK_ADMIN cluster plan | grep 'There are no staged changes')" ]]; then
Expand Down

0 comments on commit 8d3f0ed

Please sign in to comment.