blob: adf4fb201847137673316a92362174e6c59c5803 [file] [log] [blame]
Jordan Halterman00e92da2018-05-22 23:05:52 -07001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Remotely configures & starts Atomix for the first time.
4# -----------------------------------------------------------------------------
5
6function _usage () {
7cat << _EOF_
8usage:
9 $(basename $0) [node]
10
11options:
12- [node] : The node to configure
13
14summary:
15 Remotely configures and starts Atomix for the first time.
16
17 The procedure for configuring a node includes determining base features,
18 applications to load at startup, and clustering and logical network view
19 configurations, among others.
20
21 If [node] isn't specified, the default target becomes \$OCI.
22
23_EOF_
24}
25
26[ "$1" = "-h" ] && _usage && exit 0
27
28[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
29. $ONOS_ROOT/tools/build/envDefaults
30
31node=${1:-$OCI}
DongRyeol Cha2803d302019-03-11 15:48:48 +090032remote=$ONOS_USER@[$node]
Jordan Halterman00e92da2018-05-22 23:05:52 -070033
34# Generate a default cluster.json from the ON* environment variables
35CDEF_FILE=/tmp/${remote}.atomix.json
36atomix-gen-config $node $CDEF_FILE
37scp -q $CDEF_FILE $remote:$ATOMIX_INSTALL_DIR/atomix.json
38
Jordan Haltermana0c5dc12018-11-12 11:04:46 -080039LOGBACK_FILE="$ONOS_ROOT"/tools/test/configs/atomix/logback.xml
40scp -q $LOGBACK_FILE $remote:/opt/atomix/conf/logback.xml