Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
P
Privatisation_Deploy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
tianye
Privatisation_Deploy
Commits
27964a27
Commit
27964a27
authored
Mar 08, 2022
by
tianye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
封装hcctl 和细节优化
parent
c4c95740
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
11 deletions
+47
-11
hcctl
Deploy-search-center/hcctl
+29
-7
install.sh
Deploy-search-center/install.sh
+18
-4
No files found.
Deploy-search-center/
ms
ctl
→
Deploy-search-center/
hc
ctl
View file @
27964a27
#!/bin/bash
source
./install.ini
source
./install.sh
action
=
$1
target
=
$2
sc_dir
=
${
sc_dir
:-
/home/tianye/search-center
}
source
${
sc_dir
}
/install.ini
COMPOSE_FILE
=
$(
cat
${
sc_dir
}
/compose_files
)
COMPOSE_FILE
=
$(
cat
${
sc_dir
}
/compose_files 2>/dev/null
||
echo
""
)
#修改es连接信息(默认-->外部)
edit_es_info
(){
...
...
@@ -31,6 +29,22 @@ edit_mq_info(){
-e
"s#port: 5672#port:
${
MQ_PORT
}
#g"
\
-e
"s#virtual-host: /#virtual-host:
${
MQ_VHOST
}
#g"
${
APP_CONF_DIR
}
/application.yml
}
function
usage
()
{
echo
"Health-Cloud 控制脚本"
echo
echo
"Usage: "
echo
" ./hcctl.sh [COMMAND] [ARGS...]"
echo
" ./hcctl.sh --help"
echo
echo
"Commands: "
echo
" status 查看 Health-Cloud 服务运行状态"
echo
" start 启动 Health-Cloud 服务"
echo
" stop 停止 Health-Cloud 服务"
echo
" restart 重启 Health-Cloud 服务"
echo
" uninstall 卸载 Health-Cloud 服务"
}
#docker-compose的基础配置
install_compose-files
(){
...
...
@@ -55,6 +69,10 @@ install_compose-files(){
sleep
2
break
;;
exit
)
echo
"Good Bye!"
exit
0
;;
*
)
echo
"错误模式-请重新输入"
exit
127
...
...
@@ -149,6 +167,12 @@ function main(){
uninstall
)
uninstall
;;
--help
)
usage
;;
-h
)
usage
;;
install_compose-files
)
install_compose-files
;;
...
...
@@ -161,5 +185,3 @@ function main(){
}
main
$@
Deploy-search-center/install.sh
View file @
27964a27
#!/bin/bash
#set -e
source
./install.ini
DEPLOY_FILE
=
$(
dirname
$0
)
sc_dir
=
${
DEPLOY_DIR
}
/search-center
...
...
@@ -6,7 +7,11 @@ sc_dir=${DEPLOY_DIR}/search-center
#将docker-compose工程部署到本机
if
[
!
-d
${
sc_dir
}
]
;
then
cp
-rf
${
DEPLOY_FILE
}
/search_center
${
sc_dir
}
else
echo
"目标目录已安装search_center"
exit
127
fi
#将配置文件存入环境变量文件,使其全局生效
cp
./install.ini
${
sc_dir
}
/install.ini.example
env_context
=
$(
cat
${
sc_dir
}
/install.ini.example |grep
-v
"^#"
|grep
-v
"^$"
)
...
...
@@ -14,11 +19,14 @@ echo "${env_context}">${sc_dir}/.env
source
${
sc_dir
}
/.env
ln
-s
${
sc_dir
}
/.env
${
sc_dir
}
/install.ini 2>/dev/null
#安装msctl管理命令
cp
msctl /usr/local/bin
&&
chmod
+x /usr/local/bin/msctl
ln
-s
/usr/local/bin/msctl /usr/bin/msctl 2>/dev/null
#安装hcrc版本文件
echo
"search-center版本
${
SC_IMAGE_VERSION
}
"
>
~/.hcrc 2>/dev/null
||
echo
""
#安装hcctl管理命令
sudo cp
hcctl /usr/local/bin
&&
sudo chmod
+x /usr/local/bin/hcctl
ln
-s
/usr/local/bin/hcctl /usr/bin/hcctl 2>/dev/null
cd
${
sc_dir
}
#--------------------部署-----------------------#
echo
-e
"----------安装向导------------"
echo
-e
"- all模式-->全部安装(主服务seatch-center+数据库+队列)"
...
...
@@ -26,10 +34,16 @@ echo -e "- server模式-->只安装主服务search-center(请注意提前修改i
echo
-e
"- controller模式-->安装主服务search-center+数据库 or 队列"
echo
-e
"------------------------------"
PS3
=
'请选择安装模式: '
msctl install_compose-files
hcctl install_compose-files
if
[
$?
-ne
0
]
;
then
echo
"安装过程出现错误,请查看相关配置..."
exit
127
fi
echo
"search-center 服务已安装成功..."
sleep
2
echo
-e
"服务启动状态: "
sleep
2
sudo
/usr/local/bin/hcctl status
sleep
2
echo
"Good Bye ~"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment