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

modify install script

parent a85d4d8c
...@@ -26,6 +26,10 @@ Filebeat 负责数据采集 ...@@ -26,6 +26,10 @@ Filebeat 负责数据采集
bash start-and-init.sh bash start-and-init.sh
###默认地址
http://localhost:15601/app/discover
###日志查看 ###日志查看
docker-compose logs --tail=100 elasticsearch docker-compose logs --tail=100 elasticsearch
......
...@@ -60,11 +60,25 @@ function notHealth() { ...@@ -60,11 +60,25 @@ function notHealth() {
fi 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) start=$(date +%s)
while notHealth; do while notHealth; do
end=$(date +%s) end=$(date +%s)
take=$((end - start)) take=$((100 - (end - start) ))
red "Kibana not ready yet, waiting... time: $take" 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 sleep 1s
done done
green "=======================================" green "======================================="
......
...@@ -23,10 +23,16 @@ function checkAllPort() { ...@@ -23,10 +23,16 @@ function checkAllPort() {
} }
function start(){ function start(){
docker-compose up -d if docker-compose up -d; then
green "===============" green "==============="
green "start succeed" green "start succeed"
green "===============" green "==============="
else
red "==============="
red "start failed"
red "==============="
exit 1
fi
} }
function checkPS(){ 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