diff --git a/script/docker_check_service.sh b/script/docker_check_service.sh index c987f3d8b..c65d38d7f 100644 --- a/script/docker_check_service.sh +++ b/script/docker_check_service.sh @@ -1,33 +1,10 @@ #!/usr/bin/env bash +echo "docker-compose ps....................." +docker-compose ps -source ./style_info.cfg +sleep 10 -docker_compose_components=( - etcd - mongo - mysql - open_im_server - redis - kafka - zookeeper -) +echo "check OpenIM.........................." +./check_all.sh -component_server_count=0 -for ((i = 0; i < ${#docker_compose_components[*]}; i++)); do - component_server="docker-compose ps|grep -w ${docker_compose_components[$i]}|grep Up" - count="${component_server}|wc -l" - - if [ $(eval ${count}) -gt 0 ]; then - echo -e "${SKY_BLUE_PREFIX}docker-compose ${docker_compose_components[$i]} is Up!${COLOR_SUFFIX}" - let component_server_count+=1 - else - echo -e "${RED_PREFIX} ${docker_compose_components[$i]} start failed!${COLOR_SUFFIX}" - fi -done - -if [ ${component_server_count} -eq 7 ]; then - echo -e "${YELLOW_PREFIX}\ndocker-compose all services is Up!${COLOR_SUFFIX}" -else - echo -e "${RED_PREFIX}\nsome docker-compose services start failed,please check red logs on console ${COLOR_SUFFIX}" -fi diff --git a/script/docker_start_all.sh b/script/docker_start_all.sh index 5c81305c3..09f0d162b 100644 --- a/script/docker_start_all.sh +++ b/script/docker_start_all.sh @@ -14,6 +14,7 @@ need_to_start_server_shell=( ) #fixme The 10 second delay to start the project is for the docker-compose one-click to start openIM when the infrastructure dependencies are not started + sleep 10 for i in ${need_to_start_server_shell[*]}; do diff --git a/script/env_check.sh b/script/env_check.sh new file mode 100644 index 000000000..6af30a37b --- /dev/null +++ b/script/env_check.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +source ./style_info.cfg +echo -e "check environment......................................." + +SYSTEM=`uname -s` +if [ $SYSTEM != "Linux" ] ; then + echo -e ${RED_PREFIX}"Warning: Currently only Linux is supported"${COLOR_SUFFIX} +else + echo -e ${GREEN_PREFIX} "Linux system is ok"${COLOR_SUFFIX} +fi + +echo -e "check memory............................................" +available=`free -m | grep Mem | awk '{print $NF}'` +if [ $available -lt 2000 ] ; then + echo -e ${RED_PREFIX}"Warning: Your memory not enough, available is: " "$available"m${COLOR_SUFFIX}"\c" + echo -e ${RED_PREFIX}", must be greater than 2000m"${COLOR_SUFFIX} +else + echo -e ${GREEN_PREFIX} "Memory is ok, available is: "$available"m${COLOR_SUFFIX}" +fi +