| #!/bin/bash |
| # ----------------------------------------------------------------------------- |
| # Remotely configures & starts Atomix for the first time. |
| # ----------------------------------------------------------------------------- |
| |
| function _usage () { |
| cat << _EOF_ |
| usage: |
| $(basename $0) [node] |
| |
| options: |
| - [node] : The node to configure |
| |
| summary: |
| Remotely configures and starts Atomix for the first time. |
| |
| The procedure for configuring a node includes determining base features, |
| applications to load at startup, and clustering and logical network view |
| configurations, among others. |
| |
| If [node] isn't specified, the default target becomes \$OCI. |
| |
| _EOF_ |
| } |
| |
| [ "$1" = "-h" ] && _usage && exit 0 |
| |
| [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 |
| . $ONOS_ROOT/tools/build/envDefaults |
| |
| node=${1:-$OCI} |
| remote=$ONOS_USER@$node |
| |
| # Generate a default cluster.json from the ON* environment variables |
| CDEF_FILE=/tmp/${remote}.atomix.json |
| atomix-gen-config $node $CDEF_FILE |
| scp -q $CDEF_FILE $remote:$ATOMIX_INSTALL_DIR/atomix.json |
| |
| ssh -tt $ONOS_USER@$node " |
| sed -i -e $'s/<logger name=\"io.atomix\" level=\"INFO\" \/>/<logger name=\"io.atomix\" level=\"INFO\" \/>\\\n <logger name=\"io.atomix.protocols.raft\" level=\"DEBUG\" \/>/g' /opt/atomix/conf/logback.xml |
| " |