Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parsing IP address when starting cluster #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions bin/start-cluster
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@ fi

# start docker containers for 3xreplicaset rs0
SHARD00_ID=$(sudo docker run -d ankurcha/tokumx mongod --replSet rs0 --shardsvr --logpath /dev/stdout --bind_ip 0.0.0.0 --port $PORT)
SHARD00_IP=$(sudo docker inspect ${SHARD00_ID} | grep "IPAddress" | cut -d':' -f2 | cut -d'"' -f2)
SHARD00_IP=$(sudo docker inspect ${SHARD00_ID} | grep '"IPAddress"' | cut -d':' -f2 | cut -d'"' -f2)
echo "Your shard container ${SHARD00_ID} listen on ip: ${SHARD00_IP} (waiting that becomes ready)"
until sudo docker logs ${SHARD00_ID} | grep "replSet info you may need to run replSetInitiate" >/dev/null;
do
sleep 2
done

SHARD01_ID=$(sudo docker run -d ankurcha/tokumx mongod --replSet rs0 --shardsvr --logpath /dev/stdout --bind_ip 0.0.0.0 --port ($PORT+1))
SHARD01_IP=$(sudo docker inspect ${SHARD01_ID} | grep "IPAddress" | cut -d':' -f2 | cut -d'"' -f2)
SHARD01_IP=$(sudo docker inspect ${SHARD01_ID} | grep '"IPAddress"' | cut -d':' -f2 | cut -d'"' -f2)
echo "Your shard container ${SHARD01_ID} listen on ip: ${SHARD01_IP} (waiting that becomes ready)"
until sudo docker logs ${SHARD01_ID} | grep "replSet info you may need to run replSetInitiate" >/dev/null;
do
sleep 2
done

SHARD02_ID=$(sudo docker run -d ankurcha/tokumx mongod --replSet rs0 --shardsvr --logpath /dev/stdout --bind_ip 0.0.0.0 --port ($PORT+2))
SHARD02_IP=$(sudo docker inspect ${SHARD02_ID} | grep "IPAddress" | cut -d':' -f2 | cut -d'"' -f2)
SHARD02_IP=$(sudo docker inspect ${SHARD02_ID} | grep '"IPAddress"' | cut -d':' -f2 | cut -d'"' -f2)
echo "Your shard container ${SHARD02_ID} listen on ip: ${SHARD02_IP} (waiting that becomes ready)"
until sudo docker logs ${SHARD02_ID} | grep "replSet info you may need to run replSetInitiate" >/dev/null;
do
Expand All @@ -55,7 +55,7 @@ done
echo "The shard replset is available now..."

CONFIG0_ID=$(sudo docker run -d ankurcha/tokumx mongod --configsvr --dbpath /data/ --logpath /dev/stdout --bind_ip 0.0.0.0 --port $PORT)
CONFIG0_IP=$(sudo docker inspect ${CONFIG0_ID} | grep "IPAddress" | cut -d':' -f2 | cut -d'"' -f2)
CONFIG0_IP=$(sudo docker inspect ${CONFIG0_ID} | grep '"IPAddress"' | cut -d':' -f2 | cut -d'"' -f2)
echo "Your config container ${CONFIG0_ID} listen on ip: ${CONFIG0_IP} (waiting that becomes ready)"

until sudo docker logs ${CONFIG0_ID} | grep "waiting for connections on port" >/dev/null;
Expand All @@ -66,7 +66,7 @@ done
echo "The config is available now..."

MONGOS0_ID=$(sudo docker run -p 9999:9999 -d ankurcha/tokumx mongos --configdb ${CONFIG0_IP}:$PORT --logpath /dev/stdout --bind_ip 0.0.0.0 --port 9999)
MONGOS0_IP=$(sudo docker inspect ${MONGOS0_ID} | grep "IPAddress" | cut -d':' -f2 | cut -d'"' -f2)
MONGOS0_IP=$(sudo docker inspect ${MONGOS0_ID} | grep '"IPAddress"' | cut -d':' -f2 | cut -d'"' -f2)
echo "Contacting shard and mongod containers"

until sudo docker logs ${MONGOS0_ID} | grep "config servers and shards contacted successfully" >/dev/null;
Expand Down
10 changes: 5 additions & 5 deletions bin/start-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,23 @@ fi

# start docker containers for 3xreplicaset rs0
SHARD00_ID=$(sudo docker run -d ankurcha/tokumx mongod --replSet rs0 --shardsvr --logpath /dev/stdout --bind_ip 0.0.0.0 --port $PORT)
SHARD00_IP=$(sudo docker inspect ${SHARD00_ID} | grep "IPAddress" | cut -d':' -f2 | cut -d'"' -f2)
SHARD00_IP=$(sudo docker inspect ${SHARD00_ID} | grep '"IPAddress"' | cut -d':' -f2 | cut -d'"' -f2)
echo "Your shard container ${SHARD00_ID} listen on ip: ${SHARD00_IP} (waiting that becomes ready)"
until sudo docker logs ${SHARD00_ID} | grep "replSet info you may need to run replSetInitiate" >/dev/null;
do
sleep 2
done

SHARD01_ID=$(sudo docker run -d ankurcha/tokumx mongod --replSet rs0 --shardsvr --logpath /dev/stdout --bind_ip 0.0.0.0 --port $PORT1)
SHARD01_IP=$(sudo docker inspect ${SHARD01_ID} | grep "IPAddress" | cut -d':' -f2 | cut -d'"' -f2)
SHARD01_IP=$(sudo docker inspect ${SHARD01_ID} | grep '"IPAddress"' | cut -d':' -f2 | cut -d'"' -f2)
echo "Your shard container ${SHARD01_ID} listen on ip: ${SHARD01_IP} (waiting that becomes ready)"
until sudo docker logs ${SHARD01_ID} | grep "replSet info you may need to run replSetInitiate" >/dev/null;
do
sleep 2
done

SHARD02_ID=$(sudo docker run -d ankurcha/tokumx mongod --replSet rs0 --shardsvr --logpath /dev/stdout --bind_ip 0.0.0.0 --port $PORT2)
SHARD02_IP=$(sudo docker inspect ${SHARD02_ID} | grep "IPAddress" | cut -d':' -f2 | cut -d'"' -f2)
SHARD02_IP=$(sudo docker inspect ${SHARD02_ID} | grep '"IPAddress"' | cut -d':' -f2 | cut -d'"' -f2)
echo "Your shard container ${SHARD02_ID} listen on ip: ${SHARD02_IP} (waiting that becomes ready)"
until sudo docker logs ${SHARD02_ID} | grep "replSet info you may need to run replSetInitiate" >/dev/null;
do
Expand All @@ -62,7 +62,7 @@ done
echo "The shard replset is available now..."

CONFIG0_ID=$(sudo docker run -d ankurcha/tokumx mongod --configsvr --dbpath /data/ --logpath /dev/stdout --bind_ip 0.0.0.0 --port $PORT)
CONFIG0_IP=$(sudo docker inspect ${CONFIG0_ID} | grep "IPAddress" | cut -d':' -f2 | cut -d'"' -f2)
CONFIG0_IP=$(sudo docker inspect ${CONFIG0_ID} | grep '"IPAddress"' | cut -d':' -f2 | cut -d'"' -f2)
echo "Your config container ${CONFIG0_ID} listen on ip: ${CONFIG0_IP} (waiting that becomes ready)"

until sudo docker logs ${CONFIG0_ID} | grep "waiting for connections on port" >/dev/null;
Expand All @@ -73,7 +73,7 @@ done
echo "The config is available now..."

MONGOS0_ID=$(sudo docker run -p $PORT_1:$PORT_1 -d ankurcha/tokumx mongos --configdb ${CONFIG0_IP}:$PORT --logpath /dev/stdout --bind_ip 0.0.0.0 --port $PORT_1)
MONGOS0_IP=$(sudo docker inspect ${MONGOS0_ID} | grep "IPAddress" | cut -d':' -f2 | cut -d'"' -f2)
MONGOS0_IP=$(sudo docker inspect ${MONGOS0_ID} | grep '"IPAddress"' | cut -d':' -f2 | cut -d'"' -f2)
echo "Contacting shard and mongod containers"

until sudo docker logs ${MONGOS0_ID} | grep "config servers and shards contacted successfully" >/dev/null;
Expand Down
10 changes: 5 additions & 5 deletions bin/start_singleShard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@ set -e

# start docker containers for 3xreplicaset $RS
SHARD00_ID=$(sudo docker run -d ankurcha/tokumx mongod --replSet $RS --shardsvr --logpath /dev/stdout --bind_ip 0.0.0.0 --port $PORT)
SHARD00_IP=$(sudo docker inspect ${SHARD00_ID} | grep "IPAddress" | cut -d':' -f2 | cut -d'"' -f2)
SHARD00_IP=$(sudo docker inspect ${SHARD00_ID} | grep '"IPAddress"' | cut -d':' -f2 | cut -d'"' -f2)
echo "Your shard container ${SHARD00_ID} listen on ip: ${SHARD00_IP} (waiting that becomes ready)"
until sudo docker logs ${SHARD00_ID} | grep "replSet info you may need to run replSetInitiate" >/dev/null;
do
sleep 2
done

SHARD01_ID=$(sudo docker run -d ankurcha/tokumx mongod --replSet $RS --shardsvr --logpath /dev/stdout --bind_ip 0.0.0.0 --port $PORT1)
SHARD01_IP=$(sudo docker inspect ${SHARD01_ID} | grep "IPAddress" | cut -d':' -f2 | cut -d'"' -f2)
SHARD01_IP=$(sudo docker inspect ${SHARD01_ID} | grep '"IPAddress"' | cut -d':' -f2 | cut -d'"' -f2)
echo "Your shard container ${SHARD01_ID} listen on ip: ${SHARD01_IP} (waiting that becomes ready)"
until sudo docker logs ${SHARD01_ID} | grep "replSet info you may need to run replSetInitiate" >/dev/null;
do
sleep 2
done

SHARD02_ID=$(sudo docker run -d ankurcha/tokumx mongod --replSet $RS --shardsvr --logpath /dev/stdout --bind_ip 0.0.0.0 --port $PORT2)
SHARD02_IP=$(sudo docker inspect ${SHARD02_ID} | grep "IPAddress" | cut -d':' -f2 | cut -d'"' -f2)
SHARD02_IP=$(sudo docker inspect ${SHARD02_ID} | grep '"IPAddress"' | cut -d':' -f2 | cut -d'"' -f2)
echo "Your shard container ${SHARD02_ID} listen on ip: ${SHARD02_IP} (waiting that becomes ready)"
until sudo docker logs ${SHARD02_ID} | grep "replSet info you may need to run replSetInitiate" >/dev/null;
do
Expand All @@ -51,7 +51,7 @@ done
echo "The shard replset is available now..."

CONFIG0_ID=$(sudo docker run -d ankurcha/tokumx mongod --configsvr --dbpath /data/ --logpath /dev/stdout --bind_ip 0.0.0.0 --port $PORT)
CONFIG0_IP=$(sudo docker inspect ${CONFIG0_ID} | grep "IPAddress" | cut -d':' -f2 | cut -d'"' -f2)
CONFIG0_IP=$(sudo docker inspect ${CONFIG0_ID} | grep '"IPAddress"' | cut -d':' -f2 | cut -d'"' -f2)
echo "Your config container ${CONFIG0_ID} listen on ip: ${CONFIG0_IP} (waiting that becomes ready)"

until sudo docker logs ${CONFIG0_ID} | grep "waiting for connections on port" >/dev/null;
Expand All @@ -62,7 +62,7 @@ done
echo "The config is available now..."

MONGOS0_ID=$(sudo docker run -p $PORT_1:$PORT_1 -d ankurcha/tokumx mongos --configdb ${CONFIG0_IP}:$PORT --logpath /dev/stdout --bind_ip 0.0.0.0 --port $PORT_1)
MONGOS0_IP=$(sudo docker inspect ${MONGOS0_ID} | grep "IPAddress" | cut -d':' -f2 | cut -d'"' -f2)
MONGOS0_IP=$(sudo docker inspect ${MONGOS0_ID} | grep '"IPAddress"' | cut -d':' -f2 | cut -d'"' -f2)
echo "Contacting shard and mongod containers"

until sudo docker logs ${MONGOS0_ID} | grep "config servers and shards contacted successfully" >/dev/null;
Expand Down