-
Notifications
You must be signed in to change notification settings - Fork 8
/
stop.yml
159 lines (146 loc) · 3.4 KB
/
stop.yml
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
---
- name: stop tis
vars_files:
- vars.yml
hosts: tis-console,assemble
tasks:
- command: ./tis stop -p 8080
become: yes
become_user: tis
ignore_errors: yes
args:
chdir: "/opt/app/spring-boot/bin"
tags:
- tjs
#- name: stop solr
# vars_files:
# - vars.yml
# hosts: solr
# tasks:
# - command: ./solr stop -p 8080
# become: yes
# become_user: solr
# ignore_errors: yes
# args:
# chdir: "/opt/app/spring-boot/solr"
- name: stop hive metastore
vars_files:
- vars.yml
hosts: hadoop-hdfs-namenode
tasks:
- name: "stop HiveMetaStore"
shell: |
is_exist() {
pid=`ps -ef|grep HiveMetaStore|grep -v grep|awk '{print $2}' `
if [ -z "${pid}" ]; then
return 0
else
return 1
fi
}
# is_exist
pidf=$(cat ./metastore.pid)
# echo "$pidf"
echo "pid = $pidf begin kill $pidf"
kill $pidf
rm -f ./metastore.pid
sleep 2
is_exist
if [ $? -eq "1" ]; then
echo "pid = $pid begin kill -9 $pid"
kill -9 $pid
sleep 2
echo "hive metastore process stopped!" >> metastore.log
else
echo "hive metastore is not running!" >> metastore.log
fi
become: yes
become_user: "{{hadoop_user}}"
ignore_errors: yes
args:
chdir: "/opt/app/hive"
- name: "stop hiveServer2"
shell: |
is_exist() {
pid=`ps -ef|grep HiveServer2|grep -v grep|awk '{print $2}' `
if [ -z "${pid}" ]; then
return 0
else
return 1
fi
}
# is_exist
pidf=$(cat ./hiveserver2.pid)
# echo "$pidf"
echo "pid = $pidf begin kill $pidf"
kill $pidf
rm -f ./hiveserver2.pid
sleep 2
is_exist
if [ $? -eq "1" ]; then
echo "pid = $pid begin kill -9 $pid"
kill -9 $pid
sleep 2
echo "hive HiverServer2 process stopped!" >> hiveserver2.log
else
echo "hive HiverServer2 is not running!" >> hiveserver2.log
fi
become: yes
become_user: "{{hadoop_user}}"
ignore_errors: yes
args:
chdir: "/opt/app/hive"
tags:
- hive
- name: stop thriftserver
vars_files:
- vars.yml
hosts: hadoop-yarn-resource-manager
tasks:
- command: ./stop-thriftserver.sh
become: yes
become_user: hadoop
ignore_errors: yes
args:
chdir: "/opt/app/spark/sbin"
when: need_install_spark and need_install_spark_shuffle
tags:
- tserver
- name: stop yarn
vars_files:
- vars.yml
hosts: hadoop-yarn-resource-manager
tasks:
- command: ./stop-yarn.sh
become: yes
become_user: hadoop
ignore_errors: yes
args:
chdir: "/opt/app/hadoop/sbin"
tags:
- hadoop
- name: stop hdfs
vars_files:
- vars.yml
hosts: hadoop-hdfs-namenode
tasks:
- command: ./stop-dfs.sh
become: yes
become_user: hadoop
ignore_errors: yes
args:
chdir: "/opt/app/hadoop/sbin"
tags:
- hadoop
- name: stop zookeeper
vars_files:
- vars.yml
hosts: zookeeper
tasks:
- command: ./zkServer.sh stop
become: yes
become_user: zookeeper
ignore_errors: yes
args:
chdir: "{{zk_install_dir}}/bin"
- service: name=crond state=stopped