github.com/polarismesh/polaris@v1.17.8/release/standalone/prometheus-help.sh (about) 1 #!/bin/bash 2 3 if [ $# -lt 1 ]; then 4 echo "$0 start port|stop" 5 exit 0 6 fi 7 8 command=$1 9 10 if [ ${command} == "start" ]; then 11 prometheus_port=$2 12 if [ "${prometheus_port}w" == "w" ]; then 13 prometheus_port="9090" 14 fi 15 16 nohup ./polaris-prometheus --web.enable-lifecycle --web.enable-admin-api --web.listen-address=:${prometheus_port} >>prometheus.out 2>&1 & 17 fi 18 19 if [ ${command} == "stop" ]; then 20 pid=$(ps -ef | grep polaris-prometheus | grep -v grep | awk '{print $2}') 21 if [ "${pid}" != "" ]; then 22 echo -e "start to kill polaris-prometheus process ${pid}" 23 kill -9 ${pid} 24 else 25 echo "not found running polaris-prometheus" 26 fi 27 fi