Skip to content

Commit 8d3f0ed

Browse files
author
Istemi Ekin Akkus
authored
Merge pull request #42 from knix-microfunctions/bug/40
Bug/40
2 parents 2e3baa2 + 1dda6a0 commit 8d3f0ed

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

riak/script/poststart.d/10-join-cluster.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

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

0 commit comments

Comments
 (0)