Skip to content

Instantly share code, notes, and snippets.

@aweiteka
Created January 9, 2014 17:09
Show Gist options
  • Save aweiteka/8337898 to your computer and use it in GitHub Desktop.
Save aweiteka/8337898 to your computer and use it in GitHub Desktop.
Wrapper script to install a distributed OpenShift Enterprise environment with 3 brokers and multiple node hosts.
#!/usr/bin/env bash
# install distributed OSE 2.0
# assumes subscribed RHEL OS, FQDN
# external DNS setup
usage() {
echo "Usage: ./`basename $0` <host_name> <broker|node|broker_replica>"
echo "Argument(s) missing: <host_name> such as 'broker1'"
echo " second arg is <host_role>, one of broker, node or broker_replica"
echo " broker_replica role should be run again on primary broker only"
exit
}
if [[ -z $1 || -z $2 ]] ; then
usage
fi
HOST=$1
ROLE=$2
LB_SERVER="broker"
BROKER_LIST="broker1.cloud.example.com,broker2.cloud.example.com,broker3.cloud.example.com"
case ${ROLE} in
broker)
export CONF_ACTIONS="do_all_actions,reboot_after"
export CONF_INSTALL_COMPONENTS="broker,activemq,datastore"
export CONF_BROKER_HOSTNAME="${HOST}"
;;
node)
export CONF_ACTIONS="do_all_actions,reboot_after"
export CONF_INSTALL_COMPONENTS="node"
export CONF_BROKER_HOSTNAME="${LB_SERVER}"
;;
broker_replica)
export CONF_ACTIONS="configure_datastore_add_replicants,configure_datastore_add_users"
export CONF_INSTALL_COMPONENTS="broker,activemq,datastore"
export CONF_BROKER_HOSTNAME="${HOST}"
;;
*)
usage
;;
esac
export CONF_INSTALL_METHOD="none"
export CONF_NODE_HOSTNAME="${HOST}"
export CONF_DOMAIN="cloud.example.com"
export CONF_NAMED_HOSTNAME="dns.cloud.example.com"
export CONF_NAMED_IP_ADDR=10.0.0.1
export CONF_BIND_KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
export CONF_KEEP_HOSTNAME="true"
export CONF_DATASTORE_HOSTNAME="${HOST}"
export CONF_DATASTORE_REPLICANTS="${BROKER_LIST}"
export CONF_ACTIVEMQ_HOSTNAME="${HOST}"
export CONF_ACTIVEMQ_REPLICANTS="${BROKER_LIST}"
export CONF_OPENSHIFT_USER1="user1"
export CONF_OPENSHIFT_PASSWORD1="FIXME"
export CONF_MONGODB_BROKER_USER="openshift"
export CONF_MONGODB_BROKER_PASSWORD="FIXME"
export CONF_MCOLLECTIVE_USER="mcollective"
export CONF_MCOLLECTIVE_PASSWORD="FIXME"
export CONF_ACTIVEMQ_ADMIN_PASSWORD="FIXME"
export CONF_ACTIVEMQ_AMQ_USER_PASSWORD="FIXME"
lokkit --service=dns
curl https://raw.github.com/openshift/openshift-extras/enterprise-2.0/enterprise/install-scripts/generic/openshift.sh -o /tmp/openshift.sh
chmod 755 /tmp/openshift.sh
/tmp/openshift.sh |& tee -a /tmp/openshift-deploy.log | stdbuf -oL -eL grep -i '^OpenShift:'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment