forked from vesoft-inc/nebula
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathservices.sh
executable file
·68 lines (55 loc) · 1.81 KB
/
services.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#! /bin/bash
# Copyright (c) 2019 vesoft inc. All rights reserved.
#
# This source code is licensed under Apache 2.0 License.
SCRIPT_PATH=$(cd "$(dirname "$0")";pwd)
if [ $# != 1 ]; then
echo "USAGE: $0 <start|stop|restart|status|kill>"
exit 1;
fi
if [ -z $NEBULA_HOME ]; then
echo "NEBULA_HOME is not setting, using /usr/local as default value"
NEBULA_HOME=/usr/local
fi
echo "Processing Meta Service ..."
if [ ! -f ${SCRIPT_PATH}"/meta.hosts" ]; then
echo "${SCRIPT_PATH}/metas not exist"
exit 0
fi
for host in `cat ${SCRIPT_PATH}/meta.hosts`
do
echo "start $host"
if [ $1 = "status" ]; then
ssh $host "${NEBULA_HOME}/scripts/nebula.service -c ${NEBULA_HOME}/etc/nebula-metad.conf $1 metad"
else
ssh $host "${NEBULA_HOME}/scripts/nebula.service -c ${NEBULA_HOME}/etc/nebula-metad.conf $1 metad > /dev/null 2>&1 &"
fi
done
echo "Processing Storage Service ..."
if [ ! -f ${SCRIPT_PATH}"/storage.hosts" ]; then
echo "${SCRIPT_PATH}/storage.hosts not exist"
exit 0
fi
for host in `cat ${SCRIPT_PATH}/storage.hosts`
do
echo "start $host"
if [ $1 = "status" ]; then
ssh $host "${NEBULA_HOME}/scripts/nebula.service -c ${NEBULA_HOME}/etc/nebula-storaged.conf $1 storaged"
else
ssh $host "${NEBULA_HOME}/scripts/nebula.service -c ${NEBULA_HOME}/etc/nebula-storaged.conf $1 storaged > /dev/null 2>&1 &"
fi
done
echo "Processing Graph Service ..."
if [ ! -f ${SCRIPT_PATH}"/graph.hosts" ]; then
echo "${SCRIPT_PATH}/graph.hosts not exist"
exit 0
fi
for host in `cat ${SCRIPT_PATH}/graph.hosts`
do
echo "start $host"
if [ $1 = "status" ]; then
ssh $host "${NEBULA_HOME}/scripts/nebula.service -c ${NEBULA_HOME}/etc/nebula-graphd.conf $1 graphd"
else
ssh $host "${NEBULA_HOME}/scripts/nebula.service -c ${NEBULA_HOME}/etc/nebula-graphd.conf $1 graphd > /dev/null 2>&1 &"
fi
done