add explorer
This commit is contained in:
parent
5df720910e
commit
6b5f461a75
|
@ -57,9 +57,9 @@ else
|
||||||
arch=$cpuType
|
arch=$cpuType
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "${top_dir}/../enterprise/packaging/build_taoskeeper.sh -r ${arch} -e taoskeeper"
|
echo "${top_dir}/../enterprise/packaging/build_taoskeeper.sh -r ${arch} -e taoskeeper -t ver-${tdengine_ver}"
|
||||||
echo "$top_dir=${top_dir}"
|
echo "$top_dir=${top_dir}"
|
||||||
taoskeeper_binary=`${top_dir}/../enterprise/packaging/build_taoskeeper.sh -r $arch -e taoskeeper`
|
taoskeeper_binary=`${top_dir}/../enterprise/packaging/build_taoskeeper.sh -r $arch -e taoskeeper -t ver-${tdengine_ver}`
|
||||||
echo "taoskeeper_binary: ${taoskeeper_binary}"
|
echo "taoskeeper_binary: ${taoskeeper_binary}"
|
||||||
|
|
||||||
# copy config files
|
# copy config files
|
||||||
|
@ -76,6 +76,13 @@ if [ -f "${compile_dir}/test/cfg/taosadapter.service" ]; then
|
||||||
cp ${compile_dir}/test/cfg/taosadapter.service ${pkg_dir}${install_home_path}/cfg || :
|
cp ${compile_dir}/test/cfg/taosadapter.service ${pkg_dir}${install_home_path}/cfg || :
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -f "%{_compiledir}/../../../explorer/target/taos-explorer.service" ]; then
|
||||||
|
cp %{_compiledir}/../../../explorer/target/taos-explorer.service ${pkg_dir}${install_home_path}/cfg || :
|
||||||
|
fi
|
||||||
|
if [ -f "%{_compiledir}/../../../explorer/server/example/explorer.toml" ]; then
|
||||||
|
cp %{_compiledir}/../../../explorer/server/example/explorer.toml ${pkg_dir}${install_home_path}/cfg || :
|
||||||
|
fi
|
||||||
|
|
||||||
cp ${taoskeeper_binary} ${pkg_dir}${install_home_path}/bin
|
cp ${taoskeeper_binary} ${pkg_dir}${install_home_path}/bin
|
||||||
#cp ${compile_dir}/../packaging/deb/taosd ${pkg_dir}${install_home_path}/init.d
|
#cp ${compile_dir}/../packaging/deb/taosd ${pkg_dir}${install_home_path}/init.d
|
||||||
cp ${compile_dir}/../packaging/tools/post.sh ${pkg_dir}${install_home_path}/script
|
cp ${compile_dir}/../packaging/tools/post.sh ${pkg_dir}${install_home_path}/script
|
||||||
|
@ -93,6 +100,10 @@ if [ -f "${compile_dir}/build/bin/taosadapter" ]; then
|
||||||
cp ${compile_dir}/build/bin/taosadapter ${pkg_dir}${install_home_path}/bin ||:
|
cp ${compile_dir}/build/bin/taosadapter ${pkg_dir}${install_home_path}/bin ||:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -f "${compile_dir}/../../../explorer/target/release/taos-explorer" ]; then
|
||||||
|
cp ${compile_dir}/../../../explorer/target/release/taos-explorer ${pkg_dir}${install_home_path}/bin ||:
|
||||||
|
fi
|
||||||
|
|
||||||
cp ${compile_dir}/build/bin/taos ${pkg_dir}${install_home_path}/bin
|
cp ${compile_dir}/build/bin/taos ${pkg_dir}${install_home_path}/bin
|
||||||
cp ${compile_dir}/build/lib/${libfile} ${pkg_dir}${install_home_path}/driver
|
cp ${compile_dir}/build/lib/${libfile} ${pkg_dir}${install_home_path}/driver
|
||||||
[ -f ${compile_dir}/build/lib/${wslibfile} ] && cp ${compile_dir}/build/lib/${wslibfile} ${pkg_dir}${install_home_path}/driver ||:
|
[ -f ${compile_dir}/build/lib/${wslibfile} ] && cp ${compile_dir}/build/lib/${wslibfile} ${pkg_dir}${install_home_path}/driver ||:
|
||||||
|
|
|
@ -72,6 +72,14 @@ if [ -f %{_compiledir}/../build-taoskeeper/taoskeeper.service ]; then
|
||||||
cp %{_compiledir}/../build-taoskeeper/taoskeeper.service %{buildroot}%{homepath}/cfg ||:
|
cp %{_compiledir}/../build-taoskeeper/taoskeeper.service %{buildroot}%{homepath}/cfg ||:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -f %{_compiledir}/../../../explorer/target/taos-explorer.service ]; then
|
||||||
|
cp %{_compiledir}/../../../explorer/target/taos-explorer.service %{buildroot}%{homepath}/cfg ||:
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f %{_compiledir}/../../../explorer/server/example/explorer.toml ]; then
|
||||||
|
cp %{_compiledir}/../../../explorer/server/example/explorer.toml %{buildroot}%{homepath}/cfg ||:
|
||||||
|
fi
|
||||||
|
|
||||||
#cp %{_compiledir}/../packaging/rpm/taosd %{buildroot}%{homepath}/init.d
|
#cp %{_compiledir}/../packaging/rpm/taosd %{buildroot}%{homepath}/init.d
|
||||||
cp %{_compiledir}/../packaging/tools/post.sh %{buildroot}%{homepath}/script
|
cp %{_compiledir}/../packaging/tools/post.sh %{buildroot}%{homepath}/script
|
||||||
cp %{_compiledir}/../packaging/tools/preun.sh %{buildroot}%{homepath}/script
|
cp %{_compiledir}/../packaging/tools/preun.sh %{buildroot}%{homepath}/script
|
||||||
|
@ -84,6 +92,10 @@ cp %{_compiledir}/build/bin/udfd %{buildroot}%{homepath}/bin
|
||||||
cp %{_compiledir}/build/bin/taosBenchmark %{buildroot}%{homepath}/bin
|
cp %{_compiledir}/build/bin/taosBenchmark %{buildroot}%{homepath}/bin
|
||||||
cp %{_compiledir}/build/bin/taosdump %{buildroot}%{homepath}/bin
|
cp %{_compiledir}/build/bin/taosdump %{buildroot}%{homepath}/bin
|
||||||
|
|
||||||
|
if [ -f %{_compiledir}/../../../explorer/target/release/taos-explorer ]; then
|
||||||
|
cp %{_compiledir}/../../../explorer/target/release/taos-explorer %{buildroot}%{homepath}/bin
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -f %{_compiledir}/../build-taoskeeper/taoskeeper ]; then
|
if [ -f %{_compiledir}/../build-taoskeeper/taoskeeper ]; then
|
||||||
cp %{_compiledir}/../build-taoskeeper/taoskeeper %{buildroot}%{homepath}/bin
|
cp %{_compiledir}/../build-taoskeeper/taoskeeper %{buildroot}%{homepath}/bin
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -16,49 +16,27 @@ serverFqdn=""
|
||||||
script_dir=$(dirname $(readlink -f "$0"))
|
script_dir=$(dirname $(readlink -f "$0"))
|
||||||
# Dynamic directory
|
# Dynamic directory
|
||||||
|
|
||||||
clientName="taos"
|
PREFIX="taos"
|
||||||
serverName="taosd"
|
clientName="${PREFIX}"
|
||||||
|
serverName="${PREFIX}d"
|
||||||
udfdName="udfd"
|
udfdName="udfd"
|
||||||
configFile="taos.cfg"
|
configFile="${PREFIX}.cfg"
|
||||||
productName="TDengine"
|
productName="TDengine"
|
||||||
emailName="taosdata.com"
|
emailName="taosdata.com"
|
||||||
uninstallScript="rmtaos"
|
uninstallScript="rm${PREFIX}"
|
||||||
historyFile="taos_history"
|
historyFile="${PREFIX}_history"
|
||||||
tarName="package.tar.gz"
|
tarName="package.tar.gz"
|
||||||
dataDir="/var/lib/taos"
|
dataDir="/var/lib/${PREFIX}"
|
||||||
logDir="/var/log/taos"
|
logDir="/var/log/${PREFIX}"
|
||||||
configDir="/etc/taos"
|
configDir="/etc/${PREFIX}"
|
||||||
installDir="/usr/local/taos"
|
installDir="/usr/local/${PREFIX}"
|
||||||
adapterName="taosadapter"
|
adapterName="${PREFIX}adapter"
|
||||||
benchmarkName="taosBenchmark"
|
benchmarkName="${PREFIX}Benchmark"
|
||||||
dumpName="taosdump"
|
dumpName="${PREFIX}dump"
|
||||||
demoName="taosdemo"
|
demoName="${PREFIX}demo"
|
||||||
xname="taosx"
|
xname="${PREFIX}x"
|
||||||
keeperName="taoskeeper"
|
explorerName="${PREFIX}-explorer"
|
||||||
|
keeperName="${PREFIX}keeper"
|
||||||
clientName2="taos"
|
|
||||||
serverName2="${clientName2}d"
|
|
||||||
configFile2="${clientName2}.cfg"
|
|
||||||
productName2="TDengine"
|
|
||||||
emailName2="taosdata.com"
|
|
||||||
xname2="${clientName2}x"
|
|
||||||
adapterName2="${clientName2}adapter"
|
|
||||||
keeperName2="${clientName2}keeper"
|
|
||||||
|
|
||||||
explorerName="${clientName2}-explorer"
|
|
||||||
benchmarkName2="${clientName2}Benchmark"
|
|
||||||
demoName2="${clientName2}demo"
|
|
||||||
dumpName2="${clientName2}dump"
|
|
||||||
uninstallScript2="rm${clientName2}"
|
|
||||||
|
|
||||||
historyFile="${clientName2}_history"
|
|
||||||
logDir="/var/log/${clientName2}"
|
|
||||||
configDir="/etc/${clientName2}"
|
|
||||||
installDir="/usr/local/${clientName2}"
|
|
||||||
|
|
||||||
data_dir=${dataDir}
|
|
||||||
log_dir=${logDir}
|
|
||||||
cfg_install_dir=${configDir}
|
|
||||||
|
|
||||||
bin_link_dir="/usr/bin"
|
bin_link_dir="/usr/bin"
|
||||||
lib_link_dir="/usr/lib"
|
lib_link_dir="/usr/lib"
|
||||||
|
@ -71,7 +49,6 @@ install_main_dir=${installDir}
|
||||||
bin_dir="${installDir}/bin"
|
bin_dir="${installDir}/bin"
|
||||||
|
|
||||||
service_config_dir="/etc/systemd/system"
|
service_config_dir="/etc/systemd/system"
|
||||||
web_port=6041
|
|
||||||
|
|
||||||
# Color setting
|
# Color setting
|
||||||
RED='\033[0;31m'
|
RED='\033[0;31m'
|
||||||
|
@ -179,6 +156,26 @@ done
|
||||||
|
|
||||||
#echo "verType=${verType} interactiveFqdn=${interactiveFqdn}"
|
#echo "verType=${verType} interactiveFqdn=${interactiveFqdn}"
|
||||||
|
|
||||||
|
tools=(${clientName} ${benchmarkName} ${dumpName} ${demoName} remove.sh udfd set_core.sh TDinsight.sh start_pre.sh)
|
||||||
|
if [ "${verMode}" == "cluster" ]; then
|
||||||
|
services=(${serverName} ${adapterName} ${xname} ${explorerName} ${keeperName})
|
||||||
|
elif [ "${verMode}" == "community" ]; then
|
||||||
|
if [ "${pagMode}" == "full" ]; then
|
||||||
|
services=(${serverName} ${adapterName} ${keeperName} ${explorerName})
|
||||||
|
else
|
||||||
|
services=(${serverName})
|
||||||
|
tools=(${clientName} ${benchmarkName} remove.sh start_pre.sh)
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
services=(${serverName} ${adapterName} ${xname} ${explorerName} ${keeperName})
|
||||||
|
fi
|
||||||
|
|
||||||
|
function install_services() {
|
||||||
|
for service in "${services[@]}"; do
|
||||||
|
install_service ${service}
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
function kill_process() {
|
function kill_process() {
|
||||||
pid=$(ps -ef | grep "$1" | grep -v "grep" | awk '{print $2}')
|
pid=$(ps -ef | grep "$1" | grep -v "grep" | awk '{print $2}')
|
||||||
if [ -n "$pid" ]; then
|
if [ -n "$pid" ]; then
|
||||||
|
@ -196,6 +193,7 @@ function install_main_path() {
|
||||||
${csudo}mkdir -p ${install_main_dir}/driver
|
${csudo}mkdir -p ${install_main_dir}/driver
|
||||||
${csudo}mkdir -p ${install_main_dir}/examples
|
${csudo}mkdir -p ${install_main_dir}/examples
|
||||||
${csudo}mkdir -p ${install_main_dir}/include
|
${csudo}mkdir -p ${install_main_dir}/include
|
||||||
|
${csudo}mkdir -p ${configDir}
|
||||||
# ${csudo}mkdir -p ${install_main_dir}/init.d
|
# ${csudo}mkdir -p ${install_main_dir}/init.d
|
||||||
if [ "$verMode" == "cluster" ]; then
|
if [ "$verMode" == "cluster" ]; then
|
||||||
${csudo}mkdir -p ${install_main_dir}/share
|
${csudo}mkdir -p ${install_main_dir}/share
|
||||||
|
@ -208,44 +206,44 @@ function install_main_path() {
|
||||||
|
|
||||||
function install_bin() {
|
function install_bin() {
|
||||||
# Remove links
|
# Remove links
|
||||||
${csudo}rm -f ${bin_link_dir}/${clientName2} || :
|
for tool in "${tools[@]}"; do
|
||||||
${csudo}rm -f ${bin_link_dir}/${serverName2} || :
|
${csudo}rm -f ${bin_link_dir}/${tool} || :
|
||||||
${csudo}rm -f ${bin_link_dir}/${udfdName} || :
|
done
|
||||||
${csudo}rm -f ${bin_link_dir}/${adapterName} || :
|
|
||||||
${csudo}rm -f ${bin_link_dir}/${uninstallScript2} || :
|
|
||||||
${csudo}rm -f ${bin_link_dir}/${demoName2} || :
|
|
||||||
${csudo}rm -f ${bin_link_dir}/${benchmarkName2} || :
|
|
||||||
${csudo}rm -f ${bin_link_dir}/${dumpName2} || :
|
|
||||||
${csudo}rm -f ${bin_link_dir}/${keeperName2} || :
|
|
||||||
${csudo}rm -f ${bin_link_dir}/set_core || :
|
|
||||||
${csudo}rm -f ${bin_link_dir}/TDinsight.sh || :
|
|
||||||
|
|
||||||
${csudo}cp -r ${script_dir}/bin/* ${install_main_dir}/bin && ${csudo}chmod 0555 ${install_main_dir}/bin/*
|
for service in "${services[@]}"; do
|
||||||
|
${csudo}rm -f ${bin_link_dir}/${service} || :
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "${verType}" == "client" ]; then
|
||||||
|
${csudo}cp -r ${script_dir}/bin/${clientName} ${install_main_dir}/bin
|
||||||
|
${csudo}cp -r ${script_dir}/bin/${benchmarkName} ${install_main_dir}/bin
|
||||||
|
${csudo}cp -r ${script_dir}/bin/${dumpName} ${install_main_dir}/bin
|
||||||
|
${csudo}cp -r ${script_dir}/bin/remove.sh ${install_main_dir}/bin
|
||||||
|
else
|
||||||
|
${csudo}cp -r ${script_dir}/bin/* ${install_main_dir}/bin
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${verMode}" == "cluster" && "${verType}" != "client" ]]; then
|
||||||
|
if [ -d ${script_dir}/${xname}/bin ]; then
|
||||||
|
${csudo}cp -r ${script_dir}/${xname}/bin/* ${install_main_dir}/bin
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
${csudo}chmod 0555 ${install_main_dir}/bin/*
|
||||||
|
[ -x ${install_main_dir}/bin/remove.sh ] && ${csudo}mv ${install_main_dir}/bin/remove.sh ${install_main_dir}/uninstall.sh || :
|
||||||
|
|
||||||
#Make link
|
#Make link
|
||||||
[ -x ${install_main_dir}/bin/${clientName2} ] && ${csudo}ln -sf ${install_main_dir}/bin/${clientName2} ${bin_link_dir}/${clientName2} || :
|
for tool in "${tools[@]}"; do
|
||||||
[ -x ${install_main_dir}/bin/${serverName2} ] && ${csudo}ln -sf ${install_main_dir}/bin/${serverName2} ${bin_link_dir}/${serverName2} || :
|
if [ "${tool}" == "remove.sh" ]; then
|
||||||
[ -x ${install_main_dir}/bin/${udfdName} ] && ${csudo}ln -sf ${install_main_dir}/bin/${udfdName} ${bin_link_dir}/${udfdName} || :
|
[ -x ${install_main_dir}/uninstall.sh ] && ${csudo}ln -sf ${install_main_dir}/uninstall.sh ${bin_link_dir}/${uninstallScript} || :
|
||||||
[ -x ${install_main_dir}/bin/${adapterName2} ] && ${csudo}ln -sf ${install_main_dir}/bin/${adapterName2} ${bin_link_dir}/${adapterName2} || :
|
else
|
||||||
[ -x ${install_main_dir}/bin/${benchmarkName2} ] && ${csudo}ln -sf ${install_main_dir}/bin/${benchmarkName2} ${bin_link_dir}/${demoName2} || :
|
[ -x ${install_main_dir}/bin/${tool} ] && ${csudo}ln -sf ${install_main_dir}/bin/${tool} ${bin_link_dir}/${tool} || :
|
||||||
[ -x ${install_main_dir}/bin/${benchmarkName2} ] && ${csudo}ln -sf ${install_main_dir}/bin/${benchmarkName2} ${bin_link_dir}/${benchmarkName2} || :
|
|
||||||
[ -x ${install_main_dir}/bin/${dumpName2} ] && ${csudo}ln -sf ${install_main_dir}/bin/${dumpName2} ${bin_link_dir}/${dumpName2} || :
|
|
||||||
[ -x ${install_main_dir}/bin/${keeperName2} ] && ${csudo}ln -sf ${install_main_dir}/bin/${keeperName2} ${bin_link_dir}/${keeperName2} || :
|
|
||||||
[ -x ${install_main_dir}/bin/TDinsight.sh ] && ${csudo}ln -sf ${install_main_dir}/bin/TDinsight.sh ${bin_link_dir}/TDinsight.sh || :
|
|
||||||
if [ "$clientName2" == "${clientName}" ]; then
|
|
||||||
[ -x ${install_main_dir}/bin/remove.sh ] && ${csudo}ln -s ${install_main_dir}/bin/remove.sh ${bin_link_dir}/${uninstallScript} || :
|
|
||||||
fi
|
fi
|
||||||
[ -x ${install_main_dir}/bin/set_core.sh ] && ${csudo}ln -s ${install_main_dir}/bin/set_core.sh ${bin_link_dir}/set_core || :
|
done
|
||||||
|
|
||||||
if [ "$verMode" == "cluster" ] && [ "$clientName" != "$clientName2" ]; then
|
for service in "${services[@]}"; do
|
||||||
${csudo}rm -f ${bin_link_dir}/${xname2} || :
|
[ -x ${install_main_dir}/bin/${service} ] && ${csudo}ln -sf ${install_main_dir}/bin/${service} ${bin_link_dir}/${service} || :
|
||||||
${csudo}rm -f ${bin_link_dir}/${explorerName} || :
|
done
|
||||||
|
|
||||||
#Make link
|
|
||||||
[ -x ${install_main_dir}/bin/${xname2} ] && ${csudo}ln -sf ${install_main_dir}/bin/${xname2} ${bin_link_dir}/${xname2} || :
|
|
||||||
[ -x ${install_main_dir}/bin/${explorerName} ] && ${csudo}ln -sf ${install_main_dir}/bin/${explorerName} ${bin_link_dir}/${explorerName} || :
|
|
||||||
[ -x ${install_main_dir}/bin/remove.sh ] && ${csudo}ln -s ${install_main_dir}/bin/remove.sh ${bin_link_dir}/${uninstallScript2} || :
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_lib() {
|
function install_lib() {
|
||||||
|
@ -415,10 +413,10 @@ function set_hostname() {
|
||||||
# ${csudo}sed -i -r "s/#*\s*(HOSTNAME=\s*).*/\1$newHostname/" /etc/sysconfig/network || :
|
# ${csudo}sed -i -r "s/#*\s*(HOSTNAME=\s*).*/\1$newHostname/" /etc/sysconfig/network || :
|
||||||
# fi
|
# fi
|
||||||
|
|
||||||
if [ -f ${cfg_install_dir}/${configFile2} ]; then
|
if [ -f ${configDir}/${configFile} ]; then
|
||||||
${csudo}sed -i -r "s/#*\s*(fqdn\s*).*/\1$newHostname/" ${cfg_install_dir}/${configFile2}
|
${csudo}sed -i -r "s/#*\s*(fqdn\s*).*/\1$newHostname/" ${configDir}/${configFile}
|
||||||
else
|
else
|
||||||
${csudo}sed -i -r "s/#*\s*(fqdn\s*).*/\1$newHostname/" ${script_dir}/cfg/${configFile2}
|
${csudo}sed -i -r "s/#*\s*(fqdn\s*).*/\1$newHostname/" ${script_dir}/cfg/${configFile}
|
||||||
fi
|
fi
|
||||||
serverFqdn=$newHostname
|
serverFqdn=$newHostname
|
||||||
|
|
||||||
|
@ -454,10 +452,10 @@ function set_ipAsFqdn() {
|
||||||
localFqdn="127.0.0.1"
|
localFqdn="127.0.0.1"
|
||||||
# Write the local FQDN to configuration file
|
# Write the local FQDN to configuration file
|
||||||
|
|
||||||
if [ -f ${cfg_install_dir}/${configFile2} ]; then
|
if [ -f ${configDir}/${configFile} ]; then
|
||||||
${csudo}sed -i -r "s/#*\s*(fqdn\s*).*/\1$localFqdn/" ${cfg_install_dir}/${configFile2}
|
${csudo}sed -i -r "s/#*\s*(fqdn\s*).*/\1$localFqdn/" ${configDir}/${configFile}
|
||||||
else
|
else
|
||||||
${csudo}sed -i -r "s/#*\s*(fqdn\s*).*/\1$localFqdn/" ${script_dir}/cfg/${configFile2}
|
${csudo}sed -i -r "s/#*\s*(fqdn\s*).*/\1$localFqdn/" ${script_dir}/cfg/${configFile}
|
||||||
fi
|
fi
|
||||||
serverFqdn=$localFqdn
|
serverFqdn=$localFqdn
|
||||||
echo
|
echo
|
||||||
|
@ -480,10 +478,10 @@ function set_ipAsFqdn() {
|
||||||
read -p "Please choose an IP from local IP list:" localFqdn
|
read -p "Please choose an IP from local IP list:" localFqdn
|
||||||
else
|
else
|
||||||
# Write the local FQDN to configuration file
|
# Write the local FQDN to configuration file
|
||||||
if [ -f ${cfg_install_dir}/${configFile2} ]; then
|
if [ -f ${configDir}/${configFile} ]; then
|
||||||
${csudo}sed -i -r "s/#*\s*(fqdn\s*).*/\1$localFqdn/" ${cfg_install_dir}/${configFile2}
|
${csudo}sed -i -r "s/#*\s*(fqdn\s*).*/\1$localFqdn/" ${configDir}/${configFile}
|
||||||
else
|
else
|
||||||
${csudo}sed -i -r "s/#*\s*(fqdn\s*).*/\1$localFqdn/" ${script_dir}/cfg/${configFile2}
|
${csudo}sed -i -r "s/#*\s*(fqdn\s*).*/\1$localFqdn/" ${script_dir}/cfg/${configFile}
|
||||||
fi
|
fi
|
||||||
serverFqdn=$localFqdn
|
serverFqdn=$localFqdn
|
||||||
break
|
break
|
||||||
|
@ -502,88 +500,117 @@ function local_fqdn_check() {
|
||||||
set_hostname
|
set_hostname
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_adapter_config() {
|
function install_taosx_config() {
|
||||||
if [ -f ${script_dir}/cfg/${adapterName}.toml ]; then
|
|
||||||
${csudo}sed -i -r "s/localhost/${serverFqdn}/g" ${script_dir}/cfg/${adapterName}.toml
|
|
||||||
fi
|
|
||||||
if [ ! -f "${cfg_install_dir}/${adapterName}.toml" ]; then
|
|
||||||
${csudo}mkdir -p ${cfg_install_dir}
|
|
||||||
[ -f ${script_dir}/cfg/${adapterName}.toml ] && ${csudo}cp ${script_dir}/cfg/${adapterName}.toml ${cfg_install_dir}
|
|
||||||
[ -f ${cfg_install_dir}/${adapterName}.toml ] && ${csudo}chmod 644 ${cfg_install_dir}/${adapterName}.toml
|
|
||||||
else
|
|
||||||
[ -f ${script_dir}/cfg/${adapterName}.toml ] &&
|
|
||||||
${csudo}cp -f ${script_dir}/cfg/${adapterName}.toml ${cfg_install_dir}/${adapterName}.toml.new
|
|
||||||
fi
|
|
||||||
|
|
||||||
[ -f ${cfg_install_dir}/${adapterName}.toml ] &&
|
|
||||||
${csudo}ln -sf ${cfg_install_dir}/${adapterName}.toml ${install_main_dir}/cfg/${adapterName}.toml
|
|
||||||
|
|
||||||
[ ! -z $1 ] && return 0 || : # only install client
|
[ ! -z $1 ] && return 0 || : # only install client
|
||||||
|
|
||||||
|
fileName="${script_dir}/${xname}/etc/taos/${xname}.toml"
|
||||||
|
if [ -f ${fileName} ]; then
|
||||||
|
${csudo}sed -i -r "s/#*\s*(fqdn\s*=\s*).*/\1\"${serverFqdn}\"/" ${fileName}
|
||||||
|
|
||||||
|
if [ -f "${configDir}/${xname}.toml" ]; then
|
||||||
|
${csudo}cp ${fileName} ${configDir}/${xname}.toml.new
|
||||||
|
else
|
||||||
|
${csudo}cp ${fileName} ${configDir}/${xname}.toml
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function install_explorer_config() {
|
||||||
|
[ ! -z $1 ] && return 0 || : # only install client
|
||||||
|
|
||||||
|
if [ "$verMode" == "cluster" ]; then
|
||||||
|
fileName="${script_dir}/${xname}/etc/taos/explorer.toml"
|
||||||
|
else
|
||||||
|
fileName="${script_dir}/cfg/explorer.toml"
|
||||||
|
}
|
||||||
|
if [ -f ${fileName} ]; then
|
||||||
|
${csudo}sed -i "s/localhost/${serverFqdn}/g" ${fileName}
|
||||||
|
|
||||||
|
if [ -f "${configDir}/explorer.toml" ]; then
|
||||||
|
${csudo}cp ${fileName} ${configDir}/explorer.toml.new
|
||||||
|
else
|
||||||
|
${csudo}cp ${fileName} ${configDir}/explorer.toml
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function install_adapter_config() {
|
||||||
|
[ ! -z $1 ] && return 0 || : # only install client
|
||||||
|
|
||||||
|
fileName="${script_dir}/cfg/${adapterName}.toml"
|
||||||
|
if [ -f ${fileName} ]; then
|
||||||
|
${csudo}sed -i -r "s/localhost/${serverFqdn}/g" ${fileName}
|
||||||
|
|
||||||
|
if [ -f "${configDir}/${adapterName}.toml" ]; then
|
||||||
|
${csudo}cp ${fileName} ${configDir}/${adapterName}.toml.new
|
||||||
|
else
|
||||||
|
${csudo}cp ${fileName} ${configDir}/${adapterName}.toml
|
||||||
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_keeper_config() {
|
function install_keeper_config() {
|
||||||
if [ -f ${script_dir}/cfg/${keeperName2}.toml ]; then
|
[ ! -z $1 ] && return 0 || : # only install client
|
||||||
${csudo}sed -i -r "s/127.0.0.1/${serverFqdn}/g" ${script_dir}/cfg/${keeperName2}.toml
|
|
||||||
fi
|
fileName="${script_dir}/cfg/${keeperName}.toml"
|
||||||
if [ -f "${configDir}/keeper.toml" ]; then
|
if [ -f ${fileName} ]; then
|
||||||
echo "The file keeper.toml will be renamed to ${keeperName2}.toml"
|
${csudo}sed -i -r "s/127.0.0.1/${serverFqdn}/g" ${fileName}
|
||||||
${csudo}cp ${script_dir}/cfg/${keeperName2}.toml ${configDir}/${keeperName2}.toml.new
|
|
||||||
${csudo}mv ${configDir}/keeper.toml ${configDir}/${keeperName2}.toml
|
if [ -f "${configDir}/${keeperName}.toml" ]; then
|
||||||
elif [ -f "${configDir}/${keeperName2}.toml" ]; then
|
${csudo}cp ${fileName} ${configDir}/${keeperName}.toml.new
|
||||||
# "taoskeeper.toml exists,new config is taoskeeper.toml.new"
|
|
||||||
${csudo}cp ${script_dir}/cfg/${keeperName2}.toml ${configDir}/${keeperName2}.toml.new
|
|
||||||
else
|
else
|
||||||
${csudo}cp ${script_dir}/cfg/${keeperName2}.toml ${configDir}/${keeperName2}.toml
|
${csudo}cp ${fileName} ${configDir}/${keeperName}.toml
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
command -v systemctl >/dev/null 2>&1 && ${csudo}systemctl daemon-reload >/dev/null 2>&1 || true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function install_taosd_config() {
|
||||||
|
fileName="${script_dir}/cfg/${configFile}"
|
||||||
|
if [ -f ${fileName} ]; then
|
||||||
|
${csudo}sed -i -r "s/#*\s*(fqdn\s*).*/\1$serverFqdn/" ${script_dir}/cfg/${configFile}
|
||||||
|
${csudo}echo "monitor 1" >>${script_dir}/cfg/${configFile}
|
||||||
|
${csudo}echo "monitorFQDN ${serverFqdn}" >>${script_dir}/cfg/${configFile}
|
||||||
|
${csudo}echo "audit 1" >>${script_dir}/cfg/${configFile}
|
||||||
|
|
||||||
|
if [ -f "${configDir}/${configFile}" ]; then
|
||||||
|
${csudo}cp ${fileName} ${configDir}/${configFile}.new
|
||||||
|
else
|
||||||
|
${csudo}cp ${fileName} ${configDir}/${configFile}
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
${csudo}ln -sf ${configDir}/${configFile} ${install_main_dir}/cfg
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function install_config() {
|
function install_config() {
|
||||||
|
|
||||||
if [ ! -f "${cfg_install_dir}/${configFile2}" ]; then
|
|
||||||
${csudo}mkdir -p ${cfg_install_dir}
|
|
||||||
if [ -f ${script_dir}/cfg/${configFile2} ]; then
|
|
||||||
${csudo} echo "monitor 1" >> ${script_dir}/cfg/${configFile2}
|
|
||||||
${csudo} echo "monitorFQDN ${serverFqdn}" >> ${script_dir}/cfg/${configFile2}
|
|
||||||
${csudo} echo "audit 1" >> ${script_dir}/cfg/${configFile2}
|
|
||||||
${csudo}cp ${script_dir}/cfg/${configFile2} ${cfg_install_dir}
|
|
||||||
fi
|
|
||||||
${csudo}chmod 644 ${cfg_install_dir}/*
|
|
||||||
else
|
|
||||||
${csudo} echo "monitor 1" >> ${script_dir}/cfg/${configFile2}
|
|
||||||
${csudo} echo "monitorFQDN ${serverFqdn}" >> ${script_dir}/cfg/${configFile2}
|
|
||||||
${csudo} echo "audit 1" >> ${script_dir}/cfg/${configFile2}
|
|
||||||
${csudo}cp -f ${script_dir}/cfg/${configFile2} ${cfg_install_dir}/${configFile2}.new
|
|
||||||
fi
|
|
||||||
|
|
||||||
${csudo}ln -sf ${cfg_install_dir}/${configFile2} ${install_main_dir}/cfg
|
|
||||||
|
|
||||||
[ ! -z $1 ] && return 0 || : # only install client
|
[ ! -z $1 ] && return 0 || : # only install client
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ((${update_flag} == 1)); then
|
if ((${update_flag} == 1)); then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$interactiveFqdn" == "no" ]; then
|
if [ "$interactiveFqdn" == "no" ]; then
|
||||||
|
install_taosd_config
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local_fqdn_check
|
local_fqdn_check
|
||||||
|
install_taosd_config
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo -e -n "${GREEN}Enter FQDN:port (like h1.${emailName2}:6030) of an existing ${productName2} cluster node to join${NC}"
|
echo -e -n "${GREEN}Enter FQDN:port (like h1.${emailName}:6030) of an existing ${productName} cluster node to join${NC}"
|
||||||
echo
|
echo
|
||||||
echo -e -n "${GREEN}OR leave it blank to build one${NC}:"
|
echo -e -n "${GREEN}OR leave it blank to build one${NC}:"
|
||||||
read firstEp
|
read firstEp
|
||||||
while true; do
|
while true; do
|
||||||
if [ ! -z "$firstEp" ]; then
|
if [ ! -z "$firstEp" ]; then
|
||||||
if [ -f ${cfg_install_dir}/${configFile2} ]; then
|
if [ -f ${configDir}/${configFile} ]; then
|
||||||
${csudo}sed -i -r "s/#*\s*(firstEp\s*).*/\1$firstEp/" ${cfg_install_dir}/${configFile2}
|
${csudo}sed -i -r "s/#*\s*(firstEp\s*).*/\1$firstEp/" ${configDir}/${configFile}
|
||||||
else
|
else
|
||||||
${csudo}sed -i -r "s/#*\s*(firstEp\s*).*/\1$firstEp/" ${script_dir}/cfg/${configFile2}
|
${csudo}sed -i -r "s/#*\s*(firstEp\s*).*/\1$firstEp/" ${script_dir}/cfg/${configFile}
|
||||||
fi
|
fi
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
|
@ -605,32 +632,16 @@ function install_config() {
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_share_etc() {
|
|
||||||
[ ! -d ${script_dir}/share/etc ] && return
|
|
||||||
for c in `ls ${script_dir}/share/etc/`; do
|
|
||||||
if [ -e /etc/${clientName2}/$c ]; then
|
|
||||||
out=/etc/${clientName2}/$c.new.`date +%F`
|
|
||||||
${csudo}cp -f ${script_dir}/share/etc/$c $out ||:
|
|
||||||
else
|
|
||||||
${csudo}mkdir -p /etc/${clientName2} >/dev/null 2>/dev/null ||:
|
|
||||||
${csudo}cp -f ${script_dir}/share/etc/$c /etc/${clientName2}/$c ||:
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
[ ! -d ${script_dir}/share/srv ] && return
|
|
||||||
${csudo} cp ${script_dir}/share/srv/* ${service_config_dir} ||:
|
|
||||||
}
|
|
||||||
|
|
||||||
function install_log() {
|
function install_log() {
|
||||||
${csudo}mkdir -p ${log_dir} && ${csudo}chmod 777 ${log_dir}
|
${csudo}mkdir -p ${logDir} && ${csudo}chmod 777 ${logDir}
|
||||||
|
|
||||||
${csudo}ln -sf ${log_dir} ${install_main_dir}/log
|
${csudo}ln -sf ${logDir} ${install_main_dir}/log
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_data() {
|
function install_data() {
|
||||||
${csudo}mkdir -p ${data_dir}
|
${csudo}mkdir -p ${dataDir}
|
||||||
|
|
||||||
${csudo}ln -sf ${data_dir} ${install_main_dir}/data
|
${csudo}ln -sf ${dataDir} ${install_main_dir}/data
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_connector() {
|
function install_connector() {
|
||||||
|
@ -648,55 +659,32 @@ function install_examples() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_web() {
|
function install_plugins() {
|
||||||
if [ -d "${script_dir}/share" ]; then
|
if [ -d ${script_dir}/${xname}/plugins ]; then
|
||||||
${csudo}cp -rf ${script_dir}/share/* ${install_main_dir}/share > /dev/null 2>&1 ||:
|
${csudo}cp -rf ${script_dir}/${xname}/plugins/ ${install_main_dir}/ || echo "failed to copy taosx plugins"
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function install_taosx() {
|
|
||||||
if [ -f "${script_dir}/taosx/install_taosx.sh" ]; then
|
|
||||||
cd ${script_dir}/taosx
|
|
||||||
chmod a+x install_taosx.sh
|
|
||||||
bash install_taosx.sh -e $serverFqdn
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function clean_service_on_sysvinit() {
|
function clean_service_on_sysvinit() {
|
||||||
if ps aux | grep -v grep | grep ${serverName2} &>/dev/null; then
|
if ps aux | grep -v grep | grep $1 &>/dev/null; then
|
||||||
${csudo}service ${serverName2} stop || :
|
${csudo}service $1 stop || :
|
||||||
fi
|
|
||||||
|
|
||||||
if ps aux | grep -v grep | grep tarbitrator &>/dev/null; then
|
|
||||||
${csudo}service tarbitratord stop || :
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ((${initd_mod} == 1)); then
|
if ((${initd_mod} == 1)); then
|
||||||
if [ -e ${service_config_dir}/${serverName2} ]; then
|
if [ -e ${service_config_dir}/$1 ]; then
|
||||||
${csudo}chkconfig --del ${serverName2} || :
|
${csudo}chkconfig --del $1 || :
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -e ${service_config_dir}/tarbitratord ]; then
|
|
||||||
${csudo}chkconfig --del tarbitratord || :
|
|
||||||
fi
|
fi
|
||||||
elif ((${initd_mod} == 2)); then
|
elif ((${initd_mod} == 2)); then
|
||||||
if [ -e ${service_config_dir}/${serverName2} ]; then
|
if [ -e ${service_config_dir}/$1 ]; then
|
||||||
${csudo}insserv -r ${serverName2} || :
|
${csudo}insserv -r $1 || :
|
||||||
fi
|
|
||||||
if [ -e ${service_config_dir}/tarbitratord ]; then
|
|
||||||
${csudo}insserv -r tarbitratord || :
|
|
||||||
fi
|
fi
|
||||||
elif ((${initd_mod} == 3)); then
|
elif ((${initd_mod} == 3)); then
|
||||||
if [ -e ${service_config_dir}/${serverName2} ]; then
|
if [ -e ${service_config_dir}/$1 ]; then
|
||||||
${csudo}update-rc.d -f ${serverName2} remove || :
|
${csudo}update-rc.d -f $1 remove || :
|
||||||
fi
|
|
||||||
if [ -e ${service_config_dir}/tarbitratord ]; then
|
|
||||||
${csudo}update-rc.d -f tarbitratord remove || :
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
${csudo}rm -f ${service_config_dir}/${serverName2} || :
|
${csudo}rm -f ${service_config_dir}/$1 || :
|
||||||
${csudo}rm -f ${service_config_dir}/tarbitratord || :
|
|
||||||
|
|
||||||
if $(which init &>/dev/null); then
|
if $(which init &>/dev/null); then
|
||||||
${csudo}init q || :
|
${csudo}init q || :
|
||||||
|
@ -704,96 +692,68 @@ function clean_service_on_sysvinit() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_service_on_sysvinit() {
|
function install_service_on_sysvinit() {
|
||||||
clean_service_on_sysvinit
|
if [ "$1" != "${serverName}" ]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
clean_service_on_sysvinit $1
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
if ((${os_type} == 1)); then
|
if ((${os_type} == 1)); then
|
||||||
# ${csudo}cp -f ${script_dir}/init.d/${serverName}.deb ${install_main_dir}/init.d/${serverName}
|
|
||||||
${csudo}cp ${script_dir}/init.d/${serverName}.deb ${service_config_dir}/${serverName} && ${csudo}chmod a+x ${service_config_dir}/${serverName}
|
${csudo}cp ${script_dir}/init.d/${serverName}.deb ${service_config_dir}/${serverName} && ${csudo}chmod a+x ${service_config_dir}/${serverName}
|
||||||
elif ((${os_type} == 2)); then
|
elif ((${os_type} == 2)); then
|
||||||
# ${csudo}cp -f ${script_dir}/init.d/${serverName}.rpm ${install_main_dir}/init.d/${serverName}
|
|
||||||
${csudo}cp ${script_dir}/init.d/${serverName}.rpm ${service_config_dir}/${serverName} && ${csudo}chmod a+x ${service_config_dir}/${serverName}
|
${csudo}cp ${script_dir}/init.d/${serverName}.rpm ${service_config_dir}/${serverName} && ${csudo}chmod a+x ${service_config_dir}/${serverName}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ((${initd_mod} == 1)); then
|
if ((${initd_mod} == 1)); then
|
||||||
${csudo}chkconfig --add ${serverName2} || :
|
${csudo}chkconfig --add $1 || :
|
||||||
${csudo}chkconfig --level 2345 ${serverName2} on || :
|
${csudo}chkconfig --level 2345 $1 on || :
|
||||||
elif ((${initd_mod} == 2)); then
|
elif ((${initd_mod} == 2)); then
|
||||||
${csudo}insserv ${serverName2} || :
|
${csudo}insserv $1} || :
|
||||||
${csudo}insserv -d ${serverName2} || :
|
${csudo}insserv -d $1 || :
|
||||||
elif ((${initd_mod} == 3)); then
|
elif ((${initd_mod} == 3)); then
|
||||||
${csudo}update-rc.d ${serverName2} defaults || :
|
${csudo}update-rc.d $1 defaults || :
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function clean_service_on_systemd() {
|
function clean_service_on_systemd() {
|
||||||
service_config="${service_config_dir}/${serverName2}.service"
|
service_config="${service_config_dir}/$1.service"
|
||||||
if systemctl is-active --quiet ${serverName2}; then
|
|
||||||
echo "${productName} is running, stopping it..."
|
|
||||||
${csudo}systemctl stop ${serverName2} &>/dev/null || echo &>/dev/null
|
|
||||||
fi
|
|
||||||
${csudo}systemctl disable ${serverName2} &>/dev/null || echo &>/dev/null
|
|
||||||
${csudo}rm -f ${service_config}
|
|
||||||
|
|
||||||
tarbitratord_service_config="${service_config_dir}/tarbitratord.service"
|
if systemctl is-active --quiet $1; then
|
||||||
if systemctl is-active --quiet tarbitratord; then
|
echo "$1 is running, stopping it..."
|
||||||
echo "tarbitrator is running, stopping it..."
|
${csudo}systemctl stop $1 &>/dev/null || echo &>/dev/null
|
||||||
${csudo}systemctl stop tarbitratord &>/dev/null || echo &>/dev/null
|
|
||||||
fi
|
fi
|
||||||
${csudo}systemctl disable tarbitratord &>/dev/null || echo &>/dev/null
|
${csudo}systemctl disable $1 &>/dev/null || echo &>/dev/null
|
||||||
${csudo}rm -f ${tarbitratord_service_config}
|
${csudo}rm -f ${service_config}
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_service_on_systemd() {
|
function install_service_on_systemd() {
|
||||||
clean_service_on_systemd
|
clean_service_on_systemd $1
|
||||||
|
|
||||||
install_share_etc
|
cfg_source_dir=${script_dir}/cfg
|
||||||
|
if [[ "$1" == "${xname}" || "$1" == "${explorerName}" ]]; then
|
||||||
[ -f ${script_dir}/cfg/${serverName2}.service ] &&
|
if [ "$verMode" == "cluster" ]; then
|
||||||
${csudo}cp ${script_dir}/cfg/${serverName2}.service \
|
cfg_source_dir=${script_dir}/${xname}/etc/systemd/system
|
||||||
${service_config_dir}/ || :
|
else
|
||||||
|
cfg_source_dir=${script_dir}/cfg
|
||||||
# if [ "$verMode" == "cluster" ] && [ "$clientName" != "$clientName2" ]; then
|
|
||||||
# [ -f ${script_dir}/cfg/${serverName2}.service ] &&
|
|
||||||
# ${csudo}cp ${script_dir}/cfg/${serverName2}.service \
|
|
||||||
# ${service_config_dir}/${serverName2}.service || :
|
|
||||||
# fi
|
|
||||||
|
|
||||||
${csudo}systemctl daemon-reload
|
|
||||||
|
|
||||||
${csudo}systemctl enable ${serverName2}
|
|
||||||
${csudo}systemctl daemon-reload
|
|
||||||
}
|
|
||||||
|
|
||||||
function install_adapter_service() {
|
|
||||||
if ((${service_mod} == 0)); then
|
|
||||||
[ -f ${script_dir}/cfg/${adapterName2}.service ] &&
|
|
||||||
${csudo}cp ${script_dir}/cfg/${adapterName2}.service \
|
|
||||||
${service_config_dir}/ || :
|
|
||||||
|
|
||||||
${csudo}systemctl enable ${adapterName2}
|
|
||||||
${csudo}systemctl daemon-reload
|
|
||||||
fi
|
fi
|
||||||
}
|
|
||||||
|
|
||||||
function install_keeper_service() {
|
|
||||||
if ((${service_mod} == 0)); then
|
|
||||||
[ -f ${script_dir}/cfg/${clientName2}keeper.service ] &&
|
|
||||||
${csudo}cp ${script_dir}/cfg/${clientName2}keeper.service \
|
|
||||||
${service_config_dir}/ || :
|
|
||||||
|
|
||||||
${csudo}systemctl enable ${clientName2}keeper
|
|
||||||
${csudo}systemctl daemon-reload
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -f ${cfg_source_dir}/$1.service ]; then
|
||||||
|
${csudo}cp ${cfg_source_dir}/$1.service ${service_config_dir}/ || :
|
||||||
|
fi
|
||||||
|
|
||||||
|
${csudo}systemctl enable $1
|
||||||
|
${csudo}systemctl daemon-reload
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_service() {
|
function install_service() {
|
||||||
if ((${service_mod} == 0)); then
|
if ((${service_mod} == 0)); then
|
||||||
install_service_on_systemd
|
install_service_on_systemd $1
|
||||||
elif ((${service_mod} == 1)); then
|
elif ((${service_mod} == 1)); then
|
||||||
install_service_on_sysvinit
|
install_service_on_sysvinit $1
|
||||||
else
|
else
|
||||||
kill_process ${serverName2}
|
kill_process $1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -830,10 +790,10 @@ function is_version_compatible() {
|
||||||
if [ -f ${script_dir}/driver/vercomp.txt ]; then
|
if [ -f ${script_dir}/driver/vercomp.txt ]; then
|
||||||
min_compatible_version=$(cat ${script_dir}/driver/vercomp.txt)
|
min_compatible_version=$(cat ${script_dir}/driver/vercomp.txt)
|
||||||
else
|
else
|
||||||
min_compatible_version=$(${script_dir}/bin/${serverName2} -V | head -1 | cut -d ' ' -f 5)
|
min_compatible_version=$(${script_dir}/bin/${serverName} -V | head -1 | cut -d ' ' -f 5)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exist_version=$(${installDir}/bin/${serverName2} -V | head -1 | cut -d ' ' -f 3)
|
exist_version=$(${installDir}/bin/${serverName} -V | head -1 | cut -d ' ' -f 3)
|
||||||
vercomp $exist_version "3.0.0.0"
|
vercomp $exist_version "3.0.0.0"
|
||||||
case $? in
|
case $? in
|
||||||
2)
|
2)
|
||||||
|
@ -901,15 +861,15 @@ function updateProduct() {
|
||||||
tar -zxf ${tarName}
|
tar -zxf ${tarName}
|
||||||
install_jemalloc
|
install_jemalloc
|
||||||
|
|
||||||
echo "Start to update ${productName2}..."
|
echo "Start to update ${productName}..."
|
||||||
# Stop the service if running
|
# Stop the service if running
|
||||||
if ps aux | grep -v grep | grep ${serverName2} &>/dev/null; then
|
if ps aux | grep -v grep | grep ${serverName} &>/dev/null; then
|
||||||
if ((${service_mod} == 0)); then
|
if ((${service_mod} == 0)); then
|
||||||
${csudo}systemctl stop ${serverName2} || :
|
${csudo}systemctl stop ${serverName} || :
|
||||||
elif ((${service_mod} == 1)); then
|
elif ((${service_mod} == 1)); then
|
||||||
${csudo}service ${serverName2} stop || :
|
${csudo}service ${serverName} stop || :
|
||||||
else
|
else
|
||||||
kill_process ${serverName2}
|
kill_process ${serverName}
|
||||||
fi
|
fi
|
||||||
sleep 1
|
sleep 1
|
||||||
fi
|
fi
|
||||||
|
@ -923,68 +883,59 @@ function updateProduct() {
|
||||||
|
|
||||||
if [ "$verMode" == "cluster" ]; then
|
if [ "$verMode" == "cluster" ]; then
|
||||||
install_connector
|
install_connector
|
||||||
install_taosx
|
install_plugins
|
||||||
fi
|
fi
|
||||||
|
|
||||||
install_examples
|
install_examples
|
||||||
install_web
|
|
||||||
if [ -z $1 ]; then
|
if [ -z $1 ]; then
|
||||||
install_bin
|
install_bin
|
||||||
install_service
|
install_services
|
||||||
install_adapter_service
|
|
||||||
|
if [ "${pagMode}" != "lite" ]; then
|
||||||
install_adapter_config
|
install_adapter_config
|
||||||
install_keeper_service
|
install_taosx_config
|
||||||
|
install_explorer_config
|
||||||
if [ "${verMode}" != "cloud" ]; then
|
if [ "${verMode}" != "cloud" ]; then
|
||||||
install_keeper_config
|
install_keeper_config
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
openresty_work=false
|
openresty_work=false
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo -e "${GREEN_DARK}To configure ${productName2} ${NC}\t\t: edit ${cfg_install_dir}/${configFile2}"
|
echo -e "${GREEN_DARK}To configure ${productName} ${NC}\t\t: edit ${configDir}/${configFile}"
|
||||||
[ -f ${configDir}/${clientName2}adapter.toml ] && [ -f ${installDir}/bin/${clientName2}adapter ] && \
|
[ -f ${configDir}/${adapterName}.toml ] && [ -f ${installDir}/bin/${adapterName} ] &&
|
||||||
echo -e "${GREEN_DARK}To configure ${clientName2}Adapter ${NC}\t: edit ${configDir}/${clientName2}adapter.toml"
|
echo -e "${GREEN_DARK}To configure ${adapterName} ${NC}\t: edit ${configDir}/${adapterName}.toml"
|
||||||
if [ "$verMode" == "cluster" ]; then
|
if [ "$verMode" == "cluster" ]; then
|
||||||
echo -e "${GREEN_DARK}To configure ${clientName2}-explorer ${NC}\t: edit ${configDir}/explorer.toml"
|
echo -e "${GREEN_DARK}To configure ${explorerName} ${NC}\t: edit ${configDir}/explorer.toml"
|
||||||
fi
|
fi
|
||||||
if ((${service_mod} == 0)); then
|
if ((${service_mod} == 0)); then
|
||||||
echo -e "${GREEN_DARK}To start ${productName2} ${NC}\t\t: ${csudo}systemctl start ${serverName2}${NC}"
|
echo -e "${GREEN_DARK}To start ${productName} ${NC}\t\t: ${csudo}systemctl start ${serverName}${NC}"
|
||||||
[ -f ${service_config_dir}/${clientName2}adapter.service ] && [ -f ${installDir}/bin/${clientName2}adapter ] && \
|
[ -f ${service_config_dir}/${clientName}adapter.service ] && [ -f ${installDir}/bin/${clientName}adapter ] &&
|
||||||
echo -e "${GREEN_DARK}To start ${clientName2}Adapter ${NC}\t\t: ${csudo}systemctl start ${clientName2}adapter ${NC}"
|
echo -e "${GREEN_DARK}To start ${clientName}Adapter ${NC}\t\t: ${csudo}systemctl start ${clientName}adapter ${NC}"
|
||||||
elif ((${service_mod} == 1)); then
|
elif ((${service_mod} == 1)); then
|
||||||
echo -e "${GREEN_DARK}To start ${productName2} ${NC}\t\t: ${csudo}service ${serverName2} start${NC}"
|
echo -e "${GREEN_DARK}To start ${productName} ${NC}\t\t: ${csudo}service ${serverName} start${NC}"
|
||||||
[ -f ${service_config_dir}/${clientName2}adapter.service ] && [ -f ${installDir}/bin/${clientName2}adapter ] && \
|
[ -f ${service_config_dir}/${clientName}adapter.service ] && [ -f ${installDir}/bin/${clientName}adapter ] &&
|
||||||
echo -e "${GREEN_DARK}To start ${clientName2}Adapter ${NC}\t\t: ${csudo}service ${clientName2}adapter start${NC}"
|
echo -e "${GREEN_DARK}To start ${clientName}Adapter ${NC}\t\t: ${csudo}service ${clientName}adapter start${NC}"
|
||||||
else
|
else
|
||||||
echo -e "${GREEN_DARK}To start ${productName2} ${NC}\t\t: ./${serverName2}${NC}"
|
echo -e "${GREEN_DARK}To start ${productName} ${NC}\t\t: ./${serverName}${NC}"
|
||||||
[ -f ${installDir}/bin/${clientName2}adapter ] && \
|
[ -f ${installDir}/bin/${clientName}adapter ] &&
|
||||||
echo -e "${GREEN_DARK}To start ${clientName2}Adapter ${NC}\t\t: ${clientName2}adapter ${NC}"
|
echo -e "${GREEN_DARK}To start ${clientName}Adapter ${NC}\t\t: ${clientName}adapter ${NC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "${GREEN_DARK}To enable ${clientName2}keeper ${NC}\t\t: sudo systemctl enable ${clientName2}keeper ${NC}"
|
echo -e "${GREEN_DARK}To enable ${clientName}keeper ${NC}\t\t: sudo systemctl enable ${clientName}keeper ${NC}"
|
||||||
if [ "$verMode" == "cluster" ]; then
|
if [ "$verMode" == "cluster" ]; then
|
||||||
echo -e "${GREEN_DARK}To start ${clientName2}x ${NC}\t\t\t: sudo systemctl start ${clientName2}x ${NC}"
|
echo -e "${GREEN_DARK}To start ${clientName}x ${NC}\t\t\t: sudo systemctl start ${clientName}x ${NC}"
|
||||||
echo -e "${GREEN_DARK}To start ${clientName2}-explorer ${NC}\t\t: sudo systemctl start ${clientName2}-explorer ${NC}"
|
echo -e "${GREEN_DARK}To start ${clientName}-explorer ${NC}\t\t: sudo systemctl start ${clientName}-explorer ${NC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# if [ ${openresty_work} = 'true' ]; then
|
|
||||||
# echo -e "${GREEN_DARK}To access ${productName2} ${NC}\t\t: use ${GREEN_UNDERLINE}${clientName2} -h $serverFqdn${NC} in shell OR from ${GREEN_UNDERLINE}http://127.0.0.1:${web_port}${NC}"
|
|
||||||
# else
|
|
||||||
# echo -e "${GREEN_DARK}To access ${productName2} ${NC}\t\t: use ${GREEN_UNDERLINE}${clientName2} -h $serverFqdn${NC} in shell${NC}"
|
|
||||||
# fi
|
|
||||||
|
|
||||||
# if ((${prompt_force} == 1)); then
|
|
||||||
# echo ""
|
|
||||||
# echo -e "${RED}Please run '${serverName2} --force-keep-file' at first time for the exist ${productName2} $exist_version!${NC}"
|
|
||||||
# fi
|
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "${productName2} is updated successfully!"
|
echo "${productName} is updated successfully!"
|
||||||
echo
|
echo
|
||||||
if [ "$verMode" == "cluster" ]; then
|
if [ "$verMode" == "cluster" ]; then
|
||||||
echo -e "\033[44;32;1mTo start all the components : ./start-all.sh${NC}"
|
echo -e "\033[44;32;1mTo start all the components : ./start-all.sh${NC}"
|
||||||
fi
|
fi
|
||||||
echo -e "\033[44;32;1mTo access ${productName2} : ${clientName2} -h $serverFqdn${NC}"
|
echo -e "\033[44;32;1mTo access ${productName} : ${clientName} -h $serverFqdn${NC}"
|
||||||
if [ "$verMode" == "cluster" ]; then
|
if [ "$verMode" == "cluster" ]; then
|
||||||
echo -e "\033[44;32;1mTo access the management system : http://$serverFqdn:6060${NC}"
|
echo -e "\033[44;32;1mTo access the management system : http://$serverFqdn:6060${NC}"
|
||||||
echo -e "\033[44;32;1mTo read the user manual : http://$serverFqdn:6060/docs${NC}"
|
echo -e "\033[44;32;1mTo read the user manual : http://$serverFqdn:6060/docs${NC}"
|
||||||
|
@ -993,7 +944,7 @@ function updateProduct() {
|
||||||
install_bin
|
install_bin
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo -e "\033[44;32;1m${productName2} client is updated successfully!${NC}"
|
echo -e "\033[44;32;1m${productName} client is updated successfully!${NC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd $script_dir
|
cd $script_dir
|
||||||
|
@ -1008,7 +959,7 @@ function installProduct() {
|
||||||
fi
|
fi
|
||||||
tar -zxf ${tarName}
|
tar -zxf ${tarName}
|
||||||
|
|
||||||
echo "Start to install ${productName2}..."
|
echo "Start to install ${productName}..."
|
||||||
|
|
||||||
install_main_path
|
install_main_path
|
||||||
|
|
||||||
|
@ -1026,78 +977,62 @@ function installProduct() {
|
||||||
|
|
||||||
if [ "$verMode" == "cluster" ]; then
|
if [ "$verMode" == "cluster" ]; then
|
||||||
install_connector
|
install_connector
|
||||||
install_taosx
|
install_plugins
|
||||||
fi
|
fi
|
||||||
install_examples
|
install_examples
|
||||||
install_web
|
|
||||||
if [ -z $1 ]; then # install service and client
|
if [ -z $1 ]; then # install service and client
|
||||||
# For installing new
|
# For installing new
|
||||||
install_bin
|
install_bin
|
||||||
install_service
|
install_services
|
||||||
install_adapter_service
|
|
||||||
|
if [ "${pagMode}" != "lite" ]; then
|
||||||
install_adapter_config
|
install_adapter_config
|
||||||
install_keeper_service
|
install_taosx_config
|
||||||
|
install_explorer_config
|
||||||
if [ "${verMode}" != "cloud" ]; then
|
if [ "${verMode}" != "cloud" ]; then
|
||||||
install_keeper_config
|
install_keeper_config
|
||||||
fi
|
fi
|
||||||
openresty_work=false
|
fi
|
||||||
|
|
||||||
|
openresty_work=false
|
||||||
|
|
||||||
# Ask if to start the service
|
# Ask if to start the service
|
||||||
echo
|
echo
|
||||||
echo -e "${GREEN_DARK}To configure ${productName2} ${NC}\t\t: edit ${cfg_install_dir}/${configFile2}"
|
echo -e "${GREEN_DARK}To configure ${productName} ${NC}\t\t: edit ${configDir}/${configFile}"
|
||||||
[ -f ${configDir}/${clientName2}adapter.toml ] && [ -f ${installDir}/bin/${clientName2}adapter ] && \
|
[ -f ${configDir}/${clientName}adapter.toml ] && [ -f ${installDir}/bin/${clientName}adapter ] &&
|
||||||
echo -e "${GREEN_DARK}To configure ${clientName2}Adapter ${NC}\t: edit ${configDir}/${clientName2}adapter.toml"
|
echo -e "${GREEN_DARK}To configure ${clientName}Adapter ${NC}\t: edit ${configDir}/${clientName}adapter.toml"
|
||||||
if [ "$verMode" == "cluster" ]; then
|
if [ "$verMode" == "cluster" ]; then
|
||||||
echo -e "${GREEN_DARK}To configure ${clientName2}-explorer ${NC}\t: edit ${configDir}/explorer.toml"
|
echo -e "${GREEN_DARK}To configure ${clientName}-explorer ${NC}\t: edit ${configDir}/explorer.toml"
|
||||||
fi
|
fi
|
||||||
if ((${service_mod} == 0)); then
|
if ((${service_mod} == 0)); then
|
||||||
echo -e "${GREEN_DARK}To start ${productName2} ${NC}\t\t: ${csudo}systemctl start ${serverName2}${NC}"
|
echo -e "${GREEN_DARK}To start ${productName} ${NC}\t\t: ${csudo}systemctl start ${serverName}${NC}"
|
||||||
[ -f ${service_config_dir}/${clientName2}adapter.service ] && [ -f ${installDir}/bin/${clientName2}adapter ] && \
|
[ -f ${service_config_dir}/${clientName}adapter.service ] && [ -f ${installDir}/bin/${clientName}adapter ] &&
|
||||||
echo -e "${GREEN_DARK}To start ${clientName2}Adapter ${NC}\t\t: ${csudo}systemctl start ${clientName2}adapter ${NC}"
|
echo -e "${GREEN_DARK}To start ${clientName}Adapter ${NC}\t\t: ${csudo}systemctl start ${clientName}adapter ${NC}"
|
||||||
elif ((${service_mod} == 1)); then
|
elif ((${service_mod} == 1)); then
|
||||||
echo -e "${GREEN_DARK}To start ${productName2} ${NC}\t\t: ${csudo}service ${serverName2} start${NC}"
|
echo -e "${GREEN_DARK}To start ${productName} ${NC}\t\t: ${csudo}service ${serverName} start${NC}"
|
||||||
[ -f ${service_config_dir}/${clientName2}adapter.service ] && [ -f ${installDir}/bin/${clientName2}adapter ] && \
|
[ -f ${service_config_dir}/${clientName}adapter.service ] && [ -f ${installDir}/bin/${clientName}adapter ] &&
|
||||||
echo -e "${GREEN_DARK}To start ${clientName2}Adapter ${NC}\t\t: ${csudo}service ${clientName2}adapter start${NC}"
|
echo -e "${GREEN_DARK}To start ${clientName}Adapter ${NC}\t\t: ${csudo}service ${clientName}adapter start${NC}"
|
||||||
else
|
else
|
||||||
echo -e "${GREEN_DARK}To start ${productName2} ${NC}\t\t: ${serverName2}${NC}"
|
echo -e "${GREEN_DARK}To start ${productName} ${NC}\t\t: ${serverName}${NC}"
|
||||||
[ -f ${installDir}/bin/${clientName2}adapter ] && \
|
[ -f ${installDir}/bin/${clientName}adapter ] &&
|
||||||
echo -e "${GREEN_DARK}To start ${clientName2}Adapter ${NC}\t\t: ${clientName2}adapter ${NC}"
|
echo -e "${GREEN_DARK}To start ${clientName}Adapter ${NC}\t\t: ${clientName}adapter ${NC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "${GREEN_DARK}To enable ${clientName2}keeper ${NC}\t\t: sudo systemctl enable ${clientName2}keeper ${NC}"
|
echo -e "${GREEN_DARK}To enable ${clientName}keeper ${NC}\t\t: sudo systemctl enable ${clientName}keeper ${NC}"
|
||||||
|
|
||||||
if [ "$verMode" == "cluster" ]; then
|
if [ "$verMode" == "cluster" ]; then
|
||||||
echo -e "${GREEN_DARK}To start ${clientName2}x ${NC}\t\t\t: sudo systemctl start ${clientName2}x ${NC}"
|
echo -e "${GREEN_DARK}To start ${clientName}x ${NC}\t\t\t: sudo systemctl start ${clientName}x ${NC}"
|
||||||
echo -e "${GREEN_DARK}To start ${clientName2}-explorer ${NC}\t\t: sudo systemctl start ${clientName2}-explorer ${NC}"
|
echo -e "${GREEN_DARK}To start ${clientName}-explorer ${NC}\t\t: sudo systemctl start ${clientName}-explorer ${NC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# if [ ! -z "$firstEp" ]; then
|
|
||||||
# tmpFqdn=${firstEp%%:*}
|
|
||||||
# substr=":"
|
|
||||||
# if [[ $firstEp =~ $substr ]]; then
|
|
||||||
# tmpPort=${firstEp#*:}
|
|
||||||
# else
|
|
||||||
# tmpPort=""
|
|
||||||
# fi
|
|
||||||
# if [[ "$tmpPort" != "" ]]; then
|
|
||||||
# echo -e "${GREEN_DARK}To access ${productName2} ${NC}\t\t: ${clientName2} -h $tmpFqdn -P $tmpPort${GREEN_DARK} to login into cluster, then${NC}"
|
|
||||||
# else
|
|
||||||
# echo -e "${GREEN_DARK}To access ${productName2} ${NC}\t\t: ${clientName2} -h $tmpFqdn${GREEN_DARK} to login into cluster, then${NC}"
|
|
||||||
# fi
|
|
||||||
# echo -e "${GREEN_DARK}execute ${NC}: create dnode 'newDnodeFQDN:port'; ${GREEN_DARK}to add this new node${NC}"
|
|
||||||
# echo
|
|
||||||
# elif [ ! -z "$serverFqdn" ]; then
|
|
||||||
# echo -e "${GREEN_DARK}To access ${productName2} ${NC}\t\t: ${clientName2} -h $serverFqdn${GREEN_DARK} to login into ${productName2} server${NC}"
|
|
||||||
# echo
|
|
||||||
# fi
|
|
||||||
echo
|
echo
|
||||||
echo "${productName2} is installed successfully!"
|
echo "${productName} is installed successfully!"
|
||||||
echo
|
echo
|
||||||
if [ "$verMode" == "cluster" ]; then
|
if [ "$verMode" == "cluster" ]; then
|
||||||
echo -e "\033[44;32;1mTo start all the components : sudo ./start-all.sh${NC}"
|
echo -e "\033[44;32;1mTo start all the components : sudo ./start-all.sh${NC}"
|
||||||
fi
|
fi
|
||||||
echo -e "\033[44;32;1mTo access ${productName2} : ${clientName2} -h $serverFqdn${NC}"
|
echo -e "\033[44;32;1mTo access ${productName} : ${clientName} -h $serverFqdn${NC}"
|
||||||
if [ "$verMode" == "cluster" ]; then
|
if [ "$verMode" == "cluster" ]; then
|
||||||
echo -e "\033[44;32;1mTo access the management system : http://$serverFqdn:6060${NC}"
|
echo -e "\033[44;32;1mTo access the management system : http://$serverFqdn:6060${NC}"
|
||||||
echo -e "\033[44;32;1mTo read the user manual : http://$serverFqdn:6060/docs-en${NC}"
|
echo -e "\033[44;32;1mTo read the user manual : http://$serverFqdn:6060/docs-en${NC}"
|
||||||
|
@ -1107,7 +1042,7 @@ function installProduct() {
|
||||||
install_bin
|
install_bin
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo -e "\033[44;32;1m${productName2} client is installed successfully!${NC}"
|
echo -e "\033[44;32;1m${productName} client is installed successfully!${NC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd $script_dir
|
cd $script_dir
|
||||||
|
@ -1115,15 +1050,40 @@ function installProduct() {
|
||||||
rm -rf $(tar -tf ${tarName} | grep -Ev "^\./$|^\/")
|
rm -rf $(tar -tf ${tarName} | grep -Ev "^\./$|^\/")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_java_env() {
|
||||||
|
if ! command -v java &> /dev/null
|
||||||
|
then
|
||||||
|
echo -e "\033[31mWarning: Java command not found. Version 1.8+ is required.\033[0m"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
java_version=$(java -version 2>&1 | awk -F '"' '/version/ {print $2}')
|
||||||
|
java_version_ok=false
|
||||||
|
if [[ $(echo "$java_version" | cut -d"." -f1) -gt 1 ]]; then
|
||||||
|
java_version_ok=true
|
||||||
|
elif [[ $(echo "$java_version" | cut -d"." -f1) -eq 1 && $(echo "$java_version" | cut -d"." -f2) -ge 8 ]]; then
|
||||||
|
java_version_ok=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
if $java_version_ok; then
|
||||||
|
echo -e "\033[32mJava ${java_version} has been found.\033[0m"
|
||||||
|
else
|
||||||
|
echo -e "\033[31mWarning: Java Version 1.8+ is required, but version ${java_version} has been found.\033[0m"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
## ==============================Main program starts from here============================
|
## ==============================Main program starts from here============================
|
||||||
serverFqdn=$(hostname)
|
serverFqdn=$(hostname)
|
||||||
if [ "$verType" == "server" ]; then
|
if [ "$verType" == "server" ]; then
|
||||||
|
if [ -x ${script_dir}/${xname}/bin/${xname} ]; then
|
||||||
|
check_java_env
|
||||||
|
fi
|
||||||
# Check default 2.x data file.
|
# Check default 2.x data file.
|
||||||
if [ -x ${data_dir}/dnode/dnodeCfg.json ]; then
|
if [ -x ${dataDir}/dnode/dnodeCfg.json ]; then
|
||||||
echo -e "\033[44;31;5mThe default data directory ${data_dir} contains old data of ${productName2} 2.x, please clear it before installing!\033[0m"
|
echo -e "\033[44;31;5mThe default data directory ${dataDir} contains old data of ${productName} 2.x, please clear it before installing!\033[0m"
|
||||||
else
|
else
|
||||||
# Install server and client
|
# Install server and client
|
||||||
if [ -x ${bin_dir}/${serverName2} ]; then
|
if [ -x ${bin_dir}/${serverName} ]; then
|
||||||
update_flag=1
|
update_flag=1
|
||||||
updateProduct
|
updateProduct
|
||||||
else
|
else
|
||||||
|
@ -1133,7 +1093,7 @@ if [ "$verType" == "server" ]; then
|
||||||
elif [ "$verType" == "client" ]; then
|
elif [ "$verType" == "client" ]; then
|
||||||
interactiveFqdn=no
|
interactiveFqdn=no
|
||||||
# Only install client
|
# Only install client
|
||||||
if [ -x ${bin_dir}/${clientName2} ]; then
|
if [ -x ${bin_dir}/${clientName} ]; then
|
||||||
update_flag=1
|
update_flag=1
|
||||||
updateProduct client
|
updateProduct client
|
||||||
else
|
else
|
||||||
|
@ -1142,5 +1102,3 @@ elif [ "$verType" == "client" ]; then
|
||||||
else
|
else
|
||||||
echo "please input correct verType"
|
echo "please input correct verType"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -231,12 +231,8 @@ fi
|
||||||
|
|
||||||
if [ "$verMode" == "cluster" ]; then
|
if [ "$verMode" == "cluster" ]; then
|
||||||
sed 's/verMode=edge/verMode=cluster/g' ${install_dir}/bin/remove.sh >>remove_temp.sh
|
sed 's/verMode=edge/verMode=cluster/g' ${install_dir}/bin/remove.sh >>remove_temp.sh
|
||||||
sed -i "s/serverName2=\"taosd\"/serverName2=\"${serverName2}\"/g" remove_temp.sh
|
sed -i "s/PREFIX=\"taos\"/PREFIX=\"${serverName2}\"/g" remove_temp.sh
|
||||||
sed -i "s/clientName2=\"taos\"/clientName2=\"${clientName2}\"/g" remove_temp.sh
|
sed -i "s/productName=\"TDengine\"/productName=\"${productName2}\"/g" remove_temp.sh
|
||||||
sed -i "s/configFile2=\"taos.cfg\"/configFile2=\"${clientName2}.cfg\"/g" remove_temp.sh
|
|
||||||
sed -i "s/productName2=\"TDengine\"/productName2=\"${productName2}\"/g" remove_temp.sh
|
|
||||||
cusDomain=`echo "${cusEmail2}" | sed 's/^[^@]*@//'`
|
|
||||||
sed -i "s/emailName2=\"taosdata.com\"/emailName2=\"${cusDomain}\"/g" remove_temp.sh
|
|
||||||
mv remove_temp.sh ${install_dir}/bin/remove.sh
|
mv remove_temp.sh ${install_dir}/bin/remove.sh
|
||||||
fi
|
fi
|
||||||
if [ "$verMode" == "cloud" ]; then
|
if [ "$verMode" == "cloud" ]; then
|
||||||
|
@ -262,12 +258,10 @@ cp ${install_files} ${install_dir}
|
||||||
cp ${install_dir}/install.sh install_temp.sh
|
cp ${install_dir}/install.sh install_temp.sh
|
||||||
if [ "$verMode" == "cluster" ]; then
|
if [ "$verMode" == "cluster" ]; then
|
||||||
sed -i 's/verMode=edge/verMode=cluster/g' install_temp.sh
|
sed -i 's/verMode=edge/verMode=cluster/g' install_temp.sh
|
||||||
sed -i "s/serverName2=\"taosd\"/serverName2=\"${serverName2}\"/g" install_temp.sh
|
sed -i "s/PREFIX=\"taos\"/PREFIX=\"${serverName2}\"/g" install_temp.sh
|
||||||
sed -i "s/clientName2=\"taos\"/clientName2=\"${clientName2}\"/g" install_temp.sh
|
sed -i "s/productName=\"TDengine\"/productName=\"${productName2}\"/g" install_temp.sh
|
||||||
sed -i "s/configFile2=\"taos.cfg\"/configFile2=\"${clientName2}.cfg\"/g" install_temp.sh
|
|
||||||
sed -i "s/productName2=\"TDengine\"/productName2=\"${productName2}\"/g" install_temp.sh
|
|
||||||
cusDomain=`echo "${cusEmail2}" | sed 's/^[^@]*@//'`
|
cusDomain=`echo "${cusEmail2}" | sed 's/^[^@]*@//'`
|
||||||
sed -i "s/emailName2=\"taosdata.com\"/emailName2=\"${cusDomain}\"/g" install_temp.sh
|
sed -i "s/emailName=\"taosdata.com\"/emailName=\"${cusDomain}\"/g" install_temp.sh
|
||||||
mv install_temp.sh ${install_dir}/install.sh
|
mv install_temp.sh ${install_dir}/install.sh
|
||||||
fi
|
fi
|
||||||
if [ "$verMode" == "cloud" ]; then
|
if [ "$verMode" == "cloud" ]; then
|
||||||
|
@ -368,7 +362,6 @@ if [ "$verMode" == "cluster" ]; then
|
||||||
# copy taosx
|
# copy taosx
|
||||||
if [ -d ${top_dir}/../enterprise/src/plugins/taosx/release/taosx ]; then
|
if [ -d ${top_dir}/../enterprise/src/plugins/taosx/release/taosx ]; then
|
||||||
cp -r ${top_dir}/../enterprise/src/plugins/taosx/release/taosx ${install_dir}
|
cp -r ${top_dir}/../enterprise/src/plugins/taosx/release/taosx ${install_dir}
|
||||||
cp ${top_dir}/../enterprise/packaging/install_taosx.sh ${install_dir}/taosx
|
|
||||||
cp ${top_dir}/../enterprise/src/plugins/taosx/packaging/uninstall.sh ${install_dir}/taosx
|
cp ${top_dir}/../enterprise/src/plugins/taosx/packaging/uninstall.sh ${install_dir}/taosx
|
||||||
sed -i 's/target=\"\"/target=\"taosx\"/g' ${install_dir}/taosx/uninstall.sh
|
sed -i 's/target=\"\"/target=\"taosx\"/g' ${install_dir}/taosx/uninstall.sh
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue