Commit 9a206581 authored by 段孔乐's avatar 段孔乐

modify install script

parent a85d4d8c
......@@ -26,6 +26,10 @@ Filebeat 负责数据采集
bash start-and-init.sh
###默认地址
http://localhost:15601/app/discover
###日志查看
docker-compose logs --tail=100 elasticsearch
......
......@@ -60,11 +60,25 @@ function notHealth() {
fi
}
function checkELKRunning(){
if [ "$(docker ps | grep -c 'docker-elk' )" -lt 1 ]; then
red "==============="
red "ELK not running"
red "==============="
exit 1
fi
}
checkELKRunning
start=$(date +%s)
while notHealth; do
end=$(date +%s)
take=$((end - start))
take=$((100 - (end - start) ))
red "Kibana not ready yet, waiting... time: $take"
if [ "$take" -lt 0 ]; then
red "time out, please check ELK status"
exit 1
fi
sleep 1s
done
green "======================================="
......
......@@ -23,10 +23,16 @@ function checkAllPort() {
}
function start(){
docker-compose up -d
green "==============="
green "start succeed"
green "==============="
if docker-compose up -d; then
green "==============="
green "start succeed"
green "==============="
else
red "==============="
red "start failed"
red "==============="
exit 1
fi
}
function checkPS(){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment