提交 81d3bafb 编写于 作者: Z zyyang

Merge remote-tracking branch 'origin/master' into fix/TS-601

#!/bin/bash
#Startup script for the nginx Web Server
# chkconfig: 2345 99 01
# description: Nginx For TDengine Service.
#
#
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $local_fs $network $syslog
# Required-Stop: $local_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts nginx
# Description: Starts nginx.
### END INIT INFO
nginx=/usr/local/nginxd/sbin/nginx
case $1 in
start)
echo -n "Starting Nginx"
$nginx
echo " done."
;;
stop)
echo -n "Stopping Nginx"
$nginx -s stop
echo " done."
;;
test)
$nginx -t
echo "Success."
;;
reload)
echo -n "Reloading Nginx"
$nginx -s reload
echo " done."
;;
restart)
$nginx -s reload
echo "reload done."
;;
*)
echo "Usage: $0 {start|restart|reload|stop|test|show}"
;;
esac
#!/bin/bash
#Startup script for the nginx Web Server
# chkconfig: 2345 99 01
#
#
### BEGIN INIT INFO
# Provides: nginx
# Provides: nginx
# Required-Start: $local_fs $network $syslog
# Required-Stop: $local_fs $network $syslog
# Short-Description: Starts nginx
# Description: Starts nginx.
### END INIT INFO
nginx=/usr/local/nginxd/sbin/nginx
case $1 in
start)
echo -n "Starting Nginx"
$nginx
echo " done."
;;
stop)
echo -n "Stopping Nginx"
$nginx -s stop
echo " done."
;;
test)
$nginx -t
echo "Success."
;;
reload)
echo -n "Reloading Nginx"
$nginx -s reload
echo " done."
;;
restart)
$nginx -s reload
echo "reload done."
;;
*)
echo "Usage: $0 {start|restart|reload|stop|test|show}"
;;
esac
......@@ -582,6 +582,26 @@ function clean_service_on_sysvinit() {
${csudo} rm -f ${service_config_dir}/taosd || :
${csudo} rm -f ${service_config_dir}/tarbitratord || :
if [ "$verMode" == "cluster" ]; then\
if pidof nginxd ; then
${csudo} service nginxd stop || :
fi
if ((${initd_mod}==1)); then
if [ -e ${service_config_dir}/nginxd ]; then
${csudo} chkconfig --del nginxd || :
fi
elif ((${initd_mod}==2)); then
if [ -e ${service_config_dir}/nginxd ]; then
${csudo} insserv -r nginxd || :
fi
elif ((${initd_mod}==3)); then
if [ -e ${service_config_dir}/nginxd ]; then
${csudo} update-rc.d -f nginxd remove || :
fi
fi
${csudo} rm -f ${service_config_dir}/nginxd || :
fi
if $(which init &> /dev/null); then
${csudo} init q || :
fi
......@@ -598,11 +618,19 @@ function install_service_on_sysvinit() {
${csudo} cp ${script_dir}/init.d/taosd.deb ${service_config_dir}/taosd && ${csudo} chmod a+x ${service_config_dir}/taosd
${csudo} cp -f ${script_dir}/init.d/tarbitratord.deb ${install_main_dir}/init.d/tarbitratord
${csudo} cp ${script_dir}/init.d/tarbitratord.deb ${service_config_dir}/tarbitratord && ${csudo} chmod a+x ${service_config_dir}/tarbitratord
if [ "$verMode" == "cluster" ]; then
${csudo} cp -f ${script_dir}/init.d/nginxd.deb ${install_main_dir}/init.d/nginxd
${csudo} cp ${script_dir}/init.d/nginxd.deb ${service_config_dir}/nginxd && ${csudo} chmod a+x ${service_config_dir}/nginxd
fi
elif ((${os_type}==2)); then
${csudo} cp -f ${script_dir}/init.d/taosd.rpm ${install_main_dir}/init.d/taosd
${csudo} cp ${script_dir}/init.d/taosd.rpm ${service_config_dir}/taosd && ${csudo} chmod a+x ${service_config_dir}/taosd
${csudo} cp -f ${script_dir}/init.d/tarbitratord.rpm ${install_main_dir}/init.d/tarbitratord
${csudo} cp ${script_dir}/init.d/tarbitratord.rpm ${service_config_dir}/tarbitratord && ${csudo} chmod a+x ${service_config_dir}/tarbitratord
if [ "$verMode" == "cluster" ]; then
${csudo} cp -f ${script_dir}/init.d/nginxd.rpm ${install_main_dir}/init.d/nginxd
${csudo} cp ${script_dir}/init.d/nginxd.rpm ${service_config_dir}/nginxd && ${csudo} chmod a+x ${service_config_dir}/nginxd
fi
fi
#restart_config_str="taos:2345:respawn:${service_config_dir}/taosd start"
......@@ -613,14 +641,26 @@ function install_service_on_sysvinit() {
${csudo} chkconfig --level 2345 taosd on || :
${csudo} chkconfig --add tarbitratord || :
${csudo} chkconfig --level 2345 tarbitratord on || :
if [ "$verMode" == "cluster" ]; then
${csudo} chkconfig --add nginxd || :
${csudo} chkconfig --level 0123456 nginxd on || :
${csudo} service nginxd start
fi
elif ((${initd_mod}==2)); then
${csudo} insserv taosd || :
${csudo} insserv -d taosd || :
${csudo} insserv tarbitratord || :
${csudo} insserv -d tarbitratord || :
if [ "$verMode" == "cluster" ]; then
${csudo} insserv nginxd || :
${csudo} insserv -d nginxd || :
fi
elif ((${initd_mod}==3)); then
${csudo} update-rc.d taosd defaults || :
${csudo} update-rc.d tarbitratord defaults || :
if [ "$verMode" == "cluster" ]; then
${csudo} update-rc.d nginxd defaults || :
fi
fi
}
......@@ -779,7 +819,7 @@ vercomp () {
function is_version_compatible() {
curr_version=`ls ${script_dir}/driver/libtaos.so* |cut -d '.' -f 3-6`
curr_version=`ls ${script_dir}/driver/libtaos.so* | awk -F 'libtaos.so.' '{print $2}'`
if [ -f ${script_dir}/driver/vercomp.txt ]; then
min_compatible_version=`cat ${script_dir}/driver/vercomp.txt`
......
......@@ -63,6 +63,8 @@ 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_rpm=${script_dir}/../rpm/tarbitratord
init_file_nginx_deb=${script_dir}/../deb/nginxd
init_file_nginx_rpm=${script_dir}/../rpm/nginxd
# make directories.
mkdir -p ${install_dir}
......@@ -73,6 +75,8 @@ mkdir -p ${install_dir}/init.d && cp ${init_file_deb} ${install_dir}/init.d/taos
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_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_nginx_deb} ${install_dir}/init.d/nginxd.deb || :
mkdir -p ${install_dir}/init.d && cp ${init_file_nginx_rpm} ${install_dir}/init.d/nginxd.rpm || :
if [ -f ${build_dir}/bin/jemalloc-config ]; then
mkdir -p ${install_dir}/jemalloc/{bin,lib,lib/pkgconfig,include/jemalloc,share/doc/jemalloc,share/man/man3}
......
......@@ -3145,12 +3145,16 @@ int tscRenewTableMeta(SSqlObj *pSql, int32_t tableIndex) {
pSql->rootObj->retryReason = pSql->retryReason;
SSqlObj *tmpSql = pSql->rootObj;
tscFreeSubobj(pSql->rootObj);
tfree(tmpSql->pSubs);
SArray* pNameList = taosArrayInit(1, POINTER_BYTES);
SArray* vgroupList = taosArrayInit(1, POINTER_BYTES);
char* n = strdup(name);
taosArrayPush(pNameList, &n);
code = getMultiTableMetaFromMnode(pSql, pNameList, vgroupList, NULL, tscTableMetaCallBack, true);
code = getMultiTableMetaFromMnode(tmpSql, pNameList, vgroupList, NULL, tscTableMetaCallBack, true);
taosArrayDestroyEx(pNameList, freeElem);
taosArrayDestroyEx(vgroupList, freeElem);
......
......@@ -32,33 +32,48 @@ sql create dnode $hostname3
system sh/exec.sh -n dnode3 -s start
sleep 3000
$x = 0
show1:
$x = $x + 1
sleep 1000
if $x == 30 then
return -1
endi
sql show dnodes
print dnode1 $data5_1
print dnode1 $data5_2
print dnode1 $data5_3
print dnode2 $data5_2
print dnode3 $data5_3
if $data5_1 != mnode then
return -1
goto show1
endi
if $data5_2 != vnode then
return -1
goto show1
endi
if $data5_3 != any then
return -1
goto show1
endi
show2:
$x = $x + 1
sleep 1000
if $x == 30 then
return -1
endi
sql show mnodes
print dnode1 ==> $data2_1
print dnode2 ==> $data2_2
print dnode3 ==> $data2_3
if $data2_1 != master then
return -1
goto show2
endi
if $data2_2 != null then
return -1
goto show2
endi
if $data2_3 != slave then
return -1
goto show2
endi
print ========== step2
......@@ -72,26 +87,28 @@ sql create table d1.t6 (ts timestamp, i int)
sql create table d1.t7 (ts timestamp, i int)
sql create table d1.t8 (ts timestamp, i int)
show3:
$x = $x + 1
sleep 1000
if $x == 30 then
return -1
endi
sql show dnodes
print dnode1 $data2_1
print dnode2 $data2_2
print dnode3 $data2_3
if $data2_1 != 0 then
return -1
goto show3
endi
if $data2_2 != 1 then
return -1
goto show3
endi
if $data2_3 != 1 then
return -1
goto show3
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT
\ No newline at end of file
system sh/exec.sh -n dnode4 -s stop -x SIGINT
system sh/exec.sh -n dnode5 -s stop -x SIGINT
system sh/exec.sh -n dnode6 -s stop -x SIGINT
system sh/exec.sh -n dnode7 -s stop -x SIGINT
system sh/exec.sh -n dnode8 -s stop -x SIGINT
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册