提交 c0e71c28 编写于 作者: Z zyyang

change

上级 0be244b5
[Unit]
Description=ProDB server service
After=network-online.target taosadapter.service
Wants=network-online.target taosadapter.service
[Service]
Type=simple
ExecStart=/usr/bin/prodbs
ExecStartPre=/usr/local/ProDB/bin/startPre.sh
TimeoutStopSec=1000000s
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
TimeoutStartSec=0
StandardOutput=null
Restart=always
StartLimitBurst=3
StartLimitInterval=60s
[Install]
WantedBy=multi-user.target
#!/bin/bash #!/bin/bash
function replace_community_pro(){ function replace_community_pro() {
# cmake/install.inc # cmake/install.inc
sed -i "s/C:\/TDengine/C:\/ProDB/g" ${top_dir}/cmake/install.inc sed -i "s/C:\/TDengine/C:\/ProDB/g" ${top_dir}/cmake/install.inc
sed -i "s/taos\.cfg/prodb\.cfg/g" ${top_dir}/cmake/install.inc sed -i "s/taos\.cfg/prodb\.cfg/g" ${top_dir}/cmake/install.inc
...@@ -12,21 +12,21 @@ function replace_community_pro(){ ...@@ -12,21 +12,21 @@ function replace_community_pro(){
# src/inc/taosdef.h # src/inc/taosdef.h
sed -i "s/\"taosdata\"/\"prodb\"/g" ${top_dir}/src/inc/taosdef.h sed -i "s/\"taosdata\"/\"prodb\"/g" ${top_dir}/src/inc/taosdef.h
# src/util/src/tconfig.c # src/util/src/tconfig.c
sed -i "s/taos\.cfg/prodb\.cfg/g" ${top_dir}/src/util/src/tconfig.c sed -i "s/taos\.cfg/prodb\.cfg/g" ${top_dir}/src/util/src/tconfig.c
sed -i "s/etc\/taos/etc\/ProDB/g" ${top_dir}/src/util/src/tconfig.c sed -i "s/etc\/taos/etc\/ProDB/g" ${top_dir}/src/util/src/tconfig.c
# src/util/src/tlog.c # src/util/src/tlog.c
sed -i "s/log\/taos/log\/ProDB/g" ${top_dir}/src/util/src/tlog.c sed -i "s/log\/taos/log\/ProDB/g" ${top_dir}/src/util/src/tlog.c
# src/dnode/src/dnodeSystem.c # src/dnode/src/dnodeSystem.c
sed -i "s/TDengine/ProDB/g" ${top_dir}/src/dnode/src/dnodeSystem.c sed -i "s/TDengine/ProDB/g" ${top_dir}/src/dnode/src/dnodeSystem.c
sed -i "s/TDengine/ProDB/g" ${top_dir}/src/dnode/src/dnodeMain.c sed -i "s/TDengine/ProDB/g" ${top_dir}/src/dnode/src/dnodeMain.c
sed -i "s/taosdlog/prodlog/g" ${top_dir}/src/dnode/src/dnodeMain.c sed -i "s/taosdlog/prodlog/g" ${top_dir}/src/dnode/src/dnodeMain.c
# src/client/src/tscSystem.c # src/client/src/tscSystem.c
sed -i "s/taoslog/prolog/g" ${top_dir}/src/client/src/tscSystem.c sed -i "s/taoslog/prolog/g" ${top_dir}/src/client/src/tscSystem.c
# src/util/src/tnote.c # src/util/src/tnote.c
sed -i "s/taosinfo/proinfo/g" ${top_dir}/src/util/src/tnote.c sed -i "s/taosinfo/proinfo/g" ${top_dir}/src/util/src/tnote.c
# src/dnode/CMakeLists.txt # src/dnode/CMakeLists.txt
sed -i "s/taos\.cfg/prodb\.cfg/g" ${top_dir}/src/dnode/CMakeLists.txt sed -i "s/taos\.cfg/prodb\.cfg/g" ${top_dir}/src/dnode/CMakeLists.txt
echo "SET_TARGET_PROPERTIES(taosd PROPERTIES OUTPUT_NAME prodbs)" >> ${top_dir}/src/dnode/CMakeLists.txt echo "SET_TARGET_PROPERTIES(taosd PROPERTIES OUTPUT_NAME prodbs)" >>${top_dir}/src/dnode/CMakeLists.txt
# src/os/src/linux/linuxEnv.c # src/os/src/linux/linuxEnv.c
sed -i "s/etc\/taos/etc\/ProDB/g" ${top_dir}/src/os/src/linux/linuxEnv.c sed -i "s/etc\/taos/etc\/ProDB/g" ${top_dir}/src/os/src/linux/linuxEnv.c
sed -i "s/lib\/taos/lib\/ProDB/g" ${top_dir}/src/os/src/linux/linuxEnv.c sed -i "s/lib\/taos/lib\/ProDB/g" ${top_dir}/src/os/src/linux/linuxEnv.c
...@@ -53,14 +53,27 @@ function replace_community_pro(){ ...@@ -53,14 +53,27 @@ function replace_community_pro(){
sed -i "s/taosd is quiting/prodbs is quiting/g" ${top_dir}/src/plugins/monitor/src/monMain.c sed -i "s/taosd is quiting/prodbs is quiting/g" ${top_dir}/src/plugins/monitor/src/monMain.c
} }
function replace_enterprise_pro(){ function replace_enterprise_pro() {
# enterprise/src/kit/perfMonitor/perfMonitor.c # enterprise/src/kit/perfMonitor/perfMonitor.c
sed -i "s/\"taosdata\"/\"prodb\"/g" ${top_dir}/../enterprise/src/kit/perfMonitor/perfMonitor.c sed -i "s/\"taosdata\"/\"prodb\"/g" ${top_dir}/../enterprise/src/kit/perfMonitor/perfMonitor.c
sed -i "s/TDengine/ProDB/g" ${top_dir}/../enterprise/src/kit/perfMonitor/perfMonitor.c sed -i "s/TDengine/ProDB/g" ${top_dir}/../enterprise/src/kit/perfMonitor/perfMonitor.c
# enterprise/src/plugins/admin/src/httpAdminHandle.c # enterprise/src/plugins/admin/src/httpAdminHandle.c
sed -i "s/taos\.cfg/prodb\.cfg/g" ${top_dir}/../enterprise/src/plugins/admin/src/httpAdminHandle.c sed -i "s/taos\.cfg/prodb\.cfg/g" ${top_dir}/../enterprise/src/plugins/admin/src/httpAdminHandle.c
# enterprise/src/plugins/grant/src/grantMain.c # enterprise/src/plugins/grant/src/grantMain.c
sed -i "s/taos\.cfg/prodb\.cfg/g" ${top_dir}/../enterprise/src/plugins/grant/src/grantMain.c sed -i "s/taos\.cfg/prodb\.cfg/g" ${top_dir}/../enterprise/src/plugins/grant/src/grantMain.c
# enterprise/src/plugins/module/src/moduleMain.c # enterprise/src/plugins/module/src/moduleMain.c
sed -i "s/taos\.cfg/prodb\.cfg/g" ${top_dir}/../enterprise/src/plugins/module/src/moduleMain.c sed -i "s/taos\.cfg/prodb\.cfg/g" ${top_dir}/../enterprise/src/plugins/module/src/moduleMain.c
# enterprise/src/plugins/web
sed -i -e 's/www.taosdata.com/www.hanatech.com.cn/g' $(grep -r 'www.taosdata.com' ${top_dir}/../enterprise/src/plugins/web | sed -r "s/(.*\.html):\s*(.*)/\1/g")
sed -i -e 's/TAOS Data/Hanatech/g' $(grep -r 'TAOS Data' ${top_dir}/../enterprise/src/plugins/web | sed -r "s/(.*\.html):\s*(.*)/\1/g")
sed -i -e 's/taosd/prodbs/g' $(grep -r 'taosd' ${top_dir}/../enterprise/src/plugins/web | grep -E '*\.js\s*.*' | sed -r -e 's/(.*\.js):\s*(.*)/\1/g' | sort | uniq)
# enterprise/src/plugins/web/admin/monitor.html
sed -i -e 's/<th style="font-weight: normal">taosd<\/th>/<th style="font-weight: normal">prodbs<\/th>/g' ${top_dir}/../enterprise/src/plugins/web/admin/monitor.html
sed -i -e "s/data:\['taosd', 'system'\],/data:\['prodbs', 'system'\],/g" ${top_dir}/../enterprise/src/plugins/web/admin/monitor.html
sed -i -e "s/name: 'taosd',/name: 'prodbs',/g" ${top_dir}/../enterprise/src/plugins/web/admin/monitor.html
# enterprise/src/plugins/web/admin/*.html
sed -i "s/TDengine/ProDB/g" ${top_dir}/../enterprise/src/plugins/web/admin/*.html
# enterprise/src/plugins/web/admin/js/*.js
sed -i "s/TDengine/ProDB/g" ${top_dir}/../enterprise/src/plugins/web/admin/js/*.js
} }
#!/bin/bash #!/bin/bash
# #
# Generate tar.gz package for all os system # Generate tar.gz package for all os system
source ./sed_replace.sh
set -e set -e
#set -x #set -x
...@@ -27,16 +28,40 @@ release_dir="${top_dir}/release" ...@@ -27,16 +28,40 @@ release_dir="${top_dir}/release"
if [ $dbName == "power" ]; then if [ $dbName == "power" ]; then
productName="PowerDB" productName="PowerDB"
serverName="powerd"
clientName="power"
cfgDirName="power.cfg"
tarName="power.tar.gz"
elif [ $dbName == "tq" ]; then elif [ $dbName == "tq" ]; then
productName="TQ" productName="TQ"
serverName="tqd"
clientName="tq"
cfgDirName="tq.cfg"
tarName="tq.tar.gz"
elif [ $dbName == "pro" ]; then elif [ $dbName == "pro" ]; then
productName="ProDB" productName="ProDB"
serverName="prodbs"
clientName="prodbc"
cfgDirName="prodb.cfg"
tarName="prodb.tar.gz"
elif [ $dbName == "kh" ]; then elif [ $dbName == "kh" ]; then
productName="KingHistorian" productName="KingHistorian"
serverName="khserver"
clientName="khclient"
cfgDirName="kinghistorian.cfg"
tarName="kinghistorian.tar.gz"
elif [ $dbName == "jh" ]; then elif [ $dbName == "jh" ]; then
productName="jh_iot" productName="jh_iot"
serverName="jh_taosd"
clientName="jh_taos"
cfgDirName="jh_taos.cfg"
tarName="jh_taos.tar.gz"
else else
productName="TDengine" productName="TDengine"
serverName="taosd"
clientName="taos"
cfgDirName="taos.cfg"
tarName="taos.tar.gz"
fi fi
#package_name='linux' #package_name='linux'
...@@ -60,14 +85,14 @@ fi ...@@ -60,14 +85,14 @@ fi
# Directories and files # Directories and files
if [ "$pagMode" == "lite" ]; then if [ "$pagMode" == "lite" ]; then
strip ${build_dir}/bin/taosd strip ${build_dir}/bin/${serverName}
strip ${build_dir}/bin/taos strip ${build_dir}/bin/taos
# lite version doesn't include taosadapter, which will lead to no restful interface # lite version doesn't include taosadapter, which will lead to no restful interface
bin_files="${build_dir}/bin/taosd ${build_dir}/bin/taos ${script_dir}/remove.sh ${script_dir}/startPre.sh" bin_files="${build_dir}/bin/${serverName} ${build_dir}/bin/${clientName} ${script_dir}/remove.sh ${script_dir}/startPre.sh"
taostools_bin_files="" taostools_bin_files=""
else else
bin_files="${build_dir}/bin/taosd \ bin_files="${build_dir}/bin/${serverName} \
${build_dir}/bin/taos \ ${build_dir}/bin/${clientName} \
${build_dir}/bin/taosadapter \ ${build_dir}/bin/taosadapter \
${build_dir}/bin/tarbitrator\ ${build_dir}/bin/tarbitrator\
${script_dir}/remove.sh \ ${script_dir}/remove.sh \
...@@ -91,22 +116,15 @@ fi ...@@ -91,22 +116,15 @@ fi
install_files="${script_dir}/install.sh" install_files="${script_dir}/install.sh"
nginx_dir="${code_dir}/../../enterprise/src/plugins/web" nginx_dir="${code_dir}/../../enterprise/src/plugins/web"
# Init file init_file_deb=${script_dir}/../deb/${serverName}
#init_dir=${script_dir}/deb init_file_rpm=${script_dir}/../rpm/${serverName}
#if [ $package_type = "centos" ]; then
# init_dir=${script_dir}/rpm
#fi
#init_files=${init_dir}/taosd
# temp use rpm's taosd. TODO: later modify according to os type
init_file_deb=${script_dir}/../deb/taosd
init_file_rpm=${script_dir}/../rpm/taosd
init_file_tarbitrator_deb=${script_dir}/../deb/tarbitratord init_file_tarbitrator_deb=${script_dir}/../deb/tarbitratord
init_file_tarbitrator_rpm=${script_dir}/../rpm/tarbitratord init_file_tarbitrator_rpm=${script_dir}/../rpm/tarbitratord
# make directories. # make directories.
mkdir -p ${install_dir} mkdir -p ${install_dir}
mkdir -p ${install_dir}/inc && cp ${header_files} ${install_dir}/inc mkdir -p ${install_dir}/inc && cp ${header_files} ${install_dir}/inc
mkdir -p ${install_dir}/cfg && cp ${cfg_dir}/taos.cfg ${install_dir}/cfg/taos.cfg mkdir -p ${install_dir}/cfg && cp ${cfg_dir}/${cfgDirName} ${install_dir}/cfg/${cfgDirName}
if [ -f "${compile_dir}/test/cfg/taosadapter.toml" ]; then if [ -f "${compile_dir}/test/cfg/taosadapter.toml" ]; then
cp ${compile_dir}/test/cfg/taosadapter.toml ${install_dir}/cfg || : cp ${compile_dir}/test/cfg/taosadapter.toml ${install_dir}/cfg || :
...@@ -116,8 +134,8 @@ if [ -f "${compile_dir}/test/cfg/taosadapter.service" ]; then ...@@ -116,8 +134,8 @@ if [ -f "${compile_dir}/test/cfg/taosadapter.service" ]; then
cp ${compile_dir}/test/cfg/taosadapter.service ${install_dir}/cfg || : cp ${compile_dir}/test/cfg/taosadapter.service ${install_dir}/cfg || :
fi fi
if [ -f "${cfg_dir}/taosd.service" ]; then if [ -f "${cfg_dir}/${serverName}.service" ]; then
cp ${cfg_dir}/taosd.service ${install_dir}/cfg || : cp ${cfg_dir}/${serverName}.service ${install_dir}/cfg || :
fi fi
if [ -f "${cfg_dir}/tarbitratord.service" ]; then if [ -f "${cfg_dir}/tarbitratord.service" ]; then
...@@ -129,8 +147,8 @@ if [ -f "${cfg_dir}/nginxd.service" ]; then ...@@ -129,8 +147,8 @@ if [ -f "${cfg_dir}/nginxd.service" ]; then
fi fi
mkdir -p ${install_dir}/bin && cp ${bin_files} ${install_dir}/bin && chmod a+x ${install_dir}/bin/* || : mkdir -p ${install_dir}/bin && cp ${bin_files} ${install_dir}/bin && chmod a+x ${install_dir}/bin/* || :
mkdir -p ${install_dir}/init.d && cp ${init_file_deb} ${install_dir}/init.d/taosd.deb mkdir -p ${install_dir}/init.d && cp ${init_file_deb} ${install_dir}/init.d/${serverName}.deb
mkdir -p ${install_dir}/init.d && cp ${init_file_rpm} ${install_dir}/init.d/taosd.rpm mkdir -p ${install_dir}/init.d && cp ${init_file_rpm} ${install_dir}/init.d/${serverName}.rpm
mkdir -p ${install_dir}/init.d && cp ${init_file_tarbitrator_deb} ${install_dir}/init.d/tarbitratord.deb || : mkdir -p ${install_dir}/init.d && cp ${init_file_tarbitrator_deb} ${install_dir}/init.d/tarbitratord.deb || :
mkdir -p ${install_dir}/init.d && cp ${init_file_tarbitrator_rpm} ${install_dir}/init.d/tarbitratord.rpm || : mkdir -p ${install_dir}/init.d && cp ${init_file_tarbitrator_rpm} ${install_dir}/init.d/tarbitratord.rpm || :
...@@ -209,10 +227,10 @@ if [ "$verMode" == "cluster" ]; then ...@@ -209,10 +227,10 @@ if [ "$verMode" == "cluster" ]; then
fi fi
cd ${install_dir} cd ${install_dir}
tar -zcv -f taos.tar.gz * --remove-files || : tar -zcv -f ${tarName} * --remove-files || :
exitcode=$? exitcode=$?
if [ "$exitcode" != "0" ]; then if [ "$exitcode" != "0" ]; then
echo "tar taos.tar.gz error !!!" echo "tar ${tarName} error !!!"
exit $exitcode exit $exitcode
fi fi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册