Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 74 additions & 10 deletions bin/cloud-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,28 @@ function start_first_time {
function start_cloud {
# Check ports
check_ports

start_zk
start_kafka
start_hadoop
start_accumulo
start_hbase
}

function start_zk {
# start zk
echo "Starting zoo..."
(cd $CLOUD_HOME ; zkServer.sh start)
}

echo "Starting kafka..."
$KAFKA_HOME/bin/kafka-server-start.sh -daemon $KAFKA_HOME/config/server.properties

function start_kafka {
# start kafka
if [[ "$kafka_enable" -eq 1 ]]; then
echo "Starting kafka..."
$KAFKA_HOME/bin/kafka-server-start.sh -daemon $KAFKA_HOME/config/server.properties
fi
}

function start_hadoop {
# start hadoop
echo "Starting hadoop..."
hadoop-daemon.sh --config $HADOOP_CONF_DIR start namenode
Expand All @@ -211,13 +225,17 @@ function start_cloud {
# Wait for HDFS to exit safemode:
echo "Waiting for HDFS to exit safemode..."
hdfs dfsadmin -safemode wait
}

function start_accumulo {
if [[ "$acc_enable" -eq 1 ]]; then
# starting accumulo
echo "starting accumulo..."
$ACCUMULO_HOME/bin/start-all.sh
fi
}

function start_hbase {
if [[ "$hbase_enable" -eq 1 ]]; then
# start hbase
echo "starting hbase..."
Expand All @@ -231,26 +249,43 @@ function start_yarn {
}

function stop_cloud {
stop_kafka
stop_accumulo
stop_hbase
stop_hadoop
stop_zk
}

echo "Stopping kafka..."
$KAFKA_HOME/bin/kafka-server-stop.sh
function stop_kafka {
if [[ "$kafka_enable" -eq 1 ]]; then
echo "Stopping kafka..."
$KAFKA_HOME/bin/kafka-server-stop.sh
fi
}

function stop_accumulo {
if [[ "$acc_enable" -eq 1 ]]; then
echo "Stopping accumulo..."
$ACCUMULO_HOME/bin/stop-all.sh
fi
}

function stop_hbase {
if [[ "$hbase_enable" -eq 1 ]]; then
echo "Stopping hbase..."
${HBASE_HOME}/bin/stop-hbase.sh
fi

}

function stop_hadoop {
echo "Stopping yarn and dfs..."
stop_yarn
$HADOOP_HOME/sbin/hadoop-daemon.sh --config $HADOOP_CONF_DIR stop namenode
$HADOOP_HOME/sbin/hadoop-daemon.sh --config $HADOOP_CONF_DIR stop secondarynamenode
$HADOOP_HOME/sbin/hadoop-daemon.sh --config $HADOOP_CONF_DIR stop datanode

}

function stop_zk {
echo "Stopping zookeeper..."
$ZOOKEEPER_HOME/bin/zkServer.sh stop
}
Expand Down Expand Up @@ -283,10 +318,15 @@ function clear_data {
}

function show_help {
echo "Provide 1 command: (init|start|stop|reconfigure|reyarn|clean|help)"
echo "Single argument commands: (init|start|stop|reconfigure|reyarn|clean|help)"
echo "Other commands to stop/start individual services:"
echo " hadoop (start|stop)"
echo " accumulo (start|stop)"
echo " hbase (start|stop)"
echo " kafka (start|stop)"
}

if [ "$#" -ne 1 ]; then
if [ "$#" -eq 0 ]; then
show_help
exit 1
fi
Expand All @@ -305,6 +345,30 @@ elif [[ $1 == 'start' ]]; then
echo "Starting cloud..."
start_cloud
echo "Cloud Started"
elif [[ $1 == 'accumulo' ]]; then
if [[ $2 == 'start' ]]; then
start_accumulo
elif [[ $2 == 'stop' ]]; then
stop_accumulo
fi
elif [[ $1 == 'hadoop' ]]; then
if [[ $2 == 'start' ]]; then
start_hadoop
elif [[ $2 == 'stop' ]]; then
stop_hadoop
fi
elif [[ $1 == 'kafka' ]]; then
if [[ $2 == 'start' ]]; then
start_kafka
elif [[ $2 == 'stop' ]]; then
stop_kafka
fi
elif [[ $1 == 'hbase' ]]; then
if [[ $2 == 'start' ]]; then
start_hbase
elif [[ $2 == 'stop' ]]; then
stop_hbase
fi
elif [[ $1 == 'stop' ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To @jahhulbert-ccri 's suggestion, can we add a (admittedly redundant) "stop all" and "start all"?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As is you could type "all" if you want, wouldn't do anything different but it'd still work as expected. Aside from that, this param eval impl may need reworked if merged with the geoserver stuff.

echo "Stopping Cloud..."
stop_cloud
Expand Down
4 changes: 3 additions & 1 deletion conf/cloud-local.conf
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ if [[ -z "${CL_VERBOSE}" ]]; then
CL_VERBOSE=0
fi

# Enable accumulo or hbase - probably best not to run both but it might work
# Enable accumulo, hbase and/or kafka
# probably best not to run both accumulo and hbase but it might work
# 1 = enabled
# 0 = disabled
acc_enable=1
hbase_enable=0
kafka_enable=1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no perspective on this but it does seem odd that kafka is enabled by default.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1


# accumulo config
cl_acc_inst_name="local"
Expand Down