File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -402,6 +402,10 @@ function quiet_install_mariadb() {
402402# 交互式安装Redis #
403403# ###################################
404404function interactive_install_redis() {
405+ if [ " $USE_EXTERNAL_REDIS " == " true" ]; then
406+ LOG_INFO " Use external redis, host: $REDIS_HOST , port: $REDIS_PORT "
407+ return 0
408+ fi
405409 ret=$( check_redis )
406410 if [ " $ret " == " true" ]; then
407411 return 0
@@ -448,6 +452,10 @@ function interactive_install_mariadb() {
448452 esac
449453 fi
450454
455+ if [ " $USE_EXTERNAL_MYSQL " == " true" ]; then
456+ LOG_INFO " Use external mysql, host: $MYSQL_HOST , port: $MYSQL_PORT "
457+ return 0
458+ fi
451459 ret=$( check_mysqld )
452460 if [ " $ret " == " true" ]; then
453461 return 0
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ CURRENT_SCRIPT_PATH=$( cd " $( dirname " ${BASH_SOURCE[0]} " ) " ; pwd)
4+ TCA_SCRIPT_ROOT=${TCA_SCRIPT_ROOT:- " $( cd $( dirname $CURRENT_SCRIPT_PATH ) ; pwd) " }
5+ TCA_PROJECT_PATH=${TCA_PROJECT_PATH:- " $( cd " $( dirname $TCA_SCRIPT_ROOT ) " ; pwd) " }
6+
7+
8+ source $TCA_SCRIPT_ROOT /utils.sh
9+
10+ function check_result() {
11+ name=$1
12+ ret=$2
13+ if [ " $ret " = " true" ]; then
14+ LOG_INFO " $name start: OK."
15+ return 0
16+ else
17+ LOG_ERROR " $name start: Failed."
18+ return 1
19+ fi
20+ }
21+
22+ function check_client_running() {
23+ client_result=$( check_target_process_exist " codepuppy" )
24+ if [ " $client_result " = " true" ]; then
25+ return 0
26+ else
27+ return 1
28+ fi
29+ }
30+
31+ function check_tca_client_status() {
32+ client_result=" "
33+ LOG_INFO " Check client start status..."
34+ check_client_running
35+ check_result " tca_client" " $client_result "
36+ }
Original file line number Diff line number Diff line change 11#! /bin/bash
22# -*-*-*- 需要关注的配置内容 -*-*-*-
33# 数据库配置,默认MySQL端口号为3306
4+ export USE_EXTERNAL_MYSQL=${USE_EXTERNAL_MYSQL:- false}
45export MYSQL_HOST=${MYSQL_HOST:- 127.0.0.1}
56export MYSQL_PORT=${MYSQL_PORT:- 3306}
67export MYSQL_USER=${MYSQL_USER:- tca}
78export MYSQL_PASSWORD=${MYSQL_PASSWORD:- " TCA!@#2021" }
89
910# Redis配置,默认Redis端口号为6379
11+ export USE_EXTERNAL_REDIS=${USE_EXTERNAL_REDIS:- false}
1012export REDIS_HOST=${REDIS_HOST:- 127.0.0.1}
1113export REDIS_PORT=${REDIS_PORT:- 6379}
1214export REDIS_PASSWD=${REDIS_PASSWD:- " tca2022" }
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ source $TCA_SCRIPT_ROOT/server/start.sh
1616source $TCA_SCRIPT_ROOT /server/stop.sh
1717source $TCA_SCRIPT_ROOT /server/healthcheck.sh
1818source $TCA_SCRIPT_ROOT /client/init.sh
19+ source $TCA_SCRIPT_ROOT /client/check.sh
1920source $TCA_SCRIPT_ROOT /client/start.sh
2021source $TCA_SCRIPT_ROOT /client/stop.sh
2122
@@ -170,6 +171,7 @@ function tca_local_main() {
170171 tca_local_start
171172 sleep 2
172173 check_tca_local_status
174+ check_tca_client_status
173175 ;;
174176 install)
175177 tca_local_install $service
@@ -182,6 +184,7 @@ function tca_local_main() {
182184 ;;
183185 check)
184186 check_tca_local_status
187+ check_tca_client_status
185188 ;;
186189 log)
187190 get_tca_local_log
You can’t perform that action at this time.
0 commit comments