mirror of https://gitee.com/bigwinds/arangodb
ipv4 is so yesterday
This commit is contained in:
parent
733d7260eb
commit
97c9198b4d
|
@ -58,6 +58,9 @@ CO_BASE=$(( $PORT_OFFSET + 8530 ))
|
|||
DB_BASE=$(( $PORT_OFFSET + 8629 ))
|
||||
NATH=$(( $NRDBSERVERS + $NRCOORDINATORS + $NRAGENTS ))
|
||||
|
||||
LOCALHOST="[::1]"
|
||||
ANYWHERE="[::]"
|
||||
|
||||
rm -rf cluster
|
||||
if [ -d cluster-init ];then
|
||||
cp -a cluster-init cluster
|
||||
|
@ -83,7 +86,7 @@ fi
|
|||
echo Starting agency ...
|
||||
for aid in `seq 0 $(( $NRAGENTS - 1 ))`; do
|
||||
port=$(( $AG_BASE + $aid ))
|
||||
AGENCY_ENDPOINTS+="--cluster.agency-endpoint $TRANSPORT://localhost:$port "
|
||||
AGENCY_ENDPOINTS+="--cluster.agency-endpoint $TRANSPORT://$LOCALHOST:$port "
|
||||
${BUILD}/bin/arangod \
|
||||
-c none \
|
||||
--agency.activate true \
|
||||
|
@ -91,8 +94,8 @@ for aid in `seq 0 $(( $NRAGENTS - 1 ))`; do
|
|||
--agency.compaction-keep-size $KEEP \
|
||||
--agency.election-timeout-min $MINT \
|
||||
--agency.election-timeout-max $MAXT \
|
||||
--agency.endpoint $TRANSPORT://localhost:$AG_BASE \
|
||||
--agency.my-address $TRANSPORT://localhost:$port \
|
||||
--agency.endpoint $TRANSPORT://$LOCALHOST:$AG_BASE \
|
||||
--agency.my-address $TRANSPORT://$LOCALHOST:$port \
|
||||
--agency.pool-size $NRAGENTS \
|
||||
--agency.size $NRAGENTS \
|
||||
--agency.supervision true \
|
||||
|
@ -104,7 +107,7 @@ for aid in `seq 0 $(( $NRAGENTS - 1 ))`; do
|
|||
--javascript.startup-directory ./js \
|
||||
--javascript.module-directory ./enterprise/js \
|
||||
--javascript.v8-contexts 1 \
|
||||
--server.endpoint $TRANSPORT://0.0.0.0:$port \
|
||||
--server.endpoint $TRANSPORT://$ANY:$port \
|
||||
--server.statistics false \
|
||||
--server.threads 16 \
|
||||
--log.file cluster/$port.log \
|
||||
|
@ -131,11 +134,11 @@ start() {
|
|||
${BUILD}/bin/arangod \
|
||||
-c none \
|
||||
--database.directory cluster/data$PORT \
|
||||
--cluster.agency-endpoint $TRANSPORT://127.0.0.1:$AG_BASE \
|
||||
--cluster.my-address $TRANSPORT://127.0.0.1:$PORT \
|
||||
--server.endpoint $TRANSPORT://0.0.0.0:$PORT \
|
||||
--cluster.my-local-info $TYPE:127.0.0.1:$PORT \
|
||||
--server.endpoint $TRANSPORT://0.0.0.0:$PORT \
|
||||
--cluster.agency-endpoint $TRANSPORT://$LOCALHOST:$AG_BASE \
|
||||
--cluster.my-address $TRANSPORT://$LOCALHOST:$PORT \
|
||||
--server.endpoint $TRANSPORT://$ANY:$PORT \
|
||||
--cluster.my-local-info $TYPE:$LOCALHOST:$PORT \
|
||||
--server.endpoint $TRANSPORT://$ANY:$PORT \
|
||||
--cluster.my-role $ROLE \
|
||||
--log.file cluster/$PORT.log \
|
||||
--log.level $LOG_LEVEL \
|
||||
|
@ -166,9 +169,9 @@ startTerminal() {
|
|||
$XTERM $XTERMOPTIONS -e "${BUILD}/bin/arangod \
|
||||
-c none \
|
||||
--database.directory cluster/data$PORT \
|
||||
--cluster.agency-endpoint $TRANSPORT://127.0.0.1:$AG_BASE \
|
||||
--cluster.my-address $TRANSPORT://127.0.0.1:$PORT \
|
||||
--server.endpoint $TRANSPORT://0.0.0.0:$PORT \
|
||||
--cluster.agency-endpoint $TRANSPORT://$LOCALHOST:$AG_BASE \
|
||||
--cluster.my-address $TRANSPORT://$LOCALHOST:$PORT \
|
||||
--server.endpoint $TRANSPORT://$ANY:$PORT \
|
||||
--cluster.my-role $ROLE \
|
||||
--log.file cluster/$PORT.log \
|
||||
--log.level $LOG_LEVEL \
|
||||
|
@ -197,9 +200,9 @@ startDebugger() {
|
|||
${BUILD}/bin/arangod \
|
||||
-c none \
|
||||
--database.directory cluster/data$PORT \
|
||||
--cluster.agency-endpoint $TRANSPORT://127.0.0.1:$AG_BASE \
|
||||
--cluster.my-address $TRANSPORT://127.0.0.1:$PORT \
|
||||
--server.endpoint $TRANSPORT://0.0.0.0:$PORT \
|
||||
--cluster.agency-endpoint $TRANSPORT://$LOCALHOST:$AG_BASE \
|
||||
--cluster.my-address $TRANSPORT://$LOCALHOST:$PORT \
|
||||
--server.endpoint $TRANSPORT://$ANY:$PORT \
|
||||
--cluster.my-role $ROLE \
|
||||
--log.file cluster/$PORT.log \
|
||||
--log.level $LOG_LEVEL \
|
||||
|
@ -230,9 +233,9 @@ startRR() {
|
|||
$XTERM $XTERMOPTIONS -e "rr ${BUILD}/bin/arangod \
|
||||
-c none \
|
||||
--database.directory cluster/data$PORT \
|
||||
--cluster.agency-endpoint $TRANSPORT://127.0.0.1:$AG_BASE \
|
||||
--cluster.my-address $TRANSPORT://127.0.0.1:$PORT \
|
||||
--server.endpoint $TRANSPORT://0.0.0.0:$PORT \
|
||||
--cluster.agency-endpoint $TRANSPORT://$LOCALHOST:$AG_BASE \
|
||||
--cluster.my-address $TRANSPORT://$LOCALHOST:$PORT \
|
||||
--server.endpoint $TRANSPORT://$ANY:$PORT \
|
||||
--cluster.my-role $ROLE \
|
||||
--log.file cluster/$PORT.log \
|
||||
--log.level $LOG_LEVEL \
|
||||
|
@ -285,9 +288,9 @@ testServer() {
|
|||
PORT=$1
|
||||
while true ; do
|
||||
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
|
||||
${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
|
||||
if [ "$?" != "0" ] ; then
|
||||
echo Server on port $PORT does not answer yet.
|
||||
|
@ -318,16 +321,16 @@ if [ "$SECONDARIES" == "1" ] ; then
|
|||
|
||||
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
|
||||
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
|
||||
${BUILD}/bin/arangod \
|
||||
-c none \
|
||||
--database.directory cluster/data$PORT \
|
||||
--cluster.agency-endpoint $TRANSPORT://127.0.0.1:$AG_BASE \
|
||||
--cluster.my-address $TRANSPORT://127.0.0.1:$PORT \
|
||||
--server.endpoint $TRANSPORT://0.0.0.0:$PORT \
|
||||
--cluster.agency-endpoint $TRANSPORT://$LOCALHOST:$AG_BASE \
|
||||
--cluster.my-address $TRANSPORT://$LOCALHOST:$PORT \
|
||||
--server.endpoint $TRANSPORT://$ANY:$PORT \
|
||||
--cluster.my-id $CLUSTER_ID \
|
||||
--log.file cluster/$PORT.log \
|
||||
--server.statistics true \
|
||||
|
@ -347,7 +350,7 @@ fi
|
|||
echo Done, your cluster is ready at
|
||||
if [ "$NRCOORDINATORS" -gt 0 ] ; then
|
||||
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
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in New Issue