Added --no-metada-server option
Sometimes autodetection of metadata servers can stall on particular
network configuration. This option bypass it and force a cluster mode.
@@ -40,6 +40,7 @@ usage() {
echo " --passwd <password> administrator's password"
echo " --no-demo-app don't start the demo application"
echo " --force-private don't use public IP (needed for marketplace)"
+ echo " --no-metadata-server don't try to contact metadata servers"
echo
}
@@ -95,6 +96,11 @@ while [ $# -gt 0 ]; do
FORCE_PRIVATE="Y"
continue
fi
+ if [ "$1" = "--no-metadata-server" ]; then
+ shift
+ PROVIDER="CLUSTER"
+ continue
+ fi
usage
exit 1
done
@@ -110,6 +116,7 @@ fi
PUBLIC_IP=""
PRIVATE_IP=""
+if [ -z "${PROVIDER}" ]; then
if grep docker /proc/1/cgroup > /dev/null ; then
# We need to start sshd by hand.
/usr/sbin/sshd
@@ -142,6 +149,7 @@ else
PROVIDER="CLUSTER"
fi
fi
+fi
# Let's make sure we got the IPs to use in the configuration.
case "$PROVIDER" in
@@ -187,7 +195,9 @@ case "$PROVIDER" in
ADMIN_EMAIL="a@a.com"
ADMIN_PASSWD="$(cat /etc/hostname)"
;;
-* )
+"CLUSTER")
+ ADMIN_EMAIL="a@a.com"
+ ADMIN_PASSWD="appscale"
# Let's discover the device used for external communication.
DEFAULT_DEV="$($IP route list scope global | sed 's/.*dev \b\([A-Za-z0-9_]*\).*/\1/' | uniq)"
[ -z "$DEFAULT_DEV" ] && { echo "error: cannot detect the default route"; exit 1; }
@@ -196,6 +206,10 @@ case "$PROVIDER" in
# There is no private/public IPs in this configuration.
PRIVATE_IP="${PUBLIC_IP}"
;;
+* )
+ echo "Couldn't detect infrastructure ($PROVIDER)"
+ exit 1
+ ;;
esac
# Let's make sure we don't overwrite and existing AppScalefile.
