@@ -210,3 +210,140 @@ uninstall_mysql(){
210210 esac
211211}
212212uninstall_mysql
213+
214+
215+
216+
217+ # 卸载 elasticsearch
218+ uninstall_elasticsearch (){
219+
220+ echo -e " $YELLOW "
221+ read -p " Please Choose Uninstall elasticsearch or Not! ( y,Y/n,N )" uninstall_elasticsearch
222+ case $uninstall_elasticsearch in
223+ y|Y)
224+ if [ -d $elasticsearch_install_dir ]; then # 确认该目录是否存在
225+
226+ ps aux | grep elasticsearch | grep -v grep | awk ' { print $2 }' | xargs kill -9
227+
228+ # 删除 /data/xxx data/logs/xxx /usr/local/xxx
229+ rm -rf /data/elasticsearch /data/logs/elasticsearch /usr/local/elasticsearch
230+
231+ echo " Uninstall elasticsearch successful!"
232+ else
233+ echo
234+ echo -e " No elasticsearch Server installed in your system!!"
235+ fi
236+ ;;
237+ n|N)
238+ echo
239+ echo " You select not uninstall elasticsearch!"
240+ ;;
241+ * )
242+ echo
243+ echo " Input error to uninstall elasticsearch!!! "
244+ ;;
245+ esac
246+ }
247+ uninstall_elasticsearch
248+
249+
250+ # 卸载 kibana
251+ uninstall_kibana (){
252+
253+ echo -e " $YELLOW "
254+ read -p " Please Choose Uninstall kibana or Not! ( y,Y/n,N )" uninstall_kibana
255+ case $uninstall_kibana in
256+ y|Y)
257+ if [ -d $kibana_install_dir ]; then # 确认该目录是否存在
258+
259+ ps aux | grep kibana | grep -v grep | awk ' { print $2 }' | xargs kill -9
260+
261+ # 删除 data/logs/xxx /usr/local/xxx
262+ rm -rf /data/logs/kibana /usr/local/kibana
263+
264+ echo " Uninstall kibana successful!"
265+ else
266+ echo
267+ echo -e " No kibana Server installed in your system!!"
268+ fi
269+ ;;
270+ n|N)
271+ echo
272+ echo " You select not uninstall kibana!"
273+ ;;
274+ * )
275+ echo
276+ echo " Input error to uninstall kibana!!! "
277+ ;;
278+ esac
279+ }
280+ uninstall_kibana
281+
282+
283+
284+ # 卸载 filebeat
285+ uninstall_filebeat (){
286+
287+ echo -e " $YELLOW "
288+ read -p " Please Choose Uninstall filebeat or Not! ( y,Y/n,N )" uninstall_filebeat
289+ case $uninstall_filebeat in
290+ y|Y)
291+ if [ -d $filebeat_install_dir ]; then # 确认该目录是否存在
292+
293+ ps aux | grep filebeat | grep -v grep | awk ' { print $2 }' | xargs kill -9
294+
295+ # 删除 data/logs/xxx /usr/local/xxx
296+ rm -rf /data/logs/filebeat /usr/local/filebeat
297+
298+ echo " Uninstall filebeat successful!"
299+ else
300+ echo
301+ echo -e " No filebeat Server installed in your system!!"
302+ fi
303+ ;;
304+ n|N)
305+ echo
306+ echo " You select not uninstall filebeat!"
307+ ;;
308+ * )
309+ echo
310+ echo " Input error to uninstall filebeat!!! "
311+ ;;
312+ esac
313+ }
314+ uninstall_filebeat
315+
316+
317+ # 卸载 logstash
318+ uninstall_logstash (){
319+
320+ echo -e " $YELLOW "
321+ read -p " Please Choose Uninstall logstash or Not! ( y,Y/n,N )" uninstall_logstash
322+ case $uninstall_logstash in
323+ y|Y)
324+ if [ -d $logstash_install_dir ]; then # 确认该目录是否存在
325+
326+ ps aux | grep logstash | grep -v grep | awk ' { print $2 }' | xargs kill -9
327+
328+ # 删除 data/logs/xxx /usr/local/xxx
329+ rm -rf /data/logs/logstash /usr/local/logstash
330+
331+ echo " Uninstall logstash successful!"
332+ else
333+ echo
334+ echo -e " No logstash Server installed in your system!!"
335+ fi
336+ ;;
337+ n|N)
338+ echo
339+ echo " You select not uninstall logstash!"
340+ ;;
341+ * )
342+ echo
343+ echo " Input error to uninstall logstash!!! "
344+ ;;
345+ esac
346+ }
347+ uninstall_logstash
348+
349+
0 commit comments