1
0
Fork 0

ipv4 is so yesterday

This commit is contained in:
Kaveh Vahedipour 2017-04-24 11:51:38 +02:00
parent 733d7260eb
commit 97c9198b4d
1 changed files with 29 additions and 26 deletions

View File

@ -58,6 +58,9 @@ CO_BASE=$(( $PORT_OFFSET + 8530 ))
DB_BASE=$(( $PORT_OFFSET + 8629 )) DB_BASE=$(( $PORT_OFFSET + 8629 ))
NATH=$(( $NRDBSERVERS + $NRCOORDINATORS + $NRAGENTS )) NATH=$(( $NRDBSERVERS + $NRCOORDINATORS + $NRAGENTS ))
LOCALHOST="[::1]"
ANYWHERE="[::]"
rm -rf cluster rm -rf cluster
if [ -d cluster-init ];then if [ -d cluster-init ];then
cp -a cluster-init cluster cp -a cluster-init cluster
@ -83,7 +86,7 @@ fi
echo Starting agency ... echo Starting agency ...
for aid in `seq 0 $(( $NRAGENTS - 1 ))`; do for aid in `seq 0 $(( $NRAGENTS - 1 ))`; do
port=$(( $AG_BASE + $aid )) port=$(( $AG_BASE + $aid ))
AGENCY_ENDPOINTS+="--cluster.agency-endpoint $TRANSPORT://localhost:$port " AGENCY_ENDPOINTS+="--cluster.agency-endpoint $TRANSPORT://$LOCALHOST:$port "
${BUILD}/bin/arangod \ ${BUILD}/bin/arangod \
-c none \ -c none \
--agency.activate true \ --agency.activate true \
@ -91,8 +94,8 @@ for aid in `seq 0 $(( $NRAGENTS - 1 ))`; do
--agency.compaction-keep-size $KEEP \ --agency.compaction-keep-size $KEEP \
--agency.election-timeout-min $MINT \ --agency.election-timeout-min $MINT \
--agency.election-timeout-max $MAXT \ --agency.election-timeout-max $MAXT \
--agency.endpoint $TRANSPORT://localhost:$AG_BASE \ --agency.endpoint $TRANSPORT://$LOCALHOST:$AG_BASE \
--agency.my-address $TRANSPORT://localhost:$port \ --agency.my-address $TRANSPORT://$LOCALHOST:$port \
--agency.pool-size $NRAGENTS \ --agency.pool-size $NRAGENTS \
--agency.size $NRAGENTS \ --agency.size $NRAGENTS \
--agency.supervision true \ --agency.supervision true \
@ -104,7 +107,7 @@ for aid in `seq 0 $(( $NRAGENTS - 1 ))`; do
--javascript.startup-directory ./js \ --javascript.startup-directory ./js \
--javascript.module-directory ./enterprise/js \ --javascript.module-directory ./enterprise/js \
--javascript.v8-contexts 1 \ --javascript.v8-contexts 1 \
--server.endpoint $TRANSPORT://0.0.0.0:$port \ --server.endpoint $TRANSPORT://$ANY:$port \
--server.statistics false \ --server.statistics false \
--server.threads 16 \ --server.threads 16 \
--log.file cluster/$port.log \ --log.file cluster/$port.log \
@ -131,11 +134,11 @@ start() {
${BUILD}/bin/arangod \ ${BUILD}/bin/arangod \
-c none \ -c none \
--database.directory cluster/data$PORT \ --database.directory cluster/data$PORT \
--cluster.agency-endpoint $TRANSPORT://127.0.0.1:$AG_BASE \ --cluster.agency-endpoint $TRANSPORT://$LOCALHOST:$AG_BASE \
--cluster.my-address $TRANSPORT://127.0.0.1:$PORT \ --cluster.my-address $TRANSPORT://$LOCALHOST:$PORT \
--server.endpoint $TRANSPORT://0.0.0.0:$PORT \ --server.endpoint $TRANSPORT://$ANY:$PORT \
--cluster.my-local-info $TYPE:127.0.0.1:$PORT \ --cluster.my-local-info $TYPE:$LOCALHOST:$PORT \
--server.endpoint $TRANSPORT://0.0.0.0:$PORT \ --server.endpoint $TRANSPORT://$ANY:$PORT \
--cluster.my-role $ROLE \ --cluster.my-role $ROLE \
--log.file cluster/$PORT.log \ --log.file cluster/$PORT.log \
--log.level $LOG_LEVEL \ --log.level $LOG_LEVEL \
@ -166,9 +169,9 @@ startTerminal() {
$XTERM $XTERMOPTIONS -e "${BUILD}/bin/arangod \ $XTERM $XTERMOPTIONS -e "${BUILD}/bin/arangod \
-c none \ -c none \
--database.directory cluster/data$PORT \ --database.directory cluster/data$PORT \
--cluster.agency-endpoint $TRANSPORT://127.0.0.1:$AG_BASE \ --cluster.agency-endpoint $TRANSPORT://$LOCALHOST:$AG_BASE \
--cluster.my-address $TRANSPORT://127.0.0.1:$PORT \ --cluster.my-address $TRANSPORT://$LOCALHOST:$PORT \
--server.endpoint $TRANSPORT://0.0.0.0:$PORT \ --server.endpoint $TRANSPORT://$ANY:$PORT \
--cluster.my-role $ROLE \ --cluster.my-role $ROLE \
--log.file cluster/$PORT.log \ --log.file cluster/$PORT.log \
--log.level $LOG_LEVEL \ --log.level $LOG_LEVEL \
@ -197,9 +200,9 @@ startDebugger() {
${BUILD}/bin/arangod \ ${BUILD}/bin/arangod \
-c none \ -c none \
--database.directory cluster/data$PORT \ --database.directory cluster/data$PORT \
--cluster.agency-endpoint $TRANSPORT://127.0.0.1:$AG_BASE \ --cluster.agency-endpoint $TRANSPORT://$LOCALHOST:$AG_BASE \
--cluster.my-address $TRANSPORT://127.0.0.1:$PORT \ --cluster.my-address $TRANSPORT://$LOCALHOST:$PORT \
--server.endpoint $TRANSPORT://0.0.0.0:$PORT \ --server.endpoint $TRANSPORT://$ANY:$PORT \
--cluster.my-role $ROLE \ --cluster.my-role $ROLE \
--log.file cluster/$PORT.log \ --log.file cluster/$PORT.log \
--log.level $LOG_LEVEL \ --log.level $LOG_LEVEL \
@ -230,9 +233,9 @@ startRR() {
$XTERM $XTERMOPTIONS -e "rr ${BUILD}/bin/arangod \ $XTERM $XTERMOPTIONS -e "rr ${BUILD}/bin/arangod \
-c none \ -c none \
--database.directory cluster/data$PORT \ --database.directory cluster/data$PORT \
--cluster.agency-endpoint $TRANSPORT://127.0.0.1:$AG_BASE \ --cluster.agency-endpoint $TRANSPORT://$LOCALHOST:$AG_BASE \
--cluster.my-address $TRANSPORT://127.0.0.1:$PORT \ --cluster.my-address $TRANSPORT://$LOCALHOST:$PORT \
--server.endpoint $TRANSPORT://0.0.0.0:$PORT \ --server.endpoint $TRANSPORT://$ANY:$PORT \
--cluster.my-role $ROLE \ --cluster.my-role $ROLE \
--log.file cluster/$PORT.log \ --log.file cluster/$PORT.log \
--log.level $LOG_LEVEL \ --log.level $LOG_LEVEL \
@ -285,9 +288,9 @@ testServer() {
PORT=$1 PORT=$1
while true ; do while true ; do
if [ -z "$AUTHORIZATION_HEADER" ]; then if [ -z "$AUTHORIZATION_HEADER" ]; then
${CURL}//127.0.0.1:$PORT/_api/version > /dev/null 2>&1 ${CURL}//$LOCALHOST:$PORT/_api/version > /dev/null 2>&1
else else
${CURL}//127.0.0.1:$PORT/_api/version -H "$AUTHORIZATION_HEADER" > /dev/null 2>&1 ${CURL}//$LOCALHOST:$PORT/_api/version -H "$AUTHORIZATION_HEADER" > /dev/null 2>&1
fi fi
if [ "$?" != "0" ] ; then if [ "$?" != "0" ] ; then
echo Server on port $PORT does not answer yet. echo Server on port $PORT does not answer yet.
@ -318,16 +321,16 @@ if [ "$SECONDARIES" == "1" ] ; then
CLUSTER_ID="Secondary$index" CLUSTER_ID="Secondary$index"
DBSERVER_ID=$(curl -s 127.0.0.1:$CO_BASE/_admin/cluster/health | jq '.Health | to_entries | map(select(.value.Role == "DBServer")) | .' | jq -r ".[$dbserverindex].key") DBSERVER_ID=$(curl -s $LOCALHOST:$CO_BASE/_admin/cluster/health | jq '.Health | to_entries | map(select(.value.Role == "DBServer")) | .' | jq -r ".[$dbserverindex].key")
echo Registering secondary $CLUSTER_ID for $DBSERVER_ID echo Registering secondary $CLUSTER_ID for $DBSERVER_ID
curl -s -f -X PUT --data "{\"primary\": \"$DBSERVER_ID\", \"oldSecondary\": \"none\", \"newSecondary\": \"$CLUSTER_ID\"}" -H "Content-Type: application/json" localhost:$CO_BASE/_admin/cluster/replaceSecondary curl -s -f -X PUT --data "{\"primary\": \"$DBSERVER_ID\", \"oldSecondary\": \"none\", \"newSecondary\": \"$CLUSTER_ID\"}" -H "Content-Type: application/json" $LOCALHOST:$CO_BASE/_admin/cluster/replaceSecondary
echo Starting Secondary $CLUSTER_ID on port $PORT echo Starting Secondary $CLUSTER_ID on port $PORT
${BUILD}/bin/arangod \ ${BUILD}/bin/arangod \
-c none \ -c none \
--database.directory cluster/data$PORT \ --database.directory cluster/data$PORT \
--cluster.agency-endpoint $TRANSPORT://127.0.0.1:$AG_BASE \ --cluster.agency-endpoint $TRANSPORT://$LOCALHOST:$AG_BASE \
--cluster.my-address $TRANSPORT://127.0.0.1:$PORT \ --cluster.my-address $TRANSPORT://$LOCALHOST:$PORT \
--server.endpoint $TRANSPORT://0.0.0.0:$PORT \ --server.endpoint $TRANSPORT://$ANY:$PORT \
--cluster.my-id $CLUSTER_ID \ --cluster.my-id $CLUSTER_ID \
--log.file cluster/$PORT.log \ --log.file cluster/$PORT.log \
--server.statistics true \ --server.statistics true \
@ -347,7 +350,7 @@ fi
echo Done, your cluster is ready at echo Done, your cluster is ready at
if [ "$NRCOORDINATORS" -gt 0 ] ; then if [ "$NRCOORDINATORS" -gt 0 ] ; then
for p in `seq $CO_BASE $PORTTOPCO` ; do for p in `seq $CO_BASE $PORTTOPCO` ; do
echo " ${BUILD}/bin/arangosh --server.endpoint $TRANSPORT://127.0.0.1:$p" echo " ${BUILD}/bin/arangosh --server.endpoint $TRANSPORT://$LOCALHOST:$p"
done done
fi fi