[modify]
This commit is contained in:
parent
8134cedd57
commit
1242ae5e1e
|
@ -31,7 +31,7 @@ install_main_dir="/usr/local/taos"
|
||||||
bin_dir="/usr/local/taos/bin"
|
bin_dir="/usr/local/taos/bin"
|
||||||
|
|
||||||
# v1.5 jar dir
|
# v1.5 jar dir
|
||||||
v15_java_app_dir="/usr/local/lib/taos"
|
#v15_java_app_dir="/usr/local/lib/taos"
|
||||||
|
|
||||||
service_config_dir="/etc/systemd/system"
|
service_config_dir="/etc/systemd/system"
|
||||||
nginx_port=6060
|
nginx_port=6060
|
||||||
|
@ -189,19 +189,19 @@ function install_bin() {
|
||||||
function install_lib() {
|
function install_lib() {
|
||||||
# Remove links
|
# Remove links
|
||||||
${csudo} rm -f ${lib_link_dir}/libtaos.* || :
|
${csudo} rm -f ${lib_link_dir}/libtaos.* || :
|
||||||
${csudo} rm -rf ${v15_java_app_dir} || :
|
#${csudo} rm -rf ${v15_java_app_dir} || :
|
||||||
|
|
||||||
${csudo} cp -rf ${script_dir}/driver/* ${install_main_dir}/driver && ${csudo} chmod 777 ${install_main_dir}/driver/*
|
${csudo} cp -rf ${script_dir}/driver/* ${install_main_dir}/driver && ${csudo} chmod 777 ${install_main_dir}/driver/*
|
||||||
|
|
||||||
${csudo} ln -s ${install_main_dir}/driver/libtaos.* ${lib_link_dir}/libtaos.so.1
|
${csudo} ln -s ${install_main_dir}/driver/libtaos.* ${lib_link_dir}/libtaos.so.1
|
||||||
${csudo} ln -s ${lib_link_dir}/libtaos.so.1 ${lib_link_dir}/libtaos.so
|
${csudo} ln -s ${lib_link_dir}/libtaos.so.1 ${lib_link_dir}/libtaos.so
|
||||||
|
|
||||||
if [ "$verMode" == "cluster" ]; then
|
#if [ "$verMode" == "cluster" ]; then
|
||||||
# Compatible with version 1.5
|
# # Compatible with version 1.5
|
||||||
${csudo} mkdir -p ${v15_java_app_dir}
|
# ${csudo} mkdir -p ${v15_java_app_dir}
|
||||||
${csudo} ln -s ${install_main_dir}/connector/taos-jdbcdriver-1.0.2-dist.jar ${v15_java_app_dir}/JDBCDriver-1.0.2-dist.jar
|
# ${csudo} ln -s ${install_main_dir}/connector/taos-jdbcdriver-1.0.2-dist.jar ${v15_java_app_dir}/JDBCDriver-1.0.2-dist.jar
|
||||||
${csudo} chmod 777 ${v15_java_app_dir} || :
|
# ${csudo} chmod 777 ${v15_java_app_dir} || :
|
||||||
fi
|
#fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_header() {
|
function install_header() {
|
||||||
|
@ -223,42 +223,39 @@ function install_config() {
|
||||||
${csudo} cp -f ${script_dir}/cfg/taos.cfg ${install_main_dir}/cfg/taos.cfg.org
|
${csudo} cp -f ${script_dir}/cfg/taos.cfg ${install_main_dir}/cfg/taos.cfg.org
|
||||||
${csudo} ln -s ${cfg_install_dir}/taos.cfg ${install_main_dir}/cfg
|
${csudo} ln -s ${cfg_install_dir}/taos.cfg ${install_main_dir}/cfg
|
||||||
|
|
||||||
if [ "$verMode" == "cluster" ]; then
|
[ ! -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
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#FQDN_FORMAT="(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)"
|
#FQDN_FORMAT="(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)"
|
||||||
#FQDN_FORMAT="(:[1-6][0-9][0-9][0-9][0-9]$)"
|
#FQDN_FORMAT="(:[1-6][0-9][0-9][0-9][0-9]$)"
|
||||||
#PORT_FORMAT="(/[1-6][0-9][0-9][0-9][0-9]?/)"
|
#PORT_FORMAT="(/[1-6][0-9][0-9][0-9][0-9]?/)"
|
||||||
#FQDN_PATTERN=":[0-9]{1,5}$"
|
#FQDN_PATTERN=":[0-9]{1,5}$"
|
||||||
|
|
||||||
# first full-qualified domain name (FQDN) for TDengine cluster system
|
# first full-qualified domain name (FQDN) for TDengine cluster system
|
||||||
echo
|
echo
|
||||||
echo -e -n "${GREEN}Enter FQDN:port (like h1.taosdata.com:6030) of an existing TDengine cluster node to join OR leave it blank to build one${NC} :"
|
echo -e -n "${GREEN}Enter FQDN:port (like h1.taosdata.com:6030) of an existing TDengine cluster node to join 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
|
||||||
# check the format of the firstEp
|
# check the format of the firstEp
|
||||||
#if [[ $firstEp == $FQDN_PATTERN ]]; then
|
#if [[ $firstEp == $FQDN_PATTERN ]]; then
|
||||||
# Write the first FQDN to configuration file
|
# Write the first FQDN to configuration file
|
||||||
${csudo} sed -i -r "s/#*\s*(firstEp\s*).*/\1$firstEp/" ${cfg_install_dir}/taos.cfg
|
${csudo} sed -i -r "s/#*\s*(firstEp\s*).*/\1$firstEp/" ${cfg_install_dir}/taos.cfg
|
||||||
break
|
|
||||||
#else
|
|
||||||
# read -p "Please enter the correct FQDN:port: " firstEp
|
|
||||||
#fi
|
|
||||||
else
|
|
||||||
break
|
break
|
||||||
fi
|
#else
|
||||||
done
|
# read -p "Please enter the correct FQDN:port: " firstEp
|
||||||
|
#fi
|
||||||
fi
|
else
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -563,12 +560,11 @@ function update_TDengine() {
|
||||||
if [ -z $1 ]; then
|
if [ -z $1 ]; then
|
||||||
install_bin
|
install_bin
|
||||||
install_service
|
install_service
|
||||||
install_config
|
install_config
|
||||||
|
|
||||||
|
openresty_work=false
|
||||||
if [ "$verMode" == "cluster" ]; then
|
if [ "$verMode" == "cluster" ]; then
|
||||||
# Check if openresty is installed
|
# Check if openresty is installed
|
||||||
openresty_work=false
|
|
||||||
|
|
||||||
# Check if nginx is installed successfully
|
# Check if nginx is installed successfully
|
||||||
if type curl &> /dev/null; then
|
if type curl &> /dev/null; then
|
||||||
if curl -sSf http://127.0.0.1:${nginx_port} &> /dev/null; then
|
if curl -sSf http://127.0.0.1:${nginx_port} &> /dev/null; then
|
||||||
|
@ -580,8 +576,8 @@ function update_TDengine() {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo
|
#echo
|
||||||
echo -e "\033[44;32;1mTDengine is updated successfully!${NC}"
|
#echo -e "\033[44;32;1mTDengine is updated successfully!${NC}"
|
||||||
echo
|
echo
|
||||||
echo -e "${GREEN_DARK}To configure TDengine ${NC}: edit /etc/taos/taos.cfg"
|
echo -e "${GREEN_DARK}To configure TDengine ${NC}: edit /etc/taos/taos.cfg"
|
||||||
if ((${service_mod}==0)); then
|
if ((${service_mod}==0)); then
|
||||||
|
@ -592,15 +588,12 @@ function update_TDengine() {
|
||||||
echo -e "${GREEN_DARK}To start TDengine ${NC}: ./taosd${NC}"
|
echo -e "${GREEN_DARK}To start TDengine ${NC}: ./taosd${NC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$verMode" == "cluster" ]; then
|
if [ ${openresty_work} = 'true' ]; then
|
||||||
if [ ${openresty_work} = 'true' ]; then
|
echo -e "${GREEN_DARK}To access TDengine ${NC}: use ${GREEN_UNDERLINE}taos${NC} in shell OR from ${GREEN_UNDERLINE}http://127.0.0.1:${nginx_port}${NC}"
|
||||||
echo -e "${GREEN_DARK}To access TDengine ${NC}: use ${GREEN_UNDERLINE}taos${NC} in shell OR from ${GREEN_UNDERLINE}http://127.0.0.1:${nginx_port}${NC}"
|
|
||||||
else
|
|
||||||
echo -e "${GREEN_DARK}To access TDengine ${NC}: use ${GREEN_UNDERLINE}taos${NC} in shell${NC}"
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
echo -e "${GREEN_DARK}To access TDengine ${NC}: use ${GREEN_UNDERLINE}taos${NC} in shell${NC}"
|
echo -e "${GREEN_DARK}To access TDengine ${NC}: use ${GREEN_UNDERLINE}taos${NC} in shell${NC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo -e "\033[44;32;1mTDengine is updated successfully!${NC}"
|
echo -e "\033[44;32;1mTDengine is updated successfully!${NC}"
|
||||||
else
|
else
|
||||||
|
@ -643,8 +636,8 @@ function install_TDengine() {
|
||||||
install_bin
|
install_bin
|
||||||
install_service
|
install_service
|
||||||
|
|
||||||
if [ "$verMode" == "cluster" ]; then
|
openresty_work=false
|
||||||
openresty_work=false
|
if [ "$verMode" == "cluster" ]; then
|
||||||
# Check if nginx is installed successfully
|
# Check if nginx is installed successfully
|
||||||
if type curl &> /dev/null; then
|
if type curl &> /dev/null; then
|
||||||
if curl -sSf http://127.0.0.1:${nginx_port} &> /dev/null; then
|
if curl -sSf http://127.0.0.1:${nginx_port} &> /dev/null; then
|
||||||
|
@ -669,21 +662,19 @@ function install_TDengine() {
|
||||||
echo -e "${GREEN_DARK}To start TDengine ${NC}: ${csudo} service taosd start${NC}"
|
echo -e "${GREEN_DARK}To start TDengine ${NC}: ${csudo} service taosd start${NC}"
|
||||||
else
|
else
|
||||||
echo -e "${GREEN_DARK}To start TDengine ${NC}: taosd${NC}"
|
echo -e "${GREEN_DARK}To start TDengine ${NC}: taosd${NC}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ${openresty_work} = 'true' ]; then
|
||||||
|
echo -e "${GREEN_DARK}To access TDengine ${NC}: use ${GREEN_UNDERLINE}taos${NC} in shell OR from ${GREEN_UNDERLINE}http://127.0.0.1:${nginx_port}${NC}"
|
||||||
|
else
|
||||||
|
echo -e "${GREEN_DARK}To access TDengine ${NC}: use ${GREEN_UNDERLINE}taos${NC} in shell${NC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$verMode" == "cluster" ]; then
|
if [ ! -z "$firstEp" ]; then
|
||||||
if [ ${openresty_work} = 'true' ]; then
|
echo
|
||||||
echo -e "${GREEN_DARK}To access TDengine ${NC}: use ${GREEN_UNDERLINE}taos${NC} in shell OR from ${GREEN_UNDERLINE}http://127.0.0.1:${nginx_port}${NC}"
|
echo -e "${GREEN_DARK}Please run${NC}: taos -h $firstEp ${GREEN_DARK} to login into cluster, then execute ${NC}: create dnode 'newDnodeFQDN:port'; ${GREEN_DARK}in TAOS shell to add this new node into the clsuter${NC}"
|
||||||
else
|
echo
|
||||||
echo -e "${GREEN_DARK}To access TDengine ${NC}: use ${GREEN_UNDERLINE}taos${NC} in shell${NC}"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo -e "${GREEN_DARK}To access TDengine ${NC}: use ${GREEN_UNDERLINE}taos${NC} in shell${NC}"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo
|
|
||||||
echo -e "${GREEN_DARK}Please run${NC}: taos -h $firstEp ${GREEN_DARK} to login into cluster, then execute ${NC}: create dnode 'newDnodeFQDN:port'; ${GREEN_DARK}in TAOS shell to add this new node into the clsuter${NC}"
|
|
||||||
echo
|
|
||||||
echo -e "\033[44;32;1mTDengine is installed successfully!${NC}"
|
echo -e "\033[44;32;1mTDengine is installed successfully!${NC}"
|
||||||
echo
|
echo
|
||||||
else # Only install client
|
else # Only install client
|
||||||
|
|
Loading…
Reference in New Issue