未验证 提交 a1cdba1d 编写于 作者: M Minglei Jin 提交者: GitHub

Merge pull request #9665 from taosdata/release/TS-997

[TS-997]<release>(other): linux and windows release script modify
......@@ -50,7 +50,6 @@ SET(TD_MEM_CHECK FALSE)
SET(TD_PAGMODE_LITE FALSE)
SET(TD_SOMODE_STATIC FALSE)
SET(TD_POWER FALSE)
SET(TD_GODLL FALSE)
SET(TD_COMMUNITY_DIR ${PROJECT_SOURCE_DIR})
......
......@@ -41,26 +41,6 @@ IF (TD_GODLL)
ADD_DEFINITIONS(-D_TD_GO_DLL_)
ENDIF ()
IF (TD_POWER)
ADD_DEFINITIONS(-D_TD_POWER_)
ENDIF ()
IF (TD_TQ)
ADD_DEFINITIONS(-D_TD_TQ_)
ENDIF ()
IF (TD_PRO)
ADD_DEFINITIONS(-D_TD_PRO_)
ENDIF ()
IF (TD_KH)
ADD_DEFINITIONS(-D_TD_KH_)
ENDIF ()
IF (TD_JH)
ADD_DEFINITIONS(-D_TD_JH_)
ENDIF ()
IF (TD_MEM_CHECK)
ADD_DEFINITIONS(-DTAOS_MEM_CHECK)
ENDIF ()
......
......@@ -43,23 +43,6 @@ IF (${SOMODE} MATCHES "static")
MESSAGE(STATUS "Link so using static mode")
ENDIF ()
IF (${DBNAME} MATCHES "power")
SET(TD_POWER TRUE)
MESSAGE(STATUS "power is true")
ELSEIF (${DBNAME} MATCHES "tq")
SET(TD_TQ TRUE)
MESSAGE(STATUS "tq is true")
ELSEIF (${DBNAME} MATCHES "pro")
SET(TD_PRO TRUE)
MESSAGE(STATUS "pro is true")
ELSEIF (${DBNAME} MATCHES "kh")
SET(TD_KH TRUE)
MESSAGE(STATUS "kh is true")
ELSEIF (${DBNAME} MATCHES "jh")
SET(TD_JH TRUE)
MESSAGE(STATUS "jh is true")
ENDIF ()
IF (${DLLTYPE} MATCHES "go")
SET(TD_GODLL TRUE)
MESSAGE(STATUS "input dll type: " ${DLLTYPE})
......
......@@ -3,48 +3,24 @@ IF (TD_LINUX)
INSTALL(CODE "MESSAGE(\"make install script: ${TD_MAKE_INSTALL_SH}\")")
INSTALL(CODE "execute_process(COMMAND bash ${TD_MAKE_INSTALL_SH} ${TD_COMMUNITY_DIR} ${PROJECT_BINARY_DIR} Linux ${TD_VER_NUMBER})")
ELSEIF (TD_WINDOWS)
IF (TD_POWER)
SET(CMAKE_INSTALL_PREFIX C:/PowerDB)
ELSEIF (TD_TQ)
SET(CMAKE_INSTALL_PREFIX C:/TQueue)
ELSEIF (TD_PRO)
SET(CMAKE_INSTALL_PREFIX C:/ProDB)
ELSEIF (TD_KH)
SET(CMAKE_INSTALL_PREFIX C:/KingHistorian)
ELSEIF (TD_JH)
SET(CMAKE_INSTALL_PREFIX C:/jh_iot)
ELSE ()
SET(CMAKE_INSTALL_PREFIX C:/TDengine)
ENDIF ()
SET(CMAKE_INSTALL_PREFIX C:/TDengine)
INSTALL(DIRECTORY ${TD_COMMUNITY_DIR}/src/connector/go DESTINATION connector)
INSTALL(DIRECTORY ${TD_COMMUNITY_DIR}/src/connector/nodejs DESTINATION connector)
INSTALL(DIRECTORY ${TD_COMMUNITY_DIR}/src/connector/python DESTINATION connector)
INSTALL(DIRECTORY ${TD_COMMUNITY_DIR}/src/connector/C\# DESTINATION connector)
INSTALL(DIRECTORY ${TD_COMMUNITY_DIR}/tests/examples DESTINATION .)
INSTALL(DIRECTORY ${TD_COMMUNITY_DIR}/packaging/cfg DESTINATION .)
INSTALL(FILES ${TD_COMMUNITY_DIR}/packaging/cfg/taos.cfg DESTINATION cfg)
INSTALL(FILES ${TD_COMMUNITY_DIR}/src/inc/taos.h DESTINATION include)
INSTALL(FILES ${TD_COMMUNITY_DIR}/src/inc/taoserror.h DESTINATION include)
INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/taos.lib DESTINATION driver)
INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/taos.exp DESTINATION driver)
INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/taos.dll DESTINATION driver)
IF (TD_POWER)
INSTALL(FILES ${EXECUTABLE_OUTPUT_PATH}/power.exe DESTINATION .)
ELSEIF (TD_TQ)
INSTALL(FILES ${EXECUTABLE_OUTPUT_PATH}/tq.exe DESTINATION .)
ELSEIF (TD_PRO)
INSTALL(FILES ${EXECUTABLE_OUTPUT_PATH}/prodbc.exe DESTINATION .)
ELSEIF (TD_KH)
INSTALL(FILES ${EXECUTABLE_OUTPUT_PATH}/khclient.exe DESTINATION .)
ELSEIF (TD_JH)
INSTALL(FILES ${EXECUTABLE_OUTPUT_PATH}/jh_taos.exe DESTINATION .)
ELSE ()
INSTALL(FILES ${EXECUTABLE_OUTPUT_PATH}/taos.exe DESTINATION .)
ENDIF ()
INSTALL(FILES ${EXECUTABLE_OUTPUT_PATH}/taos.exe DESTINATION .)
#INSTALL(TARGETS taos RUNTIME DESTINATION driver)
#INSTALL(TARGETS shell RUNTIME DESTINATION .)
IF (TD_MVN_INSTALLED)
INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/taos-jdbcdriver-2.0.36-dist.jar DESTINATION connector/jdbc)
ENDIF ()
......
########################################################
# #
# jh_iot Configuration #
# Any questions, please email jhkj@njsteel.com.cn #
# #
########################################################
# first fully qualified domain name (FQDN) for jh_iot system
# firstEp hostname:6030
# local fully qualified domain name (FQDN)
# fqdn hostname
# first port number for the connection (12 continuous UDP/TCP port number are used)
# serverPort 6030
# log file's directory
# logDir /var/log/jh_taos
# data file's directory
# dataDir /var/lib/jh_taos
# temporary file's directory
# tempDir /tmp/
# the arbitrator's fully qualified domain name (FQDN) for jh_iot system, for cluster only
# arbitrator arbitrator_hostname:6042
# number of threads per CPU core
# numOfThreadsPerCore 1.0
# number of threads to commit cache data
# numOfCommitThreads 4
# the proportion of total CPU cores available for query processing
# 2.0: the query threads will be set to double of the CPU cores.
# 1.0: all CPU cores are available for query processing [default].
# 0.5: only half of the CPU cores are available for query.
# 0.0: only one core available.
# ratioOfQueryCores 1.0
# the last_row/first/last aggregator will not change the original column name in the result fields
keepColumnName 1
# number of management nodes in the system
# numOfMnodes 3
# enable/disable backuping vnode directory when removing vnode
# vnodeBak 1
# enable/disable installation / usage report
# telemetryReporting 1
# enable/disable load balancing
# balance 1
# role for dnode. 0 - any, 1 - mnode, 2 - dnode
# role 0
# max timer control blocks
# maxTmrCtrl 512
# time interval of system monitor, seconds
# monitorInterval 30
# number of seconds allowed for a dnode to be offline, for cluster only
# offlineThreshold 864000
# RPC re-try timer, millisecond
# rpcTimer 300
# RPC maximum time for ack, seconds.
# rpcMaxTime 600
# time interval of dnode status reporting to mnode, seconds, for cluster only
# statusInterval 1
# time interval of heart beat from shell to dnode, seconds
# shellActivityTimer 3
# minimum sliding window time, milli-second
# minSlidingTime 10
# minimum time window, milli-second
# minIntervalTime 10
# maximum delay before launching a stream computation, milli-second
# maxStreamCompDelay 20000
# maximum delay before launching a stream computation for the first time, milli-second
# maxFirstStreamCompDelay 10000
# retry delay when a stream computation fails, milli-second
# retryStreamCompDelay 10
# the delayed time for launching a stream computation, from 0.1(default, 10% of whole computing time window) to 0.9
# streamCompDelayRatio 0.1
# max number of vgroups per db, 0 means configured automatically
# maxVgroupsPerDb 0
# max number of tables per vnode
# maxTablesPerVnode 1000000
# cache block size (Mbyte)
# cache 16
# number of cache blocks per vnode
# blocks 6
# number of days per DB file
# days 10
# number of days to keep DB file
# keep 3650
# minimum rows of records in file block
# minRows 100
# maximum rows of records in file block
# maxRows 4096
# the number of acknowledgments required for successful data writing
# quorum 1
# enable/disable compression
# comp 2
# write ahead log (WAL) level, 0: no wal; 1: write wal, but no fysnc; 2: write wal, and call fsync
# walLevel 1
# if walLevel is set to 2, the cycle of fsync being executed, if set to 0, fsync is called right away
# fsync 3000
# number of replications, for cluster only
# replica 1
# the compressed rpc message, option:
# -1 (no compression)
# 0 (all message compressed),
# > 0 (rpc message body which larger than this value will be compressed)
# compressMsgSize -1
# max length of an SQL
# maxSQLLength 65480
# max length of WildCards
# maxWildCardsLength 100
# the maximum number of records allowed for super table time sorting
# maxNumOfOrderedRes 100000
# system time zone
# timezone Asia/Shanghai (CST, +0800)
# system time zone (for windows 10)
# timezone UTC-8
# system locale
# locale en_US.UTF-8
# default system charset
# charset UTF-8
# max number of connections allowed in dnode
# maxShellConns 5000
# max number of connections allowed in client
# maxConnections 5000
# stop writing logs when the disk size of the log folder is less than this value
# minimalLogDirGB 0.1
# stop writing temporary files when the disk size of the tmp folder is less than this value
# minimalTmpDirGB 0.1
# if disk free space is less than this value, server service exit directly within startup process
# minimalDataDirGB 0.1
# One mnode is equal to the number of vnode consumed
# mnodeEqualVnodeNum 4
# enbale/disable http service
# http 1
# enable/disable system monitor
# monitor 1
# enable/disable recording the SQL statements via restful interface
# httpEnableRecordSql 0
# number of threads used to process http requests
# httpMaxThreads 2
# maximum number of rows returned by the restful interface
# restfulRowLimit 10240
# The following parameter is used to limit the maximum number of lines in log files.
# max number of lines per log filters
# numOfLogLines 10000000
# enable/disable async log
# asyncLog 1
# time of keeping log files, days
# logKeepDays 0
# The following parameters are used for debug purpose only.
# debugFlag 8 bits mask: FILE-SCREEN-UNUSED-HeartBeat-DUMP-TRACE_WARN-ERROR
# 131: output warning and error
# 135: output debug, warning and error
# 143: output trace, debug, warning and error to log
# 199: output debug, warning and error to both screen and file
# 207: output trace, debug, warning and error to both screen and file
# debug flag for all log type, take effect when non-zero value
# debugFlag 0
# debug flag for meta management messages
# mDebugFlag 135
# debug flag for dnode messages
# dDebugFlag 135
# debug flag for sync module
# sDebugFlag 135
# debug flag for WAL
# wDebugFlag 135
# debug flag for SDB
# sdbDebugFlag 135
# debug flag for RPC
# rpcDebugFlag 131
# debug flag for TIMER
# tmrDebugFlag 131
# debug flag for jh_iot client
# cDebugFlag 131
# debug flag for JNI
# jniDebugFlag 131
# debug flag for storage
# uDebugFlag 131
# debug flag for http server
# httpDebugFlag 131
# debug flag for monitor
# monDebugFlag 131
# debug flag for query
# qDebugFlag 131
# debug flag for vnode
# vDebugFlag 131
# debug flag for TSDB
# tsdbDebugFlag 131
# debug flag for continue query
# cqDebugFlag 131
# enable/disable recording the SQL in client
# enableRecordSql 0
# generate core file when service crash
# enableCoreFile 1
# maximum display width of binary and nchar fields in the shell. The parts exceeding this limit will be hidden
# maxBinaryDisplayWidth 30
# enable/disable stream (continuous query)
# stream 1
# in retrieve blocking model, only in 50% query threads will be used in query processing in dnode
# retrieveBlockingModel 0
# the maximum allowed query buffer size in MB during query processing for each data node
# -1 no limit (default)
# 0 no query allowed, queries are disabled
# queryBufferSize -1
[Unit]
Description=jh_iot server service
After=network-online.target taosadapter.service
Wants=network-online.target taosadapter.service
[Service]
Type=simple
ExecStart=/usr/bin/jh_taosd
ExecStartPre=/usr/local/jh_taos/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
[Unit]
Description=KingHistorian server service
After=network-online.target taosadapter.service
Wants=network-online.target taosadapter.service
[Service]
Type=simple
ExecStart=/usr/bin/khserver
ExecStartPre=/usr/local/kinghistorian/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
########################################################
# #
# KingHistorian Configuration #
# Any questions, please email support@wellintech.com #
# #
########################################################
# first fully qualified domain name (FQDN) for KingHistorian system
# firstEp hostname:6030
# local fully qualified domain name (FQDN)
# fqdn hostname
# first port number for the connection (12 continuous UDP/TCP port number are used)
# serverPort 6030
# log file's directory
# logDir /var/log/kinghistorian
# data file's directory
# dataDir /var/lib/kinghistorian
# temporary file's directory
# tempDir /tmp/
# the arbitrator's fully qualified domain name (FQDN) for KingHistorian system, for cluster only
# arbitrator arbitrator_hostname:6042
# number of threads per CPU core
# numOfThreadsPerCore 1.0
# number of threads to commit cache data
# numOfCommitThreads 4
# the proportion of total CPU cores available for query processing
# 2.0: the query threads will be set to double of the CPU cores.
# 1.0: all CPU cores are available for query processing [default].
# 0.5: only half of the CPU cores are available for query.
# 0.0: only one core available.
# ratioOfQueryCores 1.0
# the last_row/first/last aggregator will not change the original column name in the result fields
keepColumnName 1
# number of management nodes in the system
# numOfMnodes 3
# enable/disable backuping vnode directory when removing vnode
# vnodeBak 1
# enable/disable installation / usage report
# telemetryReporting 1
# enable/disable load balancing
# balance 1
# role for dnode. 0 - any, 1 - mnode, 2 - dnode
# role 0
# max timer control blocks
# maxTmrCtrl 512
# time interval of system monitor, seconds
# monitorInterval 30
# number of seconds allowed for a dnode to be offline, for cluster only
# offlineThreshold 864000
# RPC re-try timer, millisecond
# rpcTimer 300
# RPC maximum time for ack, seconds.
# rpcMaxTime 600
# time interval of dnode status reporting to mnode, seconds, for cluster only
# statusInterval 1
# time interval of heart beat from shell to dnode, seconds
# shellActivityTimer 3
# minimum sliding window time, milli-second
# minSlidingTime 10
# minimum time window, milli-second
# minIntervalTime 10
# maximum delay before launching a stream computation, milli-second
# maxStreamCompDelay 20000
# maximum delay before launching a stream computation for the first time, milli-second
# maxFirstStreamCompDelay 10000
# retry delay when a stream computation fails, milli-second
# retryStreamCompDelay 10
# the delayed time for launching a stream computation, from 0.1(default, 10% of whole computing time window) to 0.9
# streamCompDelayRatio 0.1
# max number of vgroups per db, 0 means configured automatically
# maxVgroupsPerDb 0
# max number of tables per vnode
# maxTablesPerVnode 1000000
# cache block size (Mbyte)
# cache 16
# number of cache blocks per vnode
# blocks 6
# number of days per DB file
# days 10
# number of days to keep DB file
# keep 3650
# minimum rows of records in file block
# minRows 100
# maximum rows of records in file block
# maxRows 4096
# the number of acknowledgments required for successful data writing
# quorum 1
# enable/disable compression
# comp 2
# write ahead log (WAL) level, 0: no wal; 1: write wal, but no fysnc; 2: write wal, and call fsync
# walLevel 1
# if walLevel is set to 2, the cycle of fsync being executed, if set to 0, fsync is called right away
# fsync 3000
# number of replications, for cluster only
# replica 1
# the compressed rpc message, option:
# -1 (no compression)
# 0 (all message compressed),
# > 0 (rpc message body which larger than this value will be compressed)
# compressMsgSize -1
# max length of an SQL
# maxSQLLength 65480
# max length of WildCards
# maxWildCardsLength 100
# the maximum number of records allowed for super table time sorting
# maxNumOfOrderedRes 100000
# system time zone
# timezone Asia/Shanghai (CST, +0800)
# system time zone (for windows 10)
# timezone UTC-8
# system locale
# locale en_US.UTF-8
# default system charset
# charset UTF-8
# max number of connections allowed in dnode
# maxShellConns 5000
# max number of connections allowed in client
# maxConnections 5000
# stop writing logs when the disk size of the log folder is less than this value
# minimalLogDirGB 0.1
# stop writing temporary files when the disk size of the tmp folder is less than this value
# minimalTmpDirGB 0.1
# if disk free space is less than this value, khserver service exit directly within startup process
# minimalDataDirGB 0.1
# One mnode is equal to the number of vnode consumed
# mnodeEqualVnodeNum 4
# enbale/disable http service
# http 1
# enable/disable system monitor
# monitor 1
# enable/disable recording the SQL statements via restful interface
# httpEnableRecordSql 0
# number of threads used to process http requests
# httpMaxThreads 2
# maximum number of rows returned by the restful interface
# restfulRowLimit 10240
# The following parameter is used to limit the maximum number of lines in log files.
# max number of lines per log filters
# numOfLogLines 10000000
# enable/disable async log
# asyncLog 1
# time of keeping log files, days
# logKeepDays 0
# The following parameters are used for debug purpose only.
# debugFlag 8 bits mask: FILE-SCREEN-UNUSED-HeartBeat-DUMP-TRACE_WARN-ERROR
# 131: output warning and error
# 135: output debug, warning and error
# 143: output trace, debug, warning and error to log
# 199: output debug, warning and error to both screen and file
# 207: output trace, debug, warning and error to both screen and file
# debug flag for all log type, take effect when non-zero value
# debugFlag 0
# debug flag for meta management messages
# mDebugFlag 135
# debug flag for dnode messages
# dDebugFlag 135
# debug flag for sync module
# sDebugFlag 135
# debug flag for WAL
# wDebugFlag 135
# debug flag for SDB
# sdbDebugFlag 135
# debug flag for RPC
# rpcDebugFlag 131
# debug flag for TIMER
# tmrDebugFlag 131
# debug flag for KingHistorian client
# cDebugFlag 131
# debug flag for JNI
# jniDebugFlag 131
# debug flag for storage
# uDebugFlag 131
# debug flag for http server
# httpDebugFlag 131
# debug flag for monitor
# monDebugFlag 131
# debug flag for query
# qDebugFlag 131
# debug flag for vnode
# vDebugFlag 131
# debug flag for TSDB
# tsdbDebugFlag 131
# debug flag for continue query
# cqDebugFlag 131
# enable/disable recording the SQL in kinghistorian client
# enableRecordSql 0
# generate core file when service crash
# enableCoreFile 1
# maximum display width of binary and nchar fields in the shell. The parts exceeding this limit will be hidden
# maxBinaryDisplayWidth 30
# enable/disable stream (continuous query)
# stream 1
# in retrieve blocking model, only in 50% query threads will be used in query processing in dnode
# retrieveBlockingModel 0
# the maximum allowed query buffer size in MB during query processing for each data node
# -1 no limit (default)
# 0 no query allowed, queries are disabled
# queryBufferSize -1
########################################################
# #
# PowerDB Configuration #
# Any questions, please email support@taosdata.com #
# #
########################################################
# first fully qualified domain name (FQDN) for PowerDB system
# firstEp hostname:6030
# local fully qualified domain name (FQDN)
# fqdn hostname
# first port number for the connection (12 continuous UDP/TCP port number are used)
# serverPort 6030
# log file's directory
# logDir /var/log/power
# data file's directory
# dataDir /var/lib/power
# temporary file's directory
# tempDir /tmp/
# the arbitrator's fully qualified domain name (FQDN) for PowerDB system, for cluster only
# arbitrator arbitrator_hostname:6042
# number of threads per CPU core
# numOfThreadsPerCore 1.0
# number of threads to commit cache data
# numOfCommitThreads 4
# the proportion of total CPU cores available for query processing
# 2.0: the query threads will be set to double of the CPU cores.
# 1.0: all CPU cores are available for query processing [default].
# 0.5: only half of the CPU cores are available for query.
# 0.0: only one core available.
# ratioOfQueryCores 1.0
# the last_row/first/last aggregator will not change the original column name in the result fields
keepColumnName 1
# number of management nodes in the system
# numOfMnodes 3
# enable/disable backuping vnode directory when removing vnode
# vnodeBak 1
# enable/disable installation / usage report
# telemetryReporting 1
# enable/disable load balancing
# balance 1
# role for dnode. 0 - any, 1 - mnode, 2 - dnode
# role 0
# max timer control blocks
# maxTmrCtrl 512
# time interval of system monitor, seconds
# monitorInterval 30
# number of seconds allowed for a dnode to be offline, for cluster only
# offlineThreshold 864000
# RPC re-try timer, millisecond
# rpcTimer 300
# RPC maximum time for ack, seconds.
# rpcMaxTime 600
# time interval of dnode status reporting to mnode, seconds, for cluster only
# statusInterval 1
# time interval of heart beat from shell to dnode, seconds
# shellActivityTimer 3
# minimum sliding window time, milli-second
# minSlidingTime 10
# minimum time window, milli-second
# minIntervalTime 10
# maximum delay before launching a stream computation, milli-second
# maxStreamCompDelay 20000
# maximum delay before launching a stream computation for the first time, milli-second
# maxFirstStreamCompDelay 10000
# retry delay when a stream computation fails, milli-second
# retryStreamCompDelay 10
# the delayed time for launching a stream computation, from 0.1(default, 10% of whole computing time window) to 0.9
# streamCompDelayRatio 0.1
# max number of vgroups per db, 0 means configured automatically
# maxVgroupsPerDb 0
# max number of tables per vnode
# maxTablesPerVnode 1000000
# cache block size (Mbyte)
# cache 16
# number of cache blocks per vnode
# blocks 6
# number of days per DB file
# days 10
# number of days to keep DB file
# keep 3650
# minimum rows of records in file block
# minRows 100
# maximum rows of records in file block
# maxRows 4096
# the number of acknowledgments required for successful data writing
# quorum 1
# enable/disable compression
# comp 2
# write ahead log (WAL) level, 0: no wal; 1: write wal, but no fysnc; 2: write wal, and call fsync
# walLevel 1
# if walLevel is set to 2, the cycle of fsync being executed, if set to 0, fsync is called right away
# fsync 3000
# number of replications, for cluster only
# replica 1
# the compressed rpc message, option:
# -1 (no compression)
# 0 (all message compressed),
# > 0 (rpc message body which larger than this value will be compressed)
# compressMsgSize -1
# max length of an SQL
# maxSQLLength 65480
# max length of WildCards
# maxWildCardsLength 100
# the maximum number of records allowed for super table time sorting
# maxNumOfOrderedRes 100000
# system time zone
# timezone Asia/Shanghai (CST, +0800)
# system time zone (for windows 10)
# timezone UTC-8
# system locale
# locale en_US.UTF-8
# default system charset
# charset UTF-8
# max number of connections allowed in dnode
# maxShellConns 5000
# max number of connections allowed in client
# maxConnections 5000
# stop writing logs when the disk size of the log folder is less than this value
# minimalLogDirGB 0.1
# stop writing temporary files when the disk size of the tmp folder is less than this value
# minimalTmpDirGB 0.1
# if disk free space is less than this value, powerd service exit directly within startup process
# minimalDataDirGB 0.1
# One mnode is equal to the number of vnode consumed
# mnodeEqualVnodeNum 4
# enbale/disable http service
# http 1
# enable/disable system monitor
# monitor 1
# enable/disable recording the SQL statements via restful interface
# httpEnableRecordSql 0
# number of threads used to process http requests
# httpMaxThreads 2
# maximum number of rows returned by the restful interface
# restfulRowLimit 10240
# The following parameter is used to limit the maximum number of lines in log files.
# max number of lines per log filters
# numOfLogLines 10000000
# enable/disable async log
# asyncLog 1
# time of keeping log files, days
# logKeepDays 0
# The following parameters are used for debug purpose only.
# debugFlag 8 bits mask: FILE-SCREEN-UNUSED-HeartBeat-DUMP-TRACE_WARN-ERROR
# 131: output warning and error
# 135: output debug, warning and error
# 143: output trace, debug, warning and error to log
# 199: output debug, warning and error to both screen and file
# 207: output trace, debug, warning and error to both screen and file
# debug flag for all log type, take effect when non-zero value
# debugFlag 0
# debug flag for meta management messages
# mDebugFlag 135
# debug flag for dnode messages
# dDebugFlag 135
# debug flag for sync module
# sDebugFlag 135
# debug flag for WAL
# wDebugFlag 135
# debug flag for SDB
# sdbDebugFlag 135
# debug flag for RPC
# rpcDebugFlag 131
# debug flag for TAOS TIMER
# tmrDebugFlag 131
# debug flag for TDengine client
# cDebugFlag 131
# debug flag for JNI
# jniDebugFlag 131
# debug flag for storage
# uDebugFlag 131
# debug flag for http server
# httpDebugFlag 131
# debug flag for monitor
# monDebugFlag 131
# debug flag for query
# qDebugFlag 131
# debug flag for vnode
# vDebugFlag 131
# debug flag for TSDB
# tsdbDebugFlag 131
# debug flag for continue query
# cqDebugFlag 131
# enable/disable recording the SQL in power client
# enableRecordSql 0
# generate core file when service crash
# enableCoreFile 1
# maximum display width of binary and nchar fields in the shell. The parts exceeding this limit will be hidden
# maxBinaryDisplayWidth 30
# enable/disable stream (continuous query)
# stream 1
# in retrieve blocking model, only in 50% query threads will be used in query processing in dnode
# retrieveBlockingModel 0
# the maximum allowed query buffer size in MB during query processing for each data node
# -1 no limit (default)
# 0 no query allowed, queries are disabled
# queryBufferSize -1
[Unit]
Description=Power server service
After=network-online.target taosadapter.service
Wants=network-online.target taosadapter.service
[Service]
Type=simple
ExecStart=/usr/bin/powerd
ExecStartPre=/usr/local/power/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
########################################################
# #
# ProDB Configuration #
# Any questions, please email support@hanatech.com.cn #
# #
########################################################
# first fully qualified domain name (FQDN) for ProDB system
# firstEp hostname:6030
# local fully qualified domain name (FQDN)
# fqdn hostname
# first port number for the connection (12 continuous UDP/TCP port number are used)
# serverPort 6030
# log file's directory
# logDir /var/log/ProDB
# data file's directory
# dataDir /var/lib/ProDB
# temporary file's directory
# tempDir /tmp/
# the arbitrator's fully qualified domain name (FQDN) for ProDB system, for cluster only
# arbitrator arbitrator_hostname:6042
# number of threads per CPU core
# numOfThreadsPerCore 1.0
# number of threads to commit cache data
# numOfCommitThreads 4
# the proportion of total CPU cores available for query processing
# 2.0: the query threads will be set to double of the CPU cores.
# 1.0: all CPU cores are available for query processing [default].
# 0.5: only half of the CPU cores are available for query.
# 0.0: only one core available.
# ratioOfQueryCores 1.0
# the last_row/first/last aggregator will not change the original column name in the result fields
keepColumnName 1
# number of management nodes in the system
# numOfMnodes 3
# enable/disable backuping vnode directory when removing vnode
# vnodeBak 1
# enable/disable installation / usage report
# telemetryReporting 1
# enable/disable load balancing
# balance 1
# role for dnode. 0 - any, 1 - mnode, 2 - dnode
# role 0
# max timer control blocks
# maxTmrCtrl 512
# time interval of system monitor, seconds
# monitorInterval 30
# number of seconds allowed for a dnode to be offline, for cluster only
# offlineThreshold 864000
# RPC re-try timer, millisecond
# rpcTimer 300
# RPC maximum time for ack, seconds.
# rpcMaxTime 600
# time interval of dnode status reporting to mnode, seconds, for cluster only
# statusInterval 1
# time interval of heart beat from shell to dnode, seconds
# shellActivityTimer 3
# minimum sliding window time, milli-second
# minSlidingTime 10
# minimum time window, milli-second
# minIntervalTime 10
# maximum delay before launching a stream computation, milli-second
# maxStreamCompDelay 20000
# maximum delay before launching a stream computation for the first time, milli-second
# maxFirstStreamCompDelay 10000
# retry delay when a stream computation fails, milli-second
# retryStreamCompDelay 10
# the delayed time for launching a stream computation, from 0.1(default, 10% of whole computing time window) to 0.9
# streamCompDelayRatio 0.1
# max number of vgroups per db, 0 means configured automatically
# maxVgroupsPerDb 0
# max number of tables per vnode
# maxTablesPerVnode 1000000
# cache block size (Mbyte)
# cache 16
# number of cache blocks per vnode
# blocks 6
# number of days per DB file
# days 10
# number of days to keep DB file
# keep 3650
# minimum rows of records in file block
# minRows 100
# maximum rows of records in file block
# maxRows 4096
# the number of acknowledgments required for successful data writing
# quorum 1
# enable/disable compression
# comp 2
# write ahead log (WAL) level, 0: no wal; 1: write wal, but no fysnc; 2: write wal, and call fsync
# walLevel 1
# if walLevel is set to 2, the cycle of fsync being executed, if set to 0, fsync is called right away
# fsync 3000
# number of replications, for cluster only
# replica 1
# the compressed rpc message, option:
# -1 (no compression)
# 0 (all message compressed),
# > 0 (rpc message body which larger than this value will be compressed)
# compressMsgSize -1
# max length of an SQL
# maxSQLLength 65480
# max length of WildCards
# maxWildCardsLength 100
# the maximum number of records allowed for super table time sorting
# maxNumOfOrderedRes 100000
# system time zone
# timezone Asia/Shanghai (CST, +0800)
# system time zone (for windows 10)
# timezone UTC-8
# system locale
# locale en_US.UTF-8
# default system charset
# charset UTF-8
# max number of connections allowed in dnode
# maxShellConns 5000
# max number of connections allowed in client
# maxConnections 5000
# stop writing logs when the disk size of the log folder is less than this value
# minimalLogDirGB 0.1
# stop writing temporary files when the disk size of the tmp folder is less than this value
# minimalTmpDirGB 0.1
# if disk free space is less than this value, prodbs service exit directly within startup process
# minimalDataDirGB 0.1
# One mnode is equal to the number of vnode consumed
# mnodeEqualVnodeNum 4
# enbale/disable http service
# http 1
# enable/disable system monitor
# monitor 1
# enable/disable recording the SQL statements via restful interface
# httpEnableRecordSql 0
# number of threads used to process http requests
# httpMaxThreads 2
# maximum number of rows returned by the restful interface
# restfulRowLimit 10240
# The following parameter is used to limit the maximum number of lines in log files.
# max number of lines per log filters
# numOfLogLines 10000000
# enable/disable async log
# asyncLog 1
# time of keeping log files, days
# logKeepDays 0
# The following parameters are used for debug purpose only.
# debugFlag 8 bits mask: FILE-SCREEN-UNUSED-HeartBeat-DUMP-TRACE_WARN-ERROR
# 131: output warning and error
# 135: output debug, warning and error
# 143: output trace, debug, warning and error to log
# 199: output debug, warning and error to both screen and file
# 207: output trace, debug, warning and error to both screen and file
# debug flag for all log type, take effect when non-zero value
# debugFlag 0
# debug flag for meta management messages
# mDebugFlag 135
# debug flag for dnode messages
# dDebugFlag 135
# debug flag for sync module
# sDebugFlag 135
# debug flag for WAL
# wDebugFlag 135
# debug flag for SDB
# sdbDebugFlag 135
# debug flag for RPC
# rpcDebugFlag 131
# debug flag for TAOS TIMER
# tmrDebugFlag 131
# debug flag for ProDB client
# cDebugFlag 131
# debug flag for JNI
# jniDebugFlag 131
# debug flag for storage
# uDebugFlag 131
# debug flag for http server
# httpDebugFlag 131
# debug flag for monitor
# monDebugFlag 131
# debug flag for query
# qDebugFlag 131
# debug flag for vnode
# vDebugFlag 131
# debug flag for TSDB
# tsdbDebugFlag 131
# debug flag for continue query
# cqDebugFlag 131
# enable/disable recording the SQL in prodb client
# enableRecordSql 0
# generate core file when service crash
# enableCoreFile 1
# maximum display width of binary and nchar fields in the shell. The parts exceeding this limit will be hidden
# maxBinaryDisplayWidth 30
# enable/disable stream (continuous query)
# stream 1
# in retrieve blocking model, only in 50% query threads will be used in query processing in dnode
# retrieveBlockingModel 0
# the maximum allowed query buffer size in MB during query processing for each data node
# -1 no limit (default)
# 0 no query allowed, queries are disabled
# queryBufferSize -1
[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
########################################################
# #
# TQueue Configuration #
# Any questions, please email support@taosdata.com #
# #
########################################################
# first fully qualified domain name (FQDN) for TQueue system
# firstEp hostname:6030
# local fully qualified domain name (FQDN)
# fqdn hostname
# first port number for the connection (12 continuous UDP/TCP port number are used)
# serverPort 6030
# log file's directory
# logDir /var/log/tq
# data file's directory
# dataDir /var/lib/tq
# temporary file's directory
# tempDir /tmp/
# the arbitrator's fully qualified domain name (FQDN) for TQueue system, for cluster only
# arbitrator arbitrator_hostname:6042
# number of threads per CPU core
# numOfThreadsPerCore 1.0
# number of threads to commit cache data
# numOfCommitThreads 4
# the proportion of total CPU cores available for query processing
# 2.0: the query threads will be set to double of the CPU cores.
# 1.0: all CPU cores are available for query processing [default].
# 0.5: only half of the CPU cores are available for query.
# 0.0: only one core available.
# ratioOfQueryCores 1.0
# the last_row/first/last aggregator will not change the original column name in the result fields
keepColumnName 1
# number of management nodes in the system
# numOfMnodes 3
# enable/disable backuping vnode directory when removing vnode
# vnodeBak 1
# enable/disable installation / usage report
# telemetryReporting 1
# enable/disable load balancing
# balance 1
# role for dnode. 0 - any, 1 - mnode, 2 - dnode
# role 0
# max timer control blocks
# maxTmrCtrl 512
# time interval of system monitor, seconds
# monitorInterval 30
# number of seconds allowed for a dnode to be offline, for cluster only
# offlineThreshold 864000
# RPC re-try timer, millisecond
# rpcTimer 300
# RPC maximum time for ack, seconds.
# rpcMaxTime 600
# time interval of dnode status reporting to mnode, seconds, for cluster only
# statusInterval 1
# time interval of heart beat from shell to dnode, seconds
# shellActivityTimer 3
# minimum sliding window time, milli-second
# minSlidingTime 10
# minimum time window, milli-second
# minIntervalTime 10
# maximum delay before launching a stream computation, milli-second
# maxStreamCompDelay 20000
# maximum delay before launching a stream computation for the first time, milli-second
# maxFirstStreamCompDelay 10000
# retry delay when a stream computation fails, milli-second
# retryStreamCompDelay 10
# the delayed time for launching a stream computation, from 0.1(default, 10% of whole computing time window) to 0.9
# streamCompDelayRatio 0.1
# max number of vgroups per db, 0 means configured automatically
# maxVgroupsPerDb 0
# max number of tables per vnode
# maxTablesPerVnode 1000000
# cache block size (Mbyte)
# cache 16
# number of cache blocks per vnode
# blocks 6
# number of days per DB file
# days 10
# number of days to keep DB file
# keep 3650
# minimum rows of records in file block
# minRows 100
# maximum rows of records in file block
# maxRows 4096
# the number of acknowledgments required for successful data writing
# quorum 1
# enable/disable compression
# comp 2
# write ahead log (WAL) level, 0: no wal; 1: write wal, but no fysnc; 2: write wal, and call fsync
# walLevel 1
# if walLevel is set to 2, the cycle of fsync being executed, if set to 0, fsync is called right away
# fsync 3000
# number of replications, for cluster only
# replica 1
# the compressed rpc message, option:
# -1 (no compression)
# 0 (all message compressed),
# > 0 (rpc message body which larger than this value will be compressed)
# compressMsgSize -1
# max length of an SQL
# maxSQLLength 65480
# max length of WildCards
# maxWildCardsLength 100
# the maximum number of records allowed for super table time sorting
# maxNumOfOrderedRes 100000
# system time zone
# timezone Asia/Shanghai (CST, +0800)
# system time zone (for windows 10)
# timezone UTC-8
# system locale
# locale en_US.UTF-8
# default system charset
# charset UTF-8
# max number of connections allowed in dnode
# maxShellConns 5000
# max number of connections allowed in client
# maxConnections 5000
# stop writing logs when the disk size of the log folder is less than this value
# minimalLogDirGB 0.1
# stop writing temporary files when the disk size of the tmp folder is less than this value
# minimalTmpDirGB 0.1
# if disk free space is less than this value, tqd service exit directly within startup process
# minimalDataDirGB 0.1
# One mnode is equal to the number of vnode consumed
# mnodeEqualVnodeNum 4
# enbale/disable http service
# http 1
# enable/disable system monitor
# monitor 1
# enable/disable recording the SQL statements via restful interface
# httpEnableRecordSql 0
# number of threads used to process http requests
# httpMaxThreads 2
# maximum number of rows returned by the restful interface
# restfulRowLimit 10240
# The following parameter is used to limit the maximum number of lines in log files.
# max number of lines per log filters
# numOfLogLines 10000000
# enable/disable async log
# asyncLog 1
# time of keeping log files, days
# logKeepDays 0
# The following parameters are used for debug purpose only.
# debugFlag 8 bits mask: FILE-SCREEN-UNUSED-HeartBeat-DUMP-TRACE_WARN-ERROR
# 131: output warning and error
# 135: output debug, warning and error
# 143: output trace, debug, warning and error to log
# 199: output debug, warning and error to both screen and file
# 207: output trace, debug, warning and error to both screen and file
# debug flag for all log type, take effect when non-zero value
# debugFlag 0
# debug flag for meta management messages
# mDebugFlag 135
# debug flag for dnode messages
# dDebugFlag 135
# debug flag for sync module
# sDebugFlag 135
# debug flag for WAL
# wDebugFlag 135
# debug flag for SDB
# sdbDebugFlag 135
# debug flag for RPC
# rpcDebugFlag 131
# debug flag for TAOS TIMER
# tmrDebugFlag 131
# debug flag for TQueue client
# cDebugFlag 131
# debug flag for JNI
# jniDebugFlag 131
# debug flag for storage
# uDebugFlag 131
# debug flag for http server
# httpDebugFlag 131
# debug flag for monitor
# monDebugFlag 131
# debug flag for query
# qDebugFlag 131
# debug flag for vnode
# vDebugFlag 131
# debug flag for TSDB
# tsdbDebugFlag 131
# debug flag for continue query
# cqDebugFlag 131
# enable/disable recording the SQL in tq client
# enableRecordSql 0
# generate core file when service crash
# enableCoreFile 1
# maximum display width of binary and nchar fields in the shell. The parts exceeding this limit will be hidden
# maxBinaryDisplayWidth 30
# enable/disable stream (continuous query)
# stream 1
# in retrieve blocking model, only in 50% query threads will be used in query processing in dnode
# retrieveBlockingModel 0
# the maximum allowed query buffer size in MB during query processing for each data node
# -1 no limit (default)
# 0 no query allowed, queries are disabled
# queryBufferSize -1
[Unit]
Description=TQ server service
After=network-online.target taosadapter.service
Wants=network-online.target taosadapter.service
[Service]
Type=simple
ExecStart=/usr/bin/tqd
ExecStartPre=/usr/local/tq/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
#
# Modified from original source: Elastic Search
# https://github.com/elasticsearch/elasticsearch
# Thank you to the Elastic Search authors
#
# chkconfig: 2345 99 01
#
### BEGIN INIT INFO
# Provides: PowerDB
# 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 PowerDB powerd
# Description: Starts PowerDB powerd, a time-series database engine
### END INIT INFO
set -e
PATH="/bin:/usr/bin:/sbin:/usr/sbin"
NAME="PowerDB"
USER="root"
GROUP="root"
DAEMON="/usr/local/power/bin/powerd"
DAEMON_OPTS=""
PID_FILE="/var/run/$NAME.pid"
APPARGS=""
# Maximum number of open files
MAX_OPEN_FILES=65535
. /lib/lsb/init-functions
case "$1" in
start)
log_action_begin_msg "Starting PowerDB..."
if start-stop-daemon --test --start --chuid "$USER:$GROUP" --background --make-pidfile --pidfile "$PID_FILE" --exec "$DAEMON" -- $APPARGS &> /dev/null; then
touch "$PID_FILE" && chown "$USER":"$GROUP" "$PID_FILE"
if [ -n "$MAX_OPEN_FILES" ]; then
ulimit -n $MAX_OPEN_FILES
fi
start-stop-daemon --start --chuid "$USER:$GROUP" --background --make-pidfile --pidfile "$PID_FILE" --exec "$DAEMON" -- $APPARGS
log_end_msg $?
fi
;;
stop)
log_action_begin_msg "Stopping PowerDB..."
set +e
if [ -f "$PID_FILE" ]; then
start-stop-daemon --stop --pidfile "$PID_FILE" --user "$USER" --retry=TERM/120/KILL/5 > /dev/null
if [ $? -eq 1 ]; then
log_action_cont_msg "TSD is not running but pid file exists, cleaning up"
elif [ $? -eq 3 ]; then
PID="`cat $PID_FILE`"
log_failure_msg "Failed to stop PowerDB (pid $PID)"
exit 1
fi
rm -f "$PID_FILE"
else
log_action_cont_msg "PowerDB was not running"
fi
log_action_end_msg 0
set -e
;;
restart|force-reload)
if [ -f "$PID_FILE" ]; then
$0 stop
sleep 1
fi
$0 start
;;
status)
status_of_proc -p "$PID_FILE" "$DAEMON" "$NAME"
;;
*)
exit 1
;;
esac
exit 0
#!/bin/bash
#
# Modified from original source: Elastic Search
# https://github.com/elasticsearch/elasticsearch
# Thank you to the Elastic Search authors
#
# chkconfig: 2345 99 01
#
### BEGIN INIT INFO
# Provides: TDengine
# 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 TDengine taosd
# Description: Starts TDengine taosd, a time-series database engine
### END INIT INFO
set -e
......
@echo off
set internal_dir=%~dp0\..\..\
set community_dir=%~dp0\..
cd %community_dir%
git checkout -- .
cd %community_dir%\packaging
:: %1 name %2 version
if !%1==! GOTO USAGE
if !%2==! GOTO USAGE
if %1 == taos GOTO TAOS
if %1 == power GOTO POWER
if %1 == tq GOTO TQ
if %1 == pro GOTO PRO
if %1 == kh GOTO KH
if %1 == jh GOTO JH
GOTO USAGE
:TAOS
goto RELEASE
:POWER
call sed_power.bat %community_dir%
goto RELEASE
:TQ
call sed_tq.bat %community_dir%
goto RELEASE
:PRO
call sed_pro.bat %community_dir%
goto RELEASE
:KH
call sed_kh.bat %community_dir%
goto RELEASE
:JH
call sed_jh.bat %community_dir%
goto RELEASE
:RELEASE
echo release windows-client-64 for %1, version: %2
if not exist %internal_dir%\debug\ver-%2-64bit-%1 (
md %internal_dir%\debug\ver-%2-64bit-%1
) else (
rd /S /Q %internal_dir%\debug\ver-%2-64bit-%1
md %internal_dir%\debug\ver-%2-64bit-%1
)
cd %internal_dir%\debug\ver-%2-64bit-%1
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
cmake ../../ -G "NMake Makefiles" -DVERNUMBER=%2 -DCPUTYPE=x64
set CL=/MP4
nmake install
goto EXIT0
:USAGE
echo Usage: release.bat $productName $version
goto EXIT0
:EXIT0
\ No newline at end of file
此差异已折叠。
#!/bin/bash
#
# power This shell script takes care of starting and stopping PowerDB.
#
# chkconfig: 2345 99 01
# description: PowerDB is a districuted, scalable, high-performance Time Series Database
# (TSDB). More than just a pure database, PowerDB also provides the ability
# to do stream computing, aggregation etc.
#
#
### BEGIN INIT INFO
# Provides: powerd
# Required-Start: $network $local_fs $remote_fs
# Required-Stop: $network $local_fs $remote_fs
# Short-Description: start and stop powerd
# Description: PowerDB is a districuted, scalable, high-performance Time Series Database
# (TSDB). More than just a pure database, PowerDB also provides the ability
# to do stream computing, aggregation etc.
### END INIT INFO
# Source init functions
. /etc/init.d/functions
# Maximum number of open files
MAX_OPEN_FILES=65535
# Default program options
NAME=powerd
PROG=/usr/local/power/bin/powerd
USER=root
GROUP=root
# Default directories
LOCK_DIR=/var/lock/subsys
PID_DIR=/var/run/$NAME
# Set file names
LOCK_FILE=$LOCK_DIR/$NAME
PID_FILE=$PID_DIR/$NAME.pid
[ -e $PID_DIR ] || mkdir -p $PID_DIR
PROG_OPTS=""
start() {
echo -n "Starting ${NAME}: "
# check identity
curid="`id -u -n`"
if [ "$curid" != root ] && [ "$curid" != "$USER" ] ; then
echo "Must be run as root or $USER, but was run as $curid"
return 1
fi
# Sets the maximum number of open file descriptors allowed.
ulimit -n $MAX_OPEN_FILES
curulimit="`ulimit -n`"
if [ "$curulimit" -lt $MAX_OPEN_FILES ] ; then
echo "'ulimit -n' must be greater than or equal to $MAX_OPEN_FILES, is $curulimit"
return 1
fi
if [ "`id -u -n`" == root ] ; then
# Changes the owner of the lock, and the pid files to allow
# non-root OpenTSDB daemons to run /usr/share/opentsdb/bin/opentsdb_restart.py.
touch $LOCK_FILE && chown $USER:$GROUP $LOCK_FILE
touch $PID_FILE && chown $USER:$GROUP $PID_FILE
daemon --user $USER --pidfile $PID_FILE "$PROG $PROG_OPTS &> /dev/null &"
else
# Don't have to change user.
daemon --pidfile $PID_FILE "$PROG $PROG_OPTS &> /dev/null &"
fi
retval=$?
sleep 2
echo
[ $retval -eq 0 ] && (findproc > $PID_FILE && touch $LOCK_FILE)
return $retval
}
stop() {
echo -n "Stopping ${NAME}: "
killproc -p $PID_FILE $NAME
retval=$?
echo
# Non-root users don't have enough permission to remove pid and lock files.
# So, the opentsdb_restart.py cannot get rid of the files, and the command
# "service opentsdb status" will complain about the existing pid file.
# Makes the pid file empty.
echo > $PID_FILE
[ $retval -eq 0 ] && (rm -f $PID_FILE && rm -f $LOCK_FILE)
return $retval
}
restart() {
stop
start
}
reload() {
restart
}
force_reload() {
restart
}
rh_status() {
# run checks to determine if the service is running or use generic status
status -p $PID_FILE -l $LOCK_FILE $NAME
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
case "$1" in
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
restart
;;
*)
echo "Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
exit 2
esac
exit $?
set sed="C:\Program Files\Git\usr\bin\sed.exe"
set community_dir=%1
::cmake\install.inc
%sed% -i "s/C:\/TDengine/C:\/jh_iot/g" %community_dir%\cmake\install.inc
%sed% -i "s/taos\.cfg/jh_taos\.cfg/g" %community_dir%\cmake\install.inc
%sed% -i "s/taos\.exe/jh_taos\.exe/g" %community_dir%\cmake\install.inc
%sed% -i "s/taosdemo\.exe/jhdemo\.exe/g" %community_dir%\cmake\install.inc
%sed% -i "/src\/connector/d" %community_dir%\cmake\install.inc
%sed% -i "/tests\/examples/d" %community_dir%\cmake\install.inc
::src\kit\shell\CMakeLists.txt
%sed% -i "s/OUTPUT_NAME taos/OUTPUT_NAME jh_taos/g" %community_dir%\src\kit\shell\CMakeLists.txt
::src\kit\shell\inc\shell.h
%sed% -i "s/taos_history/jh_taos_history/g" %community_dir%\src\kit\shell\inc\shell.h
::src\inc\taosdef.h
%sed% -i "s/\"taosdata\"/\"jhdata\"/g" %community_dir%\src\inc\taosdef.h
::src\util\src\tconfig.c
%sed% -i "s/taos\.cfg/jh_taos\.cfg/g" %community_dir%\src\util\src\tconfig.c
%sed% -i "s/etc\/taos/etc\/jh_taos/g" %community_dir%\src\util\src\tconfig.c
::src\kit\taosdemo\CMakeLists.txt
%sed% -i "s/ADD_EXECUTABLE(taosdemo/ADD_EXECUTABLE(jhdemo/g" %community_dir%\src\kit\taosdemo\CMakeLists.txt
%sed% -i "s/TARGET_LINK_LIBRARIES(taosdemo/TARGET_LINK_LIBRARIES(jhdemo/g" %community_dir%\src\kit\taosdemo\CMakeLists.txt
::src\kit\taosdemo\taosdemo.c
%sed% -i "s/taosdemo --help/jhdemo --help/g" %community_dir%\src\kit\taosdemo\taosdemo.c
%sed% -i "s/taosdemo --usage/jhdemo --usage/g" %community_dir%\src\kit\taosdemo\taosdemo.c
%sed% -i "s/Usage: taosdemo/Usage: jhdemo/g" %community_dir%\src\kit\taosdemo\taosdemo.c
%sed% -i "s/taosdemo is simulating/jhdemo is simulating/g" %community_dir%\src\kit\taosdemo\taosdemo.c
%sed% -i "s/taosdemo version/jhdemo version/g" %community_dir%\src\kit\taosdemo\taosdemo.c
%sed% -i "s/\"taosdata\"/\"jhdata\"/g" %community_dir%\src\kit\taosdemo\taosdemo.c
%sed% -i "s/support@taosdata\.com/jhkj@njsteel\.com\.cn/g" %community_dir%\src\kit\taosdemo\taosdemo.c
%sed% -i "s/taosc, rest, and stmt/jh_taos, rest, and stmt/g" %community_dir%\src\kit\taosdemo\taosdemo.c
%sed% -i "s/taosdemo uses/jhdemo uses/g" %community_dir%\src\kit\taosdemo\taosdemo.c
%sed% -i "s/use 'taosc'/use 'jh_taos'/g" %community_dir%\src\kit\taosdemo\taosdemo.c
::src\util\src\tlog.c
%sed% -i "s/log\/taos/log\/jh_taos/g" %community_dir%\src\util\src\tlog.c
::src\dnode\src\dnodeSystem.c
%sed% -i "s/TDengine/jh_iot/g" %community_dir%\src\dnode\src\dnodeSystem.c
::src\dnode\src\dnodeMain.c
%sed% -i "s/TDengine/jh_iot/g" %community_dir%\src\dnode\src\dnodeMain.c
%sed% -i "s/taosdlog/jh_taosdlog/g" %community_dir%\src\dnode\src\dnodeMain.c
::src\client\src\tscSystem.c
%sed% -i "s/taoslog/jh_taoslog/g" %community_dir%\src\client\src\tscSystem.c
::src\util\src\tnote.c
%sed% -i "s/taosinfo/jh_taosinfo/g" %community_dir%\src\util\src\tnote.c
::src\dnode\CMakeLists.txt
%sed% -i "s/taos\.cfg/jh_taos\.cfg/g" %community_dir%\src\dnode\CMakeLists.txt
::src\kit\taosdump\taosdump.c
%sed% -i "s/support@taosdata\.com/jhkj@njsteel\.com\.cn/g" %community_dir%\src\kit\taosdump\taosdump.c
%sed% -i "s/Default is taosdata/Default is jhdata/g" %community_dir%\src\kit\taosdump\taosdump.c
%sed% -i "s/\"taosdata\"/\"jhdata\"/g" %community_dir%\src\kit\taosdump\taosdump.c
%sed% -i "s/TDengine/jh_iot/g" %community_dir%\src\kit\taosdump\taosdump.c
%sed% -i "s/taos\/taos\.cfg/jh_taos\/jh_taos\.cfg/g" %community_dir%\src\kit\taosdump\taosdump.c
::src\os\src\linux\linuxEnv.c
%sed% -i "s/etc\/taos/etc\/jh_taos/g" %community_dir%\src\os\src\linux\linuxEnv.c
%sed% -i "s/lib\/taos/lib\/jh_taos/g" %community_dir%\src\os\src\linux\linuxEnv.c
%sed% -i "s/log\/taos/log\/jh_taos/g" %community_dir%\src\os\src\linux\linuxEnv.c
::src\kit\shell\src\shellDarwin.c
%sed% -i "s/TDengine shell/jh_iot shell/g" %community_dir%\src\kit\shell\src\shellDarwin.c
%sed% -i "s/2020 by TAOS Data/2021 by Jinheng Technology/g" %community_dir%\src\kit\shell\src\shellDarwin.c
::src\kit\shell\src\shellLinux.c
%sed% -i "s/support@taosdata\.com/jhkj@njsteel\.com\.cn/g" %community_dir%\src\kit\shell\src\shellLinux.c
%sed% -i "s/TDengine shell/jh_iot shell/g" %community_dir%\src\kit\shell\src\shellLinux.c
%sed% -i "s/2020 by TAOS Data/2021 by Jinheng Technology/g" %community_dir%\src\kit\shell\src\shellLinux.c
::src\os\src\windows\wEnv.c
%sed% -i "s/TDengine/jh_iot/g" %community_dir%\src\os\src\windows\wEnv.c
::src\kit\shell\src\shellEngine.c
%sed% -i "s/TDengine shell/jh_iot shell/g" %community_dir%\src\kit\shell\src\shellEngine.c
%sed% -i "s/2020 by TAOS Data, Inc/2021 by Jinheng Technology, Inc/g" %community_dir%\src\kit\shell\src\shellEngine.c
%sed% -i "s/taos connect failed/jh_taos connect failed/g" %community_dir%\src\kit\shell\src\shellEngine.c
%sed% -i "s/\"taos^> \"/\"jh_taos^> \"/g" %community_dir%\src\kit\shell\src\shellEngine.c
%sed% -i "s/\" -^> \"/\" -^> \"/g" %community_dir%\src\kit\shell\src\shellEngine.c
%sed% -i "s/prompt_size = 6/prompt_size = 9/g" %community_dir%\src\kit\shell\src\shellEngine.c
::src\rpc\src\rpcMain.c
%sed% -i "s/taos connections/jh_taos connections/g" %community_dir%\src\rpc\src\rpcMain.c
::src\plugins\monitor\src\monMain.c
%sed% -i "s/taosd is quiting/jh_taosd is quiting/g" %community_dir%\src\plugins\monitor\src\monMain.c
#!/bin/bash
function replace_community_jh() {
# cmake/install.inc
sed -i "s/C:\/TDengine/C:\/jh_iot/g" ${top_dir}/cmake/install.inc
sed -i "s/taos\.cfg/jh_taos\.cfg/g" ${top_dir}/cmake/install.inc
sed -i "s/taos\.exe/jh_taos\.exe/g" ${top_dir}/cmake/install.inc
# src/kit/shell/CMakeLists.txt
sed -i "s/OUTPUT_NAME taos/OUTPUT_NAME jh_taos/g" ${top_dir}/src/kit/shell/CMakeLists.txt
# src/kit/shell/inc/shell.h
sed -i "s/taos_history/jh_taos_history/g" ${top_dir}/src/kit/shell/inc/shell.h
# src/inc/taosdef.h
sed -i "s/\"taosdata\"/\"jhdata\"/g" ${top_dir}/src/inc/taosdef.h
# src/util/src/tconfig.c
sed -i "s/taos\.cfg/jh_taos\.cfg/g" ${top_dir}/src/util/src/tconfig.c
sed -i "s/etc\/taos/etc\/jh_taos/g" ${top_dir}/src/util/src/tconfig.c
sed -i "s/taos config/jh_taos config/g" ${top_dir}/src/util/src/tconfig.c
# src/util/src/tlog.c
sed -i "s/log\/taos/log\/jh_taos/g" ${top_dir}/src/util/src/tlog.c
# src/dnode/src/dnodeSystem.c
sed -i "s/TDengine/jh_taos/g" ${top_dir}/src/dnode/src/dnodeSystem.c
sed -i "s/TDengine/jh_taos/g" ${top_dir}/src/dnode/src/dnodeMain.c
sed -i "s/taosdlog/jh_taosdlog/g" ${top_dir}/src/dnode/src/dnodeMain.c
# src/client/src/tscSystem.c
sed -i "s/taoslog/jh_taoslog/g" ${top_dir}/src/client/src/tscSystem.c
# src/util/src/tnote.c
sed -i "s/taosinfo/jh_taosinfo/g" ${top_dir}/src/util/src/tnote.c
# src/dnode/CMakeLists.txt
sed -i "s/taos\.cfg/jh_taos\.cfg/g" ${top_dir}/src/dnode/CMakeLists.txt
echo "SET_TARGET_PROPERTIES(taosd PROPERTIES OUTPUT_NAME jh_taosd)" >>${top_dir}/src/dnode/CMakeLists.txt
# src/os/src/linux/linuxEnv.c
sed -i "s/etc\/taos/etc\/jh_taos/g" ${top_dir}/src/os/src/linux/linuxEnv.c
sed -i "s/lib\/taos/lib\/jh_taos/g" ${top_dir}/src/os/src/linux/linuxEnv.c
sed -i "s/log\/taos/log\/jh_taos/g" ${top_dir}/src/os/src/linux/linuxEnv.c
# src/kit/shell/src/shellDarwin.c
sed -i "s/TDengine shell/jh_iot shell/g" ${top_dir}/src/kit/shell/src/shellDarwin.c
sed -i "s/2020 by TAOS Data/2021 by Jinheng Technology/g" ${top_dir}/src/kit/shell/src/shellDarwin.c
# src/kit/shell/src/shellLinux.c
sed -i "s/support@taosdata\.com/jhkj@njsteel\.com\.cn/g" ${top_dir}/src/kit/shell/src/shellLinux.c
sed -i "s/TDengine shell/jh_iot shell/g" ${top_dir}/src/kit/shell/src/shellLinux.c
sed -i "s/2020 by TAOS Data/2021 by Jinheng Technology/g" ${top_dir}/src/kit/shell/src/shellLinux.c
# src/os/src/windows/wEnv.c
sed -i "s/C:\/TDengine/C:\/jh_iot/g" ${top_dir}/src/os/src/windows/wEnv.c
# src/kit/shell/src/shellEngine.c
sed -i "s/TDengine shell/jh_iot shell/g" ${top_dir}/src/kit/shell/src/shellEngine.c
sed -i "s/2020 by TAOS Data, Inc/2021 by Jinheng Technology, Inc/g" ${top_dir}/src/kit/shell/src/shellEngine.c
sed -i "s/taos connect failed/jh_taos connect failed/g" ${top_dir}/src/kit/shell/src/shellEngine.c
sed -i "s/\"taos> \"/\"jh_taos> \"/g" ${top_dir}/src/kit/shell/src/shellEngine.c
sed -i "s/\" -> \"/\" -> \"/g" ${top_dir}/src/kit/shell/src/shellEngine.c
sed -i "s/prompt_size = 6/prompt_size = 9/g" ${top_dir}/src/kit/shell/src/shellEngine.c
# src/rpc/src/rpcMain.c
sed -i "s/taos connections/jh_taos connections/g" ${top_dir}/src/rpc/src/rpcMain.c
# src/plugins/monitor/src/monMain.c
sed -i "s/taosd is quiting/jh_taosd is quiting/g" ${top_dir}/src/plugins/monitor/src/monMain.c
# packaging/tools/makepkg.sh
sed -i "s/productName=\"TDengine\"/productName=\"jh_iot\"/g" ${top_dir}/packaging/tools/makepkg.sh
sed -i "s/serverName=\"taosd\"/serverName=\"jh_taosd\"/g" ${top_dir}/packaging/tools/makepkg.sh
sed -i "s/clientName=\"taos\"/clientName=\"jh_taos\"/g" ${top_dir}/packaging/tools/makepkg.sh
sed -i "s/configFile=\"taos\.cfg\"/configFile=\"jh_taos\.cfg\"/g" ${top_dir}/packaging/tools/makepkg.sh
sed -i "s/tarName=\"taos\.tar\.gz\"/tarName=\"jh_taos\.tar\.gz\"/g" ${top_dir}/packaging/tools/makepkg.sh
# packaging/tools/remove.sh
sed -i "s/installDir=\"\/usr\/local\/taos\"/installDir=\"\/usr\/local\/jh_taos\"/g" ${top_dir}/packaging/tools/remove.sh
sed -i "s/serverName=\"taosd\"/serverName=\"jh_taosd\"/g" ${top_dir}/packaging/tools/remove.sh
sed -i "s/clientName=\"taos\"/clientName=\"jh_taos\"/g" ${top_dir}/packaging/tools/remove.sh
sed -i "s/uninstallScript=\"rmtaos\"/uninstallScript=\"rmjh\"/g" ${top_dir}/packaging/tools/remove.sh
sed -i "s/productName=\"TDengine\"/productName=\"jh_iot\"/g" ${top_dir}/packaging/tools/remove.sh
# packaging/tools/startPre.sh
sed -i "s/serverName=\"taosd\"/serverName=\"jh_taosd\"/g" ${top_dir}/packaging/tools/startPre.sh
sed -i "s/logDir=\"\/var\/log\/taos\"/logDir=\"\/var\/log\/jh_taos\"/g" ${top_dir}/packaging/tools/startPre.sh
# packaging/tools/run_taosd.sh
sed -i "s/taosd/jh_taosd/g" ${top_dir}/packaging/tools/run_taosd.sh
# packaging/tools/install.sh
sed -i "s/clientName=\"taos\"/clientName=\"jh_taos\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/serverName=\"taosd\"/serverName=\"jh_taosd\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/configFile=\"taos\.cfg\"/configFile=\"jh_taos\.cfg\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/productName=\"TDengine\"/productName=\"jh_iot\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/emailName=\"taosdata\.com\"/emailName=\"\jhict\.com\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/uninstallScript=\"rmtaos\"/uninstallScript=\"rmjh\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/historyFile=\"taos_history\"/historyFile=\"jh_taos_history\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/tarName=\"taos\.tar\.gz\"/tarName=\"jh_taos\.tar\.gz\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/dataDir=\"\/var\/lib\/taos\"/dataDir=\"\/var\/lib\/jh_taos\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/logDir=\"\/var\/log\/taos\"/logDir=\"\/var\/log\/jh_taos\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/configDir=\"\/etc\/taos\"/configDir=\"\/etc\/jh_taos\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/installDir=\"\/usr\/local\/taos\"/installDir=\"\/usr\/local\/jh_taos\"/g" ${top_dir}/packaging/tools/install.sh
# packaging/tools/makeclient.sh
sed -i "s/productName=\"TDengine\"/productName=\"jh_iot\"/g" ${top_dir}/packaging/tools/makeclient.sh
sed -i "s/clientName=\"taos\"/clientName=\"jh_taos\"/g" ${top_dir}/packaging/tools/makeclient.sh
sed -i "s/configFile=\"taos\.cfg\"/configFile=\"jh_taos\.cfg\"/g" ${top_dir}/packaging/tools/makeclient.sh
sed -i "s/tarName=\"taos\.tar\.gz\"/tarName=\"jh_taos\.tar\.gz\"/g" ${top_dir}/packaging/tools/makeclient.sh
# packaging/tools/remove_client.sh
sed -i "s/installDir=\"\/usr\/local\/taos\"/installDir=\"\/usr\/local\/jh_taos\"/g" ${top_dir}/packaging/tools/remove_client.sh
sed -i "s/clientName=\"taos\"/clientName=\"jh_taos\"/g" ${top_dir}/packaging/tools/remove_client.sh
sed -i "s/uninstallScript=\"rmtaos\"/uninstallScript=\"rmjh\"/g" ${top_dir}/packaging/tools/remove_client.sh
# packaging/tools/install_client.sh
sed -i "s/dataDir=\"\/var\/lib\/taos\"/dataDir=\"\/var\/lib\/jh_iot\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/logDir=\"\/var\/log\/taos\"/logDir=\"\/var\/log\/jh_taos\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/productName=\"TDengine\"/productName=\"jh_iot\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/installDir=\"\/usr\/local\/taos\"/installDir=\"\/usr\/local\/jh_taos\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/configDir=\"\/etc\/taos\"/configDir=\"\/etc\/jh_taos\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/serverName=\"taosd\"/serverName=\"jh_taosd\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/clientName=\"taos\"/clientName=\"jh_taos\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/uninstallScript=\"rmtaos\"/uninstallScript=\"rmjh\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/configFile=\"taos\.cfg\"/configFile=\"jh_taos\.cfg\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/tarName=\"taos\.tar\.gz\"/tarName=\"jh_taos\.tar\.gz\"/g" ${top_dir}/packaging/tools/install_client.sh
# packaging/tools/makearbi.sh
sed -i "s/productName=\"TDengine\"/productName=\"jh_iot\"/g" ${top_dir}/packaging/tools/makearbi.sh
# packaging/tools/remove_arbi.sh
sed -i "s/TDengine/jh_iot/g" ${top_dir}/packaging/tools/remove_arbi.sh
# packaging/tools/install_arbi.sh
sed -i "s/TDengine/jh_iot/g" ${top_dir}/packaging/tools/install_arbi.sh
sed -i "s/taosdata\.com/jhict\.com/g" ${top_dir}/packaging/tools/install_arbi.sh
# packaging/tools/make_install.sh
sed -i "s/clientName=\"taos\"/clientName=\"jh_taos\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/serverName=\"taosd\"/serverName=\"jh_taosd\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/logDir=\"\/var\/log\/taos\"/logDir=\"\/var\/log\/jh_taos\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/dataDir=\"\/var\/lib\/taos\"/dataDir=\"\/var\/lib\/jh_taos\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/configDir=\"\/etc\/taos\"/configDir=\"\/etc\/jh_taos\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/configFile=\"taos\.cfg\"/configFile=\"jh_taos\.cfg\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/installDir=\"\/usr\/local\/taos\"/installDir=\"\/usr\/local\/jh_taos\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/productName=\"TDengine\"/productName=\"jh_iot\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/emailName=\"taosdata\.com\"/emailName=\"jhict\.com\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/uninstallScript=\"rmtaos\"/uninstallScript=\"rmjh\"/g" ${top_dir}/packaging/tools/make_install.sh
# packaging/rpm/taosd
sed -i "s/TDengine/jh_iot/g" ${top_dir}/packaging/rpm/taosd
sed -i "s/usr\/local\/taos/usr\/local\/jh_taos/g" ${top_dir}/packaging/rpm/taosd
sed -i "s/taosd/jh_taosd/g" ${top_dir}/packaging/rpm/taosd
# packaging/deb/taosd
sed -i "s/TDengine/jh_iot/g" ${top_dir}/packaging/deb/taosd
sed -i "s/usr\/local\/taos/usr\/local\/jh_taos/g" ${top_dir}/packaging/deb/taosd
sed -i "s/taosd/jh_taosd/g" ${top_dir}/packaging/deb/taosd
}
function replace_enterprise_jh() {
# enterprise/src/kit/perfMonitor/perfMonitor.c
sed -i "s/\"taosdata\"/\"jhdata\"/g" ${top_dir}/../enterprise/src/kit/perfMonitor/perfMonitor.c
sed -i "s/TDengine/jh_iot/g" ${top_dir}/../enterprise/src/kit/perfMonitor/perfMonitor.c
# enterprise/src/plugins/admin/src/httpAdminHandle.c
sed -i "s/taos\.cfg/jh_taos\.cfg/g" ${top_dir}/../enterprise/src/plugins/admin/src/httpAdminHandle.c
# enterprise/src/plugins/grant/src/grantMain.c
sed -i "s/taos\.cfg/jh_taos\.cfg/g" ${top_dir}/../enterprise/src/plugins/grant/src/grantMain.c
# enterprise/src/plugins/module/src/moduleMain.c
sed -i "s/taos\.cfg/jh_taos\.cfg/g" ${top_dir}/../enterprise/src/plugins/module/src/moduleMain.c
# enterprise/src/plugins/web
sed -i -e "s/www\.taosdata\.com/www\.jhict\.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/2017, TAOS Data/2021, Jinheng Technology/g" $(grep -r "TAOS Data" ${top_dir}/../enterprise/src/plugins/web | sed -r "s/(.*\.html):\s*(.*)/\1/g")
sed -i -e "s/taosd/jh_taosd/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\">jh_taosd<\/th>/g" ${top_dir}/../enterprise/src/plugins/web/admin/monitor.html
sed -i -e "s/data:\['taosd', 'system'\],/data:\['jh_taosd', 'system'\],/g" ${top_dir}/../enterprise/src/plugins/web/admin/monitor.html
sed -i -e "s/name: 'taosd',/name: 'jh_taosd',/g" ${top_dir}/../enterprise/src/plugins/web/admin/monitor.html
# enterprise/src/plugins/web/admin/*.html
sed -i "s/TDengine/jh_iot/g" ${top_dir}/../enterprise/src/plugins/web/admin/*.html
# enterprise/src/plugins/web/admin/js/*.js
sed -i "s/TDengine/jh_iot/g" ${top_dir}/../enterprise/src/plugins/web/admin/js/*.js
}
set sed="C:\Program Files\Git\usr\bin\sed.exe"
set community_dir=%1
::cmake\install.inc
%sed% -i "s/C:\/TDengine/C:\/KingHistorian/g" %community_dir%\cmake\install.inc
%sed% -i "s/taos\.cfg/kinghistorian\.cfg/g" %community_dir%\cmake\install.inc
%sed% -i "s/taos\.exe/khclient\.exe/g" %community_dir%\cmake\install.inc
%sed% -i "s/taosdemo\.exe/khdemo\.exe/g" %community_dir%\cmake\install.inc
%sed% -i "/src\/connector/d" %community_dir%\cmake\install.inc
%sed% -i "/tests\/examples/d" %community_dir%\cmake\install.inc
::src\kit\shell\CMakeLists.txt
%sed% -i "s/OUTPUT_NAME taos/OUTPUT_NAME khclient/g" %community_dir%\src\kit\shell\CMakeLists.txt
::src\kit\shell\inc\shell.h
%sed% -i "s/taos_history/kh_history/g" %community_dir%\src\kit\shell\inc\shell.h
::src\inc\taosdef.h
%sed% -i "s/\"taosdata\"/\"khroot\"/g" %community_dir%\src\inc\taosdef.h
::src\util\src\tconfig.c
%sed% -i "s/taos\.cfg/kinghistorian\.cfg/g" %community_dir%\src\util\src\tconfig.c
%sed% -i "s/etc\/taos/etc\/kinghistorian/g" %community_dir%\src\util\src\tconfig.c
::src\kit\taosdemo\CMakeLists.txt
%sed% -i "s/ADD_EXECUTABLE(taosdemo/ADD_EXECUTABLE(khdemo/g" %community_dir%\src\kit\taosdemo\CMakeLists.txt
%sed% -i "s/TARGET_LINK_LIBRARIES(taosdemo/TARGET_LINK_LIBRARIES(khdemo/g" %community_dir%\src\kit\taosdemo\CMakeLists.txt
::src\kit\taosdemo\taosdemo.c
%sed% -i "s/taosdemo --help/khdemo --help/g" %community_dir%\src\kit\taosdemo\taosdemo.c
%sed% -i "s/taosdemo --usage/khdemo --usage/g" %community_dir%\src\kit\taosdemo\taosdemo.c
%sed% -i "s/Usage: taosdemo/Usage: khdemo/g" %community_dir%\src\kit\taosdemo\taosdemo.c
%sed% -i "s/taosdemo is simulating/khdemo is simulating/g" %community_dir%\src\kit\taosdemo\taosdemo.c
%sed% -i "s/taosdemo version/khdemo version/g" %community_dir%\src\kit\taosdemo\taosdemo.c
%sed% -i "s/\"taosdata\"/\"khroot\"/g" %community_dir%\src\kit\taosdemo\taosdemo.c
%sed% -i "s/support@taosdata\.com/support@wellintech\.com/g" %community_dir%\src\kit\taosdemo\taosdemo.c
%sed% -i "s/taosc, rest, and stmt/khclient, rest, and stmt/g" %community_dir%\src\kit\taosdemo\taosdemo.c
%sed% -i "s/taosdemo uses/khdemo uses/g" %community_dir%\src\kit\taosdemo\taosdemo.c
%sed% -i "s/use 'taosc'/use 'khclient'/g" %community_dir%\src\kit\taosdemo\taosdemo.c
::src\util\src\tlog.c
%sed% -i "s/log\/taos/log\/kinghistorian/g" %community_dir%\src\util\src\tlog.c
::src\dnode\src\dnodeSystem.c
%sed% -i "s/TDengine/KingHistorian/g" %community_dir%\src\dnode\src\dnodeSystem.c
::src\dnode\src\dnodeMain.c
%sed% -i "s/TDengine/KingHistorian/g" %community_dir%\src\dnode\src\dnodeMain.c
%sed% -i "s/taosdlog/khserverlog/g" %community_dir%\src\dnode\src\dnodeMain.c
::src\client\src\tscSystem.c
%sed% -i "s/taoslog/khclientlog/g" %community_dir%\src\client\src\tscSystem.c
::src\util\src\tnote.c
%sed% -i "s/taosinfo/khinfo/g" %community_dir%\src\util\src\tnote.c
::src\dnode\CMakeLists.txt
%sed% -i "s/taos\.cfg/kinghistorian\.cfg/g" %community_dir%\src\dnode\CMakeLists.txt
::src\kit\taosdump\taosdump.c
%sed% -i "s/support@taosdata\.com/support@wellintech\.com/g" %community_dir%\src\kit\taosdump\taosdump.c
%sed% -i "s/Default is taosdata/Default is khroot/g" %community_dir%\src\kit\taosdump\taosdump.c
%sed% -i "s/\"taosdata\"/\"khroot\"/g" %community_dir%\src\kit\taosdump\taosdump.c
%sed% -i "s/TDengine/KingHistorian/g" %community_dir%\src\kit\taosdump\taosdump.c
%sed% -i "s/taos\/taos\.cfg/kinghistorian\/kinghistorian\.cfg/g" %community_dir%\src\kit\taosdump\taosdump.c
::src\os\src\linux\linuxEnv.c
%sed% -i "s/etc\/taos/etc\/kinghistorian/g" %community_dir%\src\os\src\linux\linuxEnv.c
%sed% -i "s/lib\/taos/lib\/kinghistorian/g" %community_dir%\src\os\src\linux\linuxEnv.c
%sed% -i "s/log\/taos/log\/kinghistorian/g" %community_dir%\src\os\src\linux\linuxEnv.c
::src\kit\shell\src\shellDarwin.c
%sed% -i "s/TDengine shell/KingHistorian shell/g" %community_dir%\src\kit\shell\src\shellDarwin.c
%sed% -i "s/2020 by TAOS Data/2021 by Wellintech/g" %community_dir%\src\kit\shell\src\shellDarwin.c
::src\kit\shell\src\shellLinux.c
%sed% -i "s/support@taosdata\.com/support@wellintech\.com/g" %community_dir%\src\kit\shell\src\shellLinux.c
%sed% -i "s/TDengine shell/KingHistorian shell/g" %community_dir%\src\kit\shell\src\shellLinux.c
%sed% -i "s/2020 by TAOS Data/2021 by Wellintech/g" %community_dir%\src\kit\shell\src\shellLinux.c
::src\os\src\windows\wEnv.c
%sed% -i "s/TDengine/KingHistorian/g" %community_dir%\src\os\src\windows\wEnv.c
::src\kit\shell\src\shellEngine.c
%sed% -i "s/TDengine shell/KingHistorian shell/g" %community_dir%\src\kit\shell\src\shellEngine.c
%sed% -i "s/2020 by TAOS Data, Inc/2021 by Wellintech, Inc/g" %community_dir%\src\kit\shell\src\shellEngine.c
%sed% -i "s/taos connect failed/kh connect failed/g" %community_dir%\src\kit\shell\src\shellEngine.c
%sed% -i "s/\"taos^> \"/\"khclient^> \"/g" %community_dir%\src\kit\shell\src\shellEngine.c
%sed% -i "s/\" -^> \"/\" -^> \"/g" %community_dir%\src\kit\shell\src\shellEngine.c
%sed% -i "s/prompt_size = 6/prompt_size = 10/g" %community_dir%\src\kit\shell\src\shellEngine.c
::src\rpc\src\rpcMain.c
%sed% -i "s/taos connections/kh connections/g" %community_dir%\src\rpc\src\rpcMain.c
::src\plugins\monitor\src\monMain.c
%sed% -i "s/taosd is quiting/khserver is quiting/g" %community_dir%\src\plugins\monitor\src\monMain.c
\ No newline at end of file
#!/bin/bash
function replace_community_kh() {
# cmake/install.inc
sed -i "s/C:\/TDengine/C:\/KingHistorian/g" ${top_dir}/cmake/install.inc
sed -i "s/taos\.cfg/kinghistorian\.cfg/g" ${top_dir}/cmake/install.inc
sed -i "s/taos\.exe/khclient\.exe/g" ${top_dir}/cmake/install.inc
# src/kit/shell/CMakeLists.txt
sed -i "s/OUTPUT_NAME taos/OUTPUT_NAME khclient/g" ${top_dir}/src/kit/shell/CMakeLists.txt
# src/kit/shell/inc/shell.h
sed -i "s/taos_history/kh_history/g" ${top_dir}/src/kit/shell/inc/shell.h
# src/inc/taosdef.h
sed -i "s/\"taosdata\"/\"khroot\"/g" ${top_dir}/src/inc/taosdef.h
# src/util/src/tconfig.c
sed -i "s/taos\.cfg/kinghistorian\.cfg/g" ${top_dir}/src/util/src/tconfig.c
sed -i "s/etc\/taos/etc\/kinghistorian/g" ${top_dir}/src/util/src/tconfig.c
sed -i "s/taos config/kinghistorian config/g" ${top_dir}/src/util/src/tconfig.c
# src/util/src/tlog.c
sed -i "s/log\/taos/log\/kinghistorian/g" ${top_dir}/src/util/src/tlog.c
# src/dnode/src/dnodeSystem.c
sed -i "s/TDengine/KingHistorian/g" ${top_dir}/src/dnode/src/dnodeSystem.c
sed -i "s/TDengine/KingHistorian/g" ${top_dir}/src/dnode/src/dnodeMain.c
sed -i "s/taosdlog/khserverlog/g" ${top_dir}/src/dnode/src/dnodeMain.c
# src/client/src/tscSystem.c
sed -i "s/taoslog/khclientlog/g" ${top_dir}/src/client/src/tscSystem.c
# src/util/src/tnote.c
sed -i "s/taosinfo/khinfo/g" ${top_dir}/src/util/src/tnote.c
# src/dnode/CMakeLists.txt
sed -i "s/taos\.cfg/kinghistorian\.cfg/g" ${top_dir}/src/dnode/CMakeLists.txt
echo "SET_TARGET_PROPERTIES(taosd PROPERTIES OUTPUT_NAME khserver)" >>${top_dir}/src/dnode/CMakeLists.txt
# src/os/src/linux/linuxEnv.c
sed -i "s/etc\/taos/etc\/kinghistorian/g" ${top_dir}/src/os/src/linux/linuxEnv.c
sed -i "s/lib\/taos/lib\/kinghistorian/g" ${top_dir}/src/os/src/linux/linuxEnv.c
sed -i "s/log\/taos/log\/kinghistorian/g" ${top_dir}/src/os/src/linux/linuxEnv.c
# src/kit/shell/src/shellDarwin.c
sed -i "s/TDengine shell/KingHistorian shell/g" ${top_dir}/src/kit/shell/src/shellDarwin.c
sed -i "s/2020 by TAOS Data/2021 by Wellintech/g" ${top_dir}/src/kit/shell/src/shellDarwin.c
# src/kit/shell/src/shellLinux.c
sed -i "s/support@taosdata\.com/support@wellintech\.com/g" ${top_dir}/src/kit/shell/src/shellLinux.c
sed -i "s/TDengine shell/KingHistorian shell/g" ${top_dir}/src/kit/shell/src/shellLinux.c
sed -i "s/2020 by TAOS Data/2021 by Wellintech/g" ${top_dir}/src/kit/shell/src/shellLinux.c
# src/os/src/windows/wEnv.c
sed -i "s/C:\/TDengine/C:\/KingHistorian/g" ${top_dir}/src/os/src/windows/wEnv.c
# src/kit/shell/src/shellEngine.c
sed -i "s/TDengine shell/KingHistorian shell/g" ${top_dir}/src/kit/shell/src/shellEngine.c
sed -i "s/2020 by TAOS Data, Inc/2021 by Wellintech, Inc/g" ${top_dir}/src/kit/shell/src/shellEngine.c
sed -i "s/taos connect failed/khclient connect failed/g" ${top_dir}/src/kit/shell/src/shellEngine.c
sed -i "s/\"taos> \"/\"khclient> \"/g" ${top_dir}/src/kit/shell/src/shellEngine.c
sed -i "s/\" -> \"/\" -> \"/g" ${top_dir}/src/kit/shell/src/shellEngine.c
sed -i "s/prompt_size = 6/prompt_size = 10/g" ${top_dir}/src/kit/shell/src/shellEngine.c
# src/rpc/src/rpcMain.c
sed -i "s/taos connections/kh connections/g" ${top_dir}/src/rpc/src/rpcMain.c
# src/plugins/monitor/src/monMain.c
sed -i "s/taosd is quiting/khserver is quiting/g" ${top_dir}/src/plugins/monitor/src/monMain.c
# packaging/tools/makepkg.sh
sed -i "s/productName=\"TDengine\"/productName=\"KingHistorian\"/g" ${top_dir}/packaging/tools/makepkg.sh
sed -i "s/serverName=\"taosd\"/serverName=\"khserver\"/g" ${top_dir}/packaging/tools/makepkg.sh
sed -i "s/clientName=\"taos\"/clientName=\"khclient\"/g" ${top_dir}/packaging/tools/makepkg.sh
sed -i "s/configFile=\"taos\.cfg\"/configFile=\"kinghistorian\.cfg\"/g" ${top_dir}/packaging/tools/makepkg.sh
sed -i "s/tarName=\"taos\.tar\.gz\"/tarName=\"kinghistorian\.tar\.gz\"/g" ${top_dir}/packaging/tools/makepkg.sh
# packaging/tools/remove.sh
sed -i "s/installDir=\"\/usr\/local\/taos\"/installDir=\"\/usr\/local\/kinghistorian\"/g" ${top_dir}/packaging/tools/remove.sh
sed -i "s/serverName=\"taosd\"/serverName=\"khserver\"/g" ${top_dir}/packaging/tools/remove.sh
sed -i "s/clientName=\"taos\"/clientName=\"khclient\"/g" ${top_dir}/packaging/tools/remove.sh
sed -i "s/uninstallScript=\"rmtaos\"/uninstallScript=\"rmkh\"/g" ${top_dir}/packaging/tools/remove.sh
sed -i "s/productName=\"TDengine\"/productName=\"KingHistorian\"/g" ${top_dir}/packaging/tools/remove.sh
# packaging/tools/startPre.sh
sed -i "s/serverName=\"taosd\"/serverName=\"khserver\"/g" ${top_dir}/packaging/tools/startPre.sh
sed -i "s/logDir=\"\/var\/log\/taos\"/logDir=\"\/var\/log\/kinghistorian\"/g" ${top_dir}/packaging/tools/startPre.sh
# packaging/tools/run_taosd.sh
sed -i "s/taosd/khserver/g" ${top_dir}/packaging/tools/run_taosd.sh
# packaging/tools/install.sh
sed -i "s/clientName=\"taos\"/clientName=\"khclient\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/serverName=\"taosd\"/serverName=\"khserver\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/configFile=\"taos\.cfg\"/configFile=\"kinghistorian\.cfg\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/productName=\"TDengine\"/productName=\"KingHistorian\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/emailName=\"taosdata\.com\"/emailName=\"\wellintech\.com\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/uninstallScript=\"rmtaos\"/uninstallScript=\"rmkh\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/historyFile=\"taos_history\"/historyFile=\"kh_history\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/tarName=\"taos\.tar\.gz\"/tarName=\"kinghistorian\.tar\.gz\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/dataDir=\"\/var\/lib\/taos\"/dataDir=\"\/var\/lib\/kinghistorian\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/logDir=\"\/var\/log\/taos\"/logDir=\"\/var\/log\/kinghistorian\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/configDir=\"\/etc\/taos\"/configDir=\"\/etc\/kinghistorian\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/installDir=\"\/usr\/local\/taos\"/installDir=\"\/usr\/local\/kinghistorian\"/g" ${top_dir}/packaging/tools/install.sh
# packaging/tools/makeclient.sh
sed -i "s/productName=\"TDengine\"/productName=\"KingHistorian\"/g" ${top_dir}/packaging/tools/makeclient.sh
sed -i "s/clientName=\"taos\"/clientName=\"khclient\"/g" ${top_dir}/packaging/tools/makeclient.sh
sed -i "s/configFile=\"taos\.cfg\"/configFile=\"kinghistorian\.cfg\"/g" ${top_dir}/packaging/tools/makeclient.sh
sed -i "s/tarName=\"taos\.tar\.gz\"/tarName=\"kinghistorian\.tar\.gz\"/g" ${top_dir}/packaging/tools/makeclient.sh
# packaging/tools/remove_client.sh
sed -i "s/installDir=\"\/usr\/local\/taos\"/installDir=\"\/usr\/local\/kinghistorian\"/g" ${top_dir}/packaging/tools/remove_client.sh
sed -i "s/clientName=\"taos\"/clientName=\"khclient\"/g" ${top_dir}/packaging/tools/remove_client.sh
sed -i "s/uninstallScript=\"rmtaos\"/uninstallScript=\"rmkh\"/g" ${top_dir}/packaging/tools/remove_client.sh
# packaging/tools/install_client.sh
sed -i "s/dataDir=\"\/var\/lib\/taos\"/dataDir=\"\/var\/lib\/kinghistorian\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/logDir=\"\/var\/log\/taos\"/logDir=\"\/var\/log\/kinghistorian\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/productName=\"TDengine\"/productName=\"KingHistorian\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/installDir=\"\/usr\/local\/taos\"/installDir=\"\/usr\/local\/kinghistorian\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/configDir=\"\/etc\/taos\"/configDir=\"\/etc\/kinghistorian\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/serverName=\"taosd\"/serverName=\"khserver\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/clientName=\"taos\"/clientName=\"khclient\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/uninstallScript=\"rmtaos\"/uninstallScript=\"rmkh\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/configFile=\"taos\.cfg\"/configFile=\"kinghistorian\.cfg\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/tarName=\"taos\.tar\.gz\"/tarName=\"kinghistorian\.tar\.gz\"/g" ${top_dir}/packaging/tools/install_client.sh
# packaging/tools/makearbi.sh
sed -i "s/productName=\"TDengine\"/productName=\"KingHistorian\"/g" ${top_dir}/packaging/tools/makearbi.sh
# packaging/tools/remove_arbi.sh
sed -i "s/TDengine/KingHistorian/g" ${top_dir}/packaging/tools/remove_arbi.sh
# packaging/tools/install_arbi.sh
sed -i "s/TDengine/KingHistorian/g" ${top_dir}/packaging/tools/install_arbi.sh
sed -i "s/taosdata\.com/wellintech\.com/g" ${top_dir}/packaging/tools/install_arbi.sh
# packaging/tools/make_install.sh
sed -i "s/clientName=\"taos\"/clientName=\"khclient\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/serverName=\"taosd\"/serverName=\"khserver\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/logDir=\"\/var\/log\/taos\"/logDir=\"\/var\/log\/kinghistorian\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/dataDir=\"\/var\/lib\/taos\"/dataDir=\"\/var\/lib\/kinghistorian\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/configDir=\"\/etc\/taos\"/configDir=\"\/etc\/kinghistorian\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/configFile=\"taos\.cfg\"/configFile=\"kinghistorian\.cfg\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/installDir=\"\/usr\/local\/taos\"/installDir=\"\/usr\/local\/kinghistorian\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/productName=\"TDengine\"/productName=\"KingHistorian\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/emailName=\"taosdata\.com\"/emailName=\"wellintech\.com\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/uninstallScript=\"rmtaos\"/uninstallScript=\"rmkh\"/g" ${top_dir}/packaging/tools/make_install.sh
# packaging/rpm/taosd
sed -i "s/TDengine/KingHistorian/g" ${top_dir}/packaging/rpm/taosd
sed -i "s/usr\/local\/taos/usr\/local\/kinghistorian/g" ${top_dir}/packaging/rpm/taosd
sed -i "s/taosd/khserver/g" ${top_dir}/packaging/rpm/taosd
# packaging/deb/taosd
sed -i "s/TDengine/KingHistorian/g" ${top_dir}/packaging/deb/taosd
sed -i "s/usr\/local\/taos/usr\/local\/kinghistorian/g" ${top_dir}/packaging/deb/taosd
sed -i "s/taosd/khserver/g" ${top_dir}/packaging/deb/taosd
}
function replace_enterprise_kh() {
# enterprise/src/kit/perfMonitor/perfMonitor.c
sed -i "s/\"taosdata\"/\"khroot\"/g" ${top_dir}/../enterprise/src/kit/perfMonitor/perfMonitor.c
sed -i "s/TDengine/KingHistorian/g" ${top_dir}/../enterprise/src/kit/perfMonitor/perfMonitor.c
# enterprise/src/plugins/admin/src/httpAdminHandle.c
sed -i "s/taos\.cfg/kinghistorian\.cfg/g" ${top_dir}/../enterprise/src/plugins/admin/src/httpAdminHandle.c
# enterprise/src/plugins/grant/src/grantMain.c
sed -i "s/taos\.cfg/kinghistorian\.cfg/g" ${top_dir}/../enterprise/src/plugins/grant/src/grantMain.c
# enterprise/src/plugins/module/src/moduleMain.c
sed -i "s/taos\.cfg/kinghistorian\.cfg/g" ${top_dir}/../enterprise/src/plugins/module/src/moduleMain.c
# enterprise/src/plugins/web
sed -i -e "s/www\.taosdata\.com/www\.kingview\.com/g" $(grep -r "www.taosdata.com" ${top_dir}/../enterprise/src/plugins/web | sed -r "s/(.*\.html):\s*(.*)/\1/g")
sed -i -e "s/2017, TAOS Data/2021, Wellintech/g" $(grep -r "TAOS Data" ${top_dir}/../enterprise/src/plugins/web | sed -r "s/(.*\.html):\s*(.*)/\1/g")
sed -i -e "s/taosd/khserver/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\">khserver<\/th>/g" ${top_dir}/../enterprise/src/plugins/web/admin/monitor.html
sed -i -e "s/data:\['taosd', 'system'\],/data:\['khserver', 'system'\],/g" ${top_dir}/../enterprise/src/plugins/web/admin/monitor.html
sed -i -e "s/name: 'taosd',/name: 'khserver',/g" ${top_dir}/../enterprise/src/plugins/web/admin/monitor.html
# enterprise/src/plugins/web/admin/*.html
sed -i "s/TDengine/KingHistorian/g" ${top_dir}/../enterprise/src/plugins/web/admin/*.html
# enterprise/src/plugins/web/admin/js/*.js
sed -i "s/TDengine/KingHistorian/g" ${top_dir}/../enterprise/src/plugins/web/admin/js/*.js
}
set sed="C:\Program Files\Git\usr\bin\sed.exe"
set community_dir=%1
::cmake\install.inc
%sed% -i "s/C:\/TDengine/C:\/Power/g" %community_dir%\cmake\install.inc
%sed% -i "s/taos\.cfg/power\.cfg/g" %community_dir%\cmake\install.inc
%sed% -i "s/taos\.exe/power\.exe/g" %community_dir%\cmake\install.inc
%sed% -i "/src\/connector/d" %community_dir%\cmake\install.inc
%sed% -i "/tests\/examples/d" %community_dir%\cmake\install.inc
::src\kit\shell\CMakeLists.txt
%sed% -i "s/OUTPUT_NAME taos/OUTPUT_NAME power/g" %community_dir%\src\kit\shell\CMakeLists.txt
::src\kit\shell\inc\shell.h
%sed% -i "s/taos_history/power_history/g" %community_dir%\src\kit\shell\inc\shell.h
::src\inc\taosdef.h
%sed% -i "s/\"taosdata\"/\"powerdb\"/g" %community_dir%\src\inc\taosdef.h
::src\util\src\tconfig.c
%sed% -i "s/taos\.cfg/power\.cfg/g" %community_dir%\src\util\src\tconfig.c
%sed% -i "s/etc\/taos/etc\/power/g" %community_dir%\src\util\src\tconfig.c
::src\util\src\tlog.c
%sed% -i "s/log\/taos/log\/power/g" %community_dir%\src\util\src\tlog.c
::src\dnode\src\dnodeSystem.c
%sed% -i "s/TDengine/Power/g" %community_dir%\src\dnode\src\dnodeSystem.c
::src\dnode\src\dnodeMain.c
%sed% -i "s/TDengine/Power/g" %community_dir%\src\dnode\src\dnodeMain.c
%sed% -i "s/taosdlog/powerdlog/g" %community_dir%\src\dnode\src\dnodeMain.c
::src\client\src\tscSystem.c
%sed% -i "s/taoslog/powerlog/g" %community_dir%\src\client\src\tscSystem.c
::src\util\src\tnote.c
%sed% -i "s/taosinfo/powerinfo/g" %community_dir%\src\util\src\tnote.c
::src\dnode\CMakeLists.txt
%sed% -i "s/taos\.cfg/power\.cfg/g" %community_dir%\src\dnode\CMakeLists.txt
::src\os\src\linux\linuxEnv.c
%sed% -i "s/etc\/taos/etc\/power/g" %community_dir%\src\os\src\linux\linuxEnv.c
%sed% -i "s/lib\/taos/lib\/power/g" %community_dir%\src\os\src\linux\linuxEnv.c
%sed% -i "s/log\/taos/log\/power/g" %community_dir%\src\os\src\linux\linuxEnv.c
::src\os\src\windows\wEnv.c
%sed% -i "s/TDengine/Power/g" %community_dir%\src\os\src\windows\wEnv.c
::src\kit\shell\src\shellEngine.c
%sed% -i "s/TDengine shell/Power shell/g" %community_dir%\src\kit\shell\src\shellEngine.c
%sed% -i "s/2020 by TAOS Data, Inc/2020 by PowerDB, Inc/g" %community_dir%\src\kit\shell\src\shellEngine.c
%sed% -i "s/taos connect failed/power connect failed/g" %community_dir%\src\kit\shell\src\shellEngine.c
%sed% -i "s/\"taos^> \"/\"power^> \"/g" %community_dir%\src\kit\shell\src\shellEngine.c
%sed% -i "s/\" -^> \"/\" -^> \"/g" %community_dir%\src\kit\shell\src\shellEngine.c
%sed% -i "s/prompt_size = 6/prompt_size = 7/g" %community_dir%\src\kit\shell\src\shellEngine.c
::src\rpc\src\rpcMain.c
%sed% -i "s/taos connections/power connections/g" %community_dir%\src\rpc\src\rpcMain.c
::src\plugins\monitor\src\monMain.c
%sed% -i "s/taosd is quiting/powerd is quiting/g" %community_dir%\src\plugins\monitor\src\monMain.c
#!/bin/bash
function replace_community_power() {
# cmake/install.inc
sed -i "s/C:\/TDengine/C:\/Power/g" ${top_dir}/cmake/install.inc
sed -i "s/taos\.cfg/power\.cfg/g" ${top_dir}/cmake/install.inc
sed -i "s/taos\.exe/power\.exe/g" ${top_dir}/cmake/install.inc
sed -i "s/taosdemo\.exe/powerdemo\.exe/g" ${top_dir}/cmake/install.inc
# src/kit/shell/inc/shell.h
sed -i "s/taos_history/power_history/g" ${top_dir}/src/kit/shell/inc/shell.h
# src/inc/taosdef.h
sed -i "s/\"taosdata\"/\"powerdb\"/g" ${top_dir}/src/inc/taosdef.h
# src/util/src/tconfig.c
sed -i "s/taos\.cfg/power\.cfg/g" ${top_dir}/src/util/src/tconfig.c
sed -i "s/etc\/taos/etc\/power/g" ${top_dir}/src/util/src/tconfig.c
# src/util/src/tlog.c
sed -i "s/log\/taos/log\/power/g" ${top_dir}/src/util/src/tlog.c
# src/dnode/src/dnodeSystem.c
sed -i "s/TDengine/Power/g" ${top_dir}/src/dnode/src/dnodeSystem.c
sed -i "s/TDengine/Power/g" ${top_dir}/src/dnode/src/dnodeMain.c
sed -i "s/taosdlog/powerdlog/g" ${top_dir}/src/dnode/src/dnodeMain.c
# src/client/src/tscSystem.c
sed -i "s/taoslog/powerlog/g" ${top_dir}/src/client/src/tscSystem.c
# src/util/src/tnote.c
sed -i "s/taosinfo/powerinfo/g" ${top_dir}/src/util/src/tnote.c
# src/dnode/CMakeLists.txt
sed -i "s/taos\.cfg/power\.cfg/g" ${top_dir}/src/dnode/CMakeLists.txt
# src/os/src/linux/linuxEnv.c
sed -i "s/etc\/taos/etc\/power/g" ${top_dir}/src/os/src/linux/linuxEnv.c
sed -i "s/lib\/taos/lib\/power/g" ${top_dir}/src/os/src/linux/linuxEnv.c
sed -i "s/log\/taos/log\/power/g" ${top_dir}/src/os/src/linux/linuxEnv.c
# src/kit/shell/src/shellLinux.c
sed -i "s/TDengine shell/Power shell/g" ${top_dir}/src/kit/shell/src/shellLinux.c
# src/os/src/windows/wEnv.c
sed -i "s/C:\/TDengine/C:\/Power/g" ${top_dir}/src/os/src/windows/wEnv.c
# src/kit/shell/src/shellEngine.c
sed -i "s/TDengine shell/PowerDB shell/g" ${top_dir}/src/kit/shell/src/shellEngine.c
sed -i "s/2020 by TAOS Data, Inc/2020 by PowerDB, Inc/g" ${top_dir}/src/kit/shell/src/shellEngine.c
sed -i "s/\"taos> \"/\"power> \"/g" ${top_dir}/src/kit/shell/src/shellEngine.c
sed -i "s/\" -> \"/\" -> \"/g" ${top_dir}/src/kit/shell/src/shellEngine.c
sed -i "s/prompt_size = 6/prompt_size = 7/g" ${top_dir}/src/kit/shell/src/shellEngine.c
# src/rpc/src/rpcMain.c
sed -i "s/taos connections/power connections/g" ${top_dir}/src/rpc/src/rpcMain.c
# src/plugins/monitor/src/monMain.c
sed -i "s/taosd is quiting/powerd is quiting/g" ${top_dir}/src/plugins/monitor/src/monMain.c
############
# cmake/install.inc
sed -i "s/C:\/TDengine/C:\/Power/g" ${top_dir}/cmake/install.inc
sed -i "s/taos\.cfg/power\.cfg/g" ${top_dir}/cmake/install.inc
sed -i "s/taos\.exe/power\.exe/g" ${top_dir}/cmake/install.inc
# src/kit/shell/CMakeLists.txt
sed -i "s/OUTPUT_NAME taos/OUTPUT_NAME power/g" ${top_dir}/src/kit/shell/CMakeLists.txt
# src/kit/shell/inc/shell.h
sed -i "s/taos_history/power_history/g" ${top_dir}/src/kit/shell/inc/shell.h
# src/inc/taosdef.h
sed -i "s/\"taosdata\"/\"power\"/g" ${top_dir}/src/inc/taosdef.h
# src/util/src/tconfig.c
sed -i "s/taos\.cfg/power\.cfg/g" ${top_dir}/src/util/src/tconfig.c
sed -i "s/etc\/taos/etc\/power/g" ${top_dir}/src/util/src/tconfig.c
sed -i "s/taos config/power config/g" ${top_dir}/src/util/src/tconfig.c
# src/util/src/tlog.c
sed -i "s/log\/taos/log\/power/g" ${top_dir}/src/util/src/tlog.c
# src/dnode/src/dnodeSystem.c
sed -i "s/TDengine/Power/g" ${top_dir}/src/dnode/src/dnodeSystem.c
sed -i "s/TDengine/Power/g" ${top_dir}/src/dnode/src/dnodeMain.c
sed -i "s/taosdlog/powerdlog/g" ${top_dir}/src/dnode/src/dnodeMain.c
# src/client/src/tscSystem.c
sed -i "s/taoslog/powerlog/g" ${top_dir}/src/client/src/tscSystem.c
# src/util/src/tnote.c
sed -i "s/taosinfo/powerinfo/g" ${top_dir}/src/util/src/tnote.c
# src/dnode/CMakeLists.txt
sed -i "s/taos\.cfg/power\.cfg/g" ${top_dir}/src/dnode/CMakeLists.txt
echo "SET_TARGET_PROPERTIES(taosd PROPERTIES OUTPUT_NAME powerd)" >>${top_dir}/src/dnode/CMakeLists.txt
# src/os/src/linux/linuxEnv.c
sed -i "s/etc\/taos/etc\/power/g" ${top_dir}/src/os/src/linux/linuxEnv.c
sed -i "s/lib\/taos/lib\/power/g" ${top_dir}/src/os/src/linux/linuxEnv.c
sed -i "s/log\/taos/log\/power/g" ${top_dir}/src/os/src/linux/linuxEnv.c
# src/kit/shell/src/shellDarwin.c
sed -i "s/TDengine shell/Power shell/g" ${top_dir}/src/kit/shell/src/shellDarwin.c
# src/kit/shell/src/shellLinux.c
sed -i "s/TDengine shell/Power shell/g" ${top_dir}/src/kit/shell/src/shellLinux.c
# src/os/src/windows/wEnv.c
sed -i "s/C:\/TDengine/C:\/Power/g" ${top_dir}/src/os/src/windows/wEnv.c
# src/kit/shell/src/shellEngine.c
sed -i "s/TDengine shell/Power shell/g" ${top_dir}/src/kit/shell/src/shellEngine.c
sed -i "s/taos connect failed/power connect failed/g" ${top_dir}/src/kit/shell/src/shellEngine.c
sed -i "s/\"taos> \"/\"power> \"/g" ${top_dir}/src/kit/shell/src/shellEngine.c
sed -i "s/\" -> \"/\" -> \"/g" ${top_dir}/src/kit/shell/src/shellEngine.c
sed -i "s/prompt_size = 6/prompt_size = 7/g" ${top_dir}/src/kit/shell/src/shellEngine.c
# src/rpc/src/rpcMain.c
sed -i "s/taos connections/power connections/g" ${top_dir}/src/rpc/src/rpcMain.c
# src/plugins/monitor/src/monMain.c
sed -i "s/taosd is quiting/powerd is quiting/g" ${top_dir}/src/plugins/monitor/src/monMain.c
# packaging/tools/makepkg.sh
sed -i "s/productName=\"TDengine\"/productName=\"Power\"/g" ${top_dir}/packaging/tools/makepkg.sh
sed -i "s/serverName=\"taosd\"/serverName=\"powerd\"/g" ${top_dir}/packaging/tools/makepkg.sh
sed -i "s/clientName=\"taos\"/clientName=\"power\"/g" ${top_dir}/packaging/tools/makepkg.sh
sed -i "s/configFile=\"taos\.cfg\"/configFile=\"power\.cfg\"/g" ${top_dir}/packaging/tools/makepkg.sh
sed -i "s/tarName=\"taos\.tar\.gz\"/tarName=\"power\.tar\.gz\"/g" ${top_dir}/packaging/tools/makepkg.sh
# packaging/tools/remove.sh
sed -i "s/installDir=\"\/usr\/local\/taos\"/installDir=\"\/usr\/local\/power\"/g" ${top_dir}/packaging/tools/remove.sh
sed -i "s/serverName=\"taosd\"/serverName=\"pwerd\"/g" ${top_dir}/packaging/tools/remove.sh
sed -i "s/clientName=\"taos\"/clientName=\"power\"/g" ${top_dir}/packaging/tools/remove.sh
sed -i "s/uninstallScript=\"rmtaos\"/uninstallScript=\"rmpower\"/g" ${top_dir}/packaging/tools/remove.sh
sed -i "s/productName=\"TDengine\"/productName=\"Power\"/g" ${top_dir}/packaging/tools/remove.sh
# packaging/tools/startPre.sh
sed -i "s/serverName=\"taosd\"/serverName=\"powerd\"/g" ${top_dir}/packaging/tools/startPre.sh
sed -i "s/logDir=\"\/var\/log\/taos\"/logDir=\"\/var\/log\/Power\"/g" ${top_dir}/packaging/tools/startPre.sh
# packaging/tools/run_taosd.sh
sed -i "s/taosd/powerd/g" ${top_dir}/packaging/tools/run_taosd.sh
# packaging/tools/install.sh
sed -i "s/clientName=\"taos\"/clientName=\"power\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/serverName=\"taosd\"/serverName=\"powerd\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/configFile=\"taos\.cfg\"/configFile=\"power\.cfg\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/productName=\"TDengine\"/productName=\"Power\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/uninstallScript=\"rmtaos\"/uninstallScript=\"rmpower\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/historyFile=\"taos_history\"/historyFile=\"power_history\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/tarName=\"taos\.tar\.gz\"/tarName=\"power\.tar\.gz\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/dataDir=\"\/var\/lib\/taos\"/dataDir=\"\/var\/lib\/power\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/logDir=\"\/var\/log\/taos\"/logDir=\"\/var\/log\/power\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/configDir=\"\/etc\/taos\"/configDir=\"\/etc\/power\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/installDir=\"\/usr\/local\/taos\"/installDir=\"\/usr\/local\/power\"/g" ${top_dir}/packaging/tools/install.sh
# packaging/tools/makeclient.sh
sed -i "s/productName=\"TDengine\"/productName=\"Power\"/g" ${top_dir}/packaging/tools/makeclient.sh
sed -i "s/clientName=\"taos\"/clientName=\"power\"/g" ${top_dir}/packaging/tools/makeclient.sh
sed -i "s/configFile=\"taos\.cfg\"/configFile=\"power\.cfg\"/g" ${top_dir}/packaging/tools/makeclient.sh
sed -i "s/tarName=\"taos\.tar\.gz\"/tarName=\"power\.tar\.gz\"/g" ${top_dir}/packaging/tools/makeclient.sh
# packaging/tools/remove_client.sh
sed -i "s/installDir=\"\/usr\/local\/taos\"/installDir=\"\/usr\/local\/power\"/g" ${top_dir}/packaging/tools/remove_client.sh
sed -i "s/clientName=\"taos\"/clientName=\"power\"/g" ${top_dir}/packaging/tools/remove_client.sh
sed -i "s/uninstallScript=\"rmtaos\"/uninstallScript=\"rmpower\"/g" ${top_dir}/packaging/tools/remove_client.sh
# packaging/tools/install_client.sh
sed -i "s/dataDir=\"\/var\/lib\/taos\"/dataDir=\"\/var\/lib\/power\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/logDir=\"\/var\/log\/taos\"/logDir=\"\/var\/log\/power\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/productName=\"TDengine\"/productName=\"Power\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/installDir=\"\/usr\/local\/taos\"/installDir=\"\/usr\/local\/power\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/configDir=\"\/etc\/taos\"/configDir=\"\/etc\/power\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/serverName=\"taosd\"/serverName=\"powerd\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/clientName=\"taos\"/clientName=\"power\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/uninstallScript=\"rmtaos\"/uninstallScript=\"rmpower\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/configFile=\"taos\.cfg\"/configFile=\"power\.cfg\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/tarName=\"taos\.tar\.gz\"/tarName=\"power\.tar\.gz\"/g" ${top_dir}/packaging/tools/install_client.sh
# packaging/tools/makearbi.sh
sed -i "s/productName=\"TDengine\"/productName=\"Power\"/g" ${top_dir}/packaging/tools/makearbi.sh
# packaging/tools/remove_arbi.sh
sed -i "s/TDengine/Power/g" ${top_dir}/packaging/tools/remove_arbi.sh
# packaging/tools/install_arbi.sh
sed -i "s/TDengine/Power/g" ${top_dir}/packaging/tools/install_arbi.sh
# packaging/tools/make_install.sh
sed -i "s/clientName=\"taos\"/clientName=\"power\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/serverName=\"taosd\"/serverName=\"powerd\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/logDir=\"\/var\/log\/taos\"/logDir=\"\/var\/log\/power\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/dataDir=\"\/var\/lib\/taos\"/dataDir=\"\/var\/lib\/power\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/configDir=\"\/etc\/taos\"/configDir=\"\/etc\/power\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/configFile=\"taos\.cfg\"/configFile=\"power\.cfg\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/installDir=\"\/usr\/local\/taos\"/installDir=\"\/usr\/local\/power\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/productName=\"TDengine\"/productName=\"Power\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/uninstallScript=\"rmtaos\"/uninstallScript=\"rmpower\"/g" ${top_dir}/packaging/tools/make_install.sh
# packaging/rpm/taosd
sed -i "s/TDengine/Power/g" ${top_dir}/packaging/rpm/taosd
sed -i "s/usr\/local\/taos/usr\/local\/power/g" ${top_dir}/packaging/rpm/taosd
sed -i "s/taosd/powerd/g" ${top_dir}/packaging/rpm/taosd
# packaging/deb/taosd
sed -i "s/TDengine/Power/g" ${top_dir}/packaging/deb/taosd
sed -i "s/usr\/local\/taos/usr\/local\/power/g" ${top_dir}/packaging/deb/taosd
sed -i "s/taosd/powerd/g" ${top_dir}/packaging/deb/taosd
}
function replace_enterprise_power() {
# enterprise/src/kit/perfMonitor/perfMonitor.c
sed -i "s/\"taosdata\"/\"powerdb\"/g" ${top_dir}/../enterprise/src/kit/perfMonitor/perfMonitor.c
sed -i "s/TDengine/Power/g" ${top_dir}/../enterprise/src/kit/perfMonitor/perfMonitor.c
# enterprise/src/plugins/admin/src/httpAdminHandle.c
sed -i "s/taos\.cfg/power\.cfg/g" ${top_dir}/../enterprise/src/plugins/admin/src/httpAdminHandle.c
# enterprise/src/plugins/grant/src/grantMain.c
sed -i "s/taos\.cfg/power\.cfg/g" ${top_dir}/../enterprise/src/plugins/grant/src/grantMain.c
# enterprise/src/plugins/module/src/moduleMain.c
sed -i "s/taos\.cfg/power\.cfg/g" ${top_dir}/../enterprise/src/plugins/module/src/moduleMain.c
# enterprise/src/plugins/web
sed -i -e "s/taosd/powerd/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\">powerd<\/th>/g" ${top_dir}/../enterprise/src/plugins/web/admin/monitor.html
sed -i -e "s/data:\['taosd', 'system'\],/data:\['powerd', 'system'\],/g" ${top_dir}/../enterprise/src/plugins/web/admin/monitor.html
sed -i -e "s/name: 'taosd',/name: 'powerd',/g" ${top_dir}/../enterprise/src/plugins/web/admin/monitor.html
# enterprise/src/plugins/web/admin/*.html
sed -i "s/TDengine/Power/g" ${top_dir}/../enterprise/src/plugins/web/admin/*.html
# enterprise/src/plugins/web/admin/js/*.js
sed -i "s/TDengine/Power/g" ${top_dir}/../enterprise/src/plugins/web/admin/js/*.js
}
set sed="C:\Program Files\Git\usr\bin\sed.exe"
set community_dir=%1
::cmake\install.inc
%sed% -i "s/C:\/TDengine/C:\/ProDB/g" %community_dir%\cmake\install.inc
%sed% -i "s/taos\.cfg/prodb\.cfg/g" %community_dir%\cmake\install.inc
%sed% -i "s/taos\.exe/prodbc\.exe/g" %community_dir%\cmake\install.inc
%sed% -i "/src\/connector/d" %community_dir%\cmake\install.inc
%sed% -i "/tests\/examples/d" %community_dir%\cmake\install.inc
::src\kit\shell\CMakeLists.txt
%sed% -i "s/OUTPUT_NAME taos/OUTPUT_NAME prodbc/g" %community_dir%\src\kit\shell\CMakeLists.txt
::src\kit\shell\inc\shell.h
%sed% -i "s/taos_history/prodb_history/g" %community_dir%\src\kit\shell\inc\shell.h
::src\inc\taosdef.h
%sed% -i "s/\"taosdata\"/\"prodb\"/g" %community_dir%\src\inc\taosdef.h
::src\util\src\tconfig.c
%sed% -i "s/taos\.cfg/prodb\.cfg/g" %community_dir%\src\util\src\tconfig.c
%sed% -i "s/etc\/taos/etc\/ProDB/g" %community_dir%\src\util\src\tconfig.c
::src\util\src\tlog.c
%sed% -i "s/log\/taos/log\/ProDB/g" %community_dir%\src\util\src\tlog.c
::src\dnode\src\dnodeSystem.c
%sed% -i "s/TDengine/ProDB/g" %community_dir%\src\dnode\src\dnodeSystem.c
::src\dnode\src\dnodeMain.c
%sed% -i "s/TDengine/ProDB/g" %community_dir%\src\dnode\src\dnodeMain.c
%sed% -i "s/taosdlog/prodlog/g" %community_dir%\src\dnode\src\dnodeMain.c
::src\client\src\tscSystem.c
%sed% -i "s/taoslog/prolog/g" %community_dir%\src\client\src\tscSystem.c
::src\util\src\tnote.c
%sed% -i "s/taosinfo/proinfo/g" %community_dir%\src\util\src\tnote.c
::src\dnode\CMakeLists.txt
%sed% -i "s/taos\.cfg/prodb\.cfg/g" %community_dir%\src\dnode\CMakeLists.txt
::src\os\src\linux\linuxEnv.c
%sed% -i "s/etc\/taos/etc\/ProDB/g" %community_dir%\src\os\src\linux\linuxEnv.c
%sed% -i "s/lib\/taos/lib\/ProDB/g" %community_dir%\src\os\src\linux\linuxEnv.c
%sed% -i "s/log\/taos/log\/ProDB/g" %community_dir%\src\os\src\linux\linuxEnv.c
::src\kit\shell\src\shellDarwin.c
%sed% -i "s/TDengine shell/ProDB shell/g" %community_dir%\src\kit\shell\src\shellDarwin.c
%sed% -i "s/2020 by TAOS Data/2021 by HanaTech/g" %community_dir%\src\kit\shell\src\shellDarwin.c
::src\kit\shell\src\shellLinux.c
%sed% -i "s/support@taosdata\.com/support@hanatech\.com\.cn/g" %community_dir%\src\kit\shell\src\shellLinux.c
%sed% -i "s/TDengine shell/ProDB shell/g" %community_dir%\src\kit\shell\src\shellLinux.c
%sed% -i "s/2020 by TAOS Data/2021 by HanaTech/g" %community_dir%\src\kit\shell\src\shellLinux.c
::src\os\src\windows\wEnv.c
%sed% -i "s/TDengine/ProDB/g" %community_dir%\src\os\src\windows\wEnv.c
::src\kit\shell\src\shellEngine.c
%sed% -i "s/TDengine shell/ProDB shell/g" %community_dir%\src\kit\shell\src\shellEngine.c
%sed% -i "s/2020 by TAOS Data, Inc/2021 by HanaTech, Inc/g" %community_dir%\src\kit\shell\src\shellEngine.c
%sed% -i "s/taos connect failed/prodbc connect failed/g" %community_dir%\src\kit\shell\src\shellEngine.c
%sed% -i "s/\"taos^> \"/\"ProDB^> \"/g" %community_dir%\src\kit\shell\src\shellEngine.c
%sed% -i "s/\" -^> \"/\" -^> \"/g" %community_dir%\src\kit\shell\src\shellEngine.c
%sed% -i "s/prompt_size = 6/prompt_size = 7/g" %community_dir%\src\kit\shell\src\shellEngine.c
::src\rpc\src\rpcMain.c
%sed% -i "s/taos connections/prodbc connections/g" %community_dir%\src\rpc\src\rpcMain.c
::src\plugins\monitor\src\monMain.c
%sed% -i "s/taosd is quiting/prodbs is quiting/g" %community_dir%\src\plugins\monitor\src\monMain.c
#!/bin/bash
function replace_community_pro() {
# 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\.exe/prodbc\.exe/g" ${top_dir}/cmake/install.inc
# src/kit/shell/CMakeLists.txt
sed -i "s/OUTPUT_NAME taos/OUTPUT_NAME prodbc/g" ${top_dir}/src/kit/shell/CMakeLists.txt
# src/kit/shell/inc/shell.h
sed -i "s/taos_history/prodb_history/g" ${top_dir}/src/kit/shell/inc/shell.h
# src/inc/taosdef.h
sed -i "s/\"taosdata\"/\"prodb\"/g" ${top_dir}/src/inc/taosdef.h
# 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/taos config/prodb config/g" ${top_dir}/src/util/src/tconfig.c
# 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
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/taosdlog/prodlog/g" ${top_dir}/src/dnode/src/dnodeMain.c
# src/client/src/tscSystem.c
sed -i "s/taoslog/prolog/g" ${top_dir}/src/client/src/tscSystem.c
# src/util/src/tnote.c
sed -i "s/taosinfo/proinfo/g" ${top_dir}/src/util/src/tnote.c
# 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
# 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/log\/taos/log\/ProDB/g" ${top_dir}/src/os/src/linux/linuxEnv.c
# src/kit/shell/src/shellDarwin.c
sed -i "s/TDengine shell/ProDB shell/g" ${top_dir}/src/kit/shell/src/shellDarwin.c
sed -i "s/2020 by TAOS Data/2021 by HanaTech/g" ${top_dir}/src/kit/shell/src/shellDarwin.c
# src/kit/shell/src/shellLinux.c
sed -i "s/support@taosdata\.com/support@hanatech\.com\.cn/g" ${top_dir}/src/kit/shell/src/shellLinux.c
sed -i "s/TDengine shell/ProDB shell/g" ${top_dir}/src/kit/shell/src/shellLinux.c
sed -i "s/2020 by TAOS Data/2021 by HanaTech/g" ${top_dir}/src/kit/shell/src/shellLinux.c
# src/os/src/windows/wEnv.c
sed -i "s/C:\/TDengine/C:\/ProDB/g" ${top_dir}/src/os/src/windows/wEnv.c
# src/kit/shell/src/shellEngine.c
sed -i "s/TDengine shell/ProDB shell/g" ${top_dir}/src/kit/shell/src/shellEngine.c
sed -i "s/2020 by TAOS Data, Inc/2021 by Hanatech, Inc/g" ${top_dir}/src/kit/shell/src/shellEngine.c
sed -i "s/taos connect failed/prodbc connect failed/g" ${top_dir}/src/kit/shell/src/shellEngine.c
sed -i "s/\"taos> \"/\"ProDB> \"/g" ${top_dir}/src/kit/shell/src/shellEngine.c
sed -i "s/\" -> \"/\" -> \"/g" ${top_dir}/src/kit/shell/src/shellEngine.c
sed -i "s/prompt_size = 6/prompt_size = 7/g" ${top_dir}/src/kit/shell/src/shellEngine.c
# src/rpc/src/rpcMain.c
sed -i "s/taos connections/prodbc connections/g" ${top_dir}/src/rpc/src/rpcMain.c
# src/plugins/monitor/src/monMain.c
sed -i "s/taosd is quiting/prodbs is quiting/g" ${top_dir}/src/plugins/monitor/src/monMain.c
# packaging/tools/makepkg.sh
sed -i "s/productName=\"TDengine\"/productName=\"ProDB\"/g" ${top_dir}/packaging/tools/makepkg.sh
sed -i "s/serverName=\"taosd\"/serverName=\"prodbs\"/g" ${top_dir}/packaging/tools/makepkg.sh
sed -i "s/clientName=\"taos\"/clientName=\"prodbc\"/g" ${top_dir}/packaging/tools/makepkg.sh
sed -i "s/configFile=\"taos\.cfg\"/configFile=\"prodb\.cfg\"/g" ${top_dir}/packaging/tools/makepkg.sh
sed -i "s/tarName=\"taos\.tar\.gz\"/tarName=\"prodb\.tar\.gz\"/g" ${top_dir}/packaging/tools/makepkg.sh
# packaging/tools/remove.sh
sed -i "s/installDir=\"\/usr\/local\/taos\"/installDir=\"\/usr\/local\/ProDB\"/g" ${top_dir}/packaging/tools/remove.sh
sed -i "s/serverName=\"taosd\"/serverName=\"prodbs\"/g" ${top_dir}/packaging/tools/remove.sh
sed -i "s/clientName=\"taos\"/clientName=\"prodbc\"/g" ${top_dir}/packaging/tools/remove.sh
sed -i "s/uninstallScript=\"rmtaos\"/uninstallScript=\"rmpro\"/g" ${top_dir}/packaging/tools/remove.sh
sed -i "s/productName=\"TDengine\"/productName=\"ProDB\"/g" ${top_dir}/packaging/tools/remove.sh
# packaging/tools/startPre.sh
sed -i "s/serverName=\"taosd\"/serverName=\"prodbs\"/g" ${top_dir}/packaging/tools/startPre.sh
sed -i "s/logDir=\"\/var\/log\/taos\"/logDir=\"\/var\/log\/ProDB\"/g" ${top_dir}/packaging/tools/startPre.sh
# packaging/tools/run_taosd.sh
sed -i "s/taosd/prodbs/g" ${top_dir}/packaging/tools/run_taosd.sh
# packaging/tools/install.sh
sed -i "s/clientName=\"taos\"/clientName=\"prodbc\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/serverName=\"taosd\"/serverName=\"prodbs\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/configFile=\"taos\.cfg\"/configFile=\"prodb\.cfg\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/productName=\"TDengine\"/productName=\"ProDB\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/emailName=\"taosdata\.com\"/emailName=\"\hanatech\.com\.cn\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/uninstallScript=\"rmtaos\"/uninstallScript=\"rmpro\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/historyFile=\"taos_history\"/historyFile=\"prodb_history\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/tarName=\"taos\.tar\.gz\"/tarName=\"prodb\.tar\.gz\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/dataDir=\"\/var\/lib\/taos\"/dataDir=\"\/var\/lib\/ProDB\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/logDir=\"\/var\/log\/taos\"/logDir=\"\/var\/log\/ProDB\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/configDir=\"\/etc\/taos\"/configDir=\"\/etc\/ProDB\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/installDir=\"\/usr\/local\/taos\"/installDir=\"\/usr\/local\/ProDB\"/g" ${top_dir}/packaging/tools/install.sh
# packaging/tools/makeclient.sh
sed -i "s/productName=\"TDengine\"/productName=\"ProDB\"/g" ${top_dir}/packaging/tools/makeclient.sh
sed -i "s/clientName=\"taos\"/clientName=\"prodbc\"/g" ${top_dir}/packaging/tools/makeclient.sh
sed -i "s/configFile=\"taos\.cfg\"/configFile=\"prodb\.cfg\"/g" ${top_dir}/packaging/tools/makeclient.sh
sed -i "s/tarName=\"taos\.tar\.gz\"/tarName=\"prodb\.tar\.gz\"/g" ${top_dir}/packaging/tools/makeclient.sh
# packaging/tools/remove_client.sh
sed -i "s/installDir=\"\/usr\/local\/taos\"/installDir=\"\/usr\/local\/ProDB\"/g" ${top_dir}/packaging/tools/remove_client.sh
sed -i "s/clientName=\"taos\"/clientName=\"prodbc\"/g" ${top_dir}/packaging/tools/remove_client.sh
sed -i "s/uninstallScript=\"rmtaos\"/uninstallScript=\"rmpro\"/g" ${top_dir}/packaging/tools/remove_client.sh
# packaging/tools/install_client.sh
sed -i "s/dataDir=\"\/var\/lib\/taos\"/dataDir=\"\/var\/lib\/ProDB\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/logDir=\"\/var\/log\/taos\"/logDir=\"\/var\/log\/ProDB\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/productName=\"TDengine\"/productName=\"ProDB\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/installDir=\"\/usr\/local\/taos\"/installDir=\"\/usr\/local\/ProDB\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/configDir=\"\/etc\/taos\"/configDir=\"\/etc\/ProDB\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/serverName=\"taosd\"/serverName=\"prodbs\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/clientName=\"taos\"/clientName=\"prodbc\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/uninstallScript=\"rmtaos\"/uninstallScript=\"rmpro\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/configFile=\"taos\.cfg\"/configFile=\"prodb\.cfg\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/tarName=\"taos\.tar\.gz\"/tarName=\"prodb\.tar\.gz\"/g" ${top_dir}/packaging/tools/install_client.sh
# packaging/tools/makearbi.sh
sed -i "s/productName=\"TDengine\"/productName=\"ProDB\"/g" ${top_dir}/packaging/tools/makearbi.sh
# packaging/tools/remove_arbi.sh
sed -i "s/TDengine/ProDB/g" ${top_dir}/packaging/tools/remove_arbi.sh
# packaging/tools/install_arbi.sh
sed -i "s/TDengine/ProDB/g" ${top_dir}/packaging/tools/install_arbi.sh
sed -i "s/taosdata\.com/hanatech\.com\.cn/g" ${top_dir}/packaging/tools/install_arbi.sh
# packaging/tools/make_install.sh
sed -i "s/clientName=\"taos\"/clientName=\"prodbc\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/serverName=\"taosd\"/serverName=\"prodbs\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/logDir=\"\/var\/log\/taos\"/logDir=\"\/var\/log\/ProDB\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/dataDir=\"\/var\/lib\/taos\"/dataDir=\"\/var\/lib\/ProDB\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/configDir=\"\/etc\/taos\"/configDir=\"\/etc\/ProDB\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/configFile=\"taos\.cfg\"/configFile=\"prodb\.cfg\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/installDir=\"\/usr\/local\/taos\"/installDir=\"\/usr\/local\/ProDB\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/productName=\"TDengine\"/productName=\"ProDB\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/emailName=\"taosdata\.com\"/emailName=\"hanatech\.com\.cn\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/uninstallScript=\"rmtaos\"/uninstallScript=\"rmpro\"/g" ${top_dir}/packaging/tools/make_install.sh
# packaging/rpm/taosd
sed -i "s/TDengine/ProDB/g" ${top_dir}/packaging/rpm/taosd
sed -i "s/usr\/local\/taos/usr\/local\/ProDB/g" ${top_dir}/packaging/rpm/taosd
sed -i "s/taosd/prodbs/g" ${top_dir}/packaging/rpm/taosd
# packaging/deb/taosd
sed -i "s/TDengine/ProDB/g" ${top_dir}/packaging/deb/taosd
sed -i "s/usr\/local\/taos/usr\/local\/ProDB/g" ${top_dir}/packaging/deb/taosd
sed -i "s/taosd/prodbs/g" ${top_dir}/packaging/deb/taosd
}
function replace_enterprise_pro() {
# 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
# 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
sed -i "s/taos\.cfg/prodb\.cfg/g" ${top_dir}/../enterprise/src/plugins/grant/src/grantMain.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
# 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/2017, TAOS Data/2021, 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
}
set sed="C:\Program Files\Git\usr\bin\sed.exe"
set community_dir=%1
::cmake\install.inc
%sed% -i "s/C:\/TDengine/C:\/TQ/g" %community_dir%\cmake\install.inc
%sed% -i "s/taos\.cfg/tq\.cfg/g" %community_dir%\cmake\install.inc
%sed% -i "s/taos\.exe/tq\.exe/g" %community_dir%\cmake\install.inc
%sed% -i "/src\/connector/d" %community_dir%\cmake\install.inc
%sed% -i "/tests\/examples/d" %community_dir%\cmake\install.inc
::src\kit\shell\CMakeLists.txt
%sed% -i "s/OUTPUT_NAME taos/OUTPUT_NAME tq/g" %community_dir%\src\kit\shell\CMakeLists.txt
::src\kit\shell\inc\shell.h
%sed% -i "s/taos_history/tq_history/g" %community_dir%\src\kit\shell\inc\shell.h
::src\inc\taosdef.h
%sed% -i "s/\"taosdata\"/\"tqueue\"/g" %community_dir%\src\inc\taosdef.h
::src\util\src\tconfig.c
%sed% -i "s/taos\.cfg/tq\.cfg/g" %community_dir%\src\util\src\tconfig.c
%sed% -i "s/etc\/taos/etc\/tq/g" %community_dir%\src\util\src\tconfig.c
::src\util\src\tlog.c
%sed% -i "s/log\/taos/log\/tq/g" %community_dir%\src\util\src\tlog.c
::src\dnode\src\dnodeSystem.c
%sed% -i "s/TDengine/TQ/g" %community_dir%\src\dnode\src\dnodeSystem.c
::src\dnode\src\dnodeMain.c
%sed% -i "s/TDengine/TQ/g" %community_dir%\src\dnode\src\dnodeMain.c
%sed% -i "s/taosdlog/tqdlog/g" %community_dir%\src\dnode\src\dnodeMain.c
::src\client\src\tscSystem.c
%sed% -i "s/taoslog/tqlog/g" %community_dir%\src\client\src\tscSystem.c
::src\util\src\tnote.c
%sed% -i "s/taosinfo/tqinfo/g" %community_dir%\src\util\src\tnote.c
::src\dnode\CMakeLists.txt
%sed% -i "s/taos\.cfg/tq\.cfg/g" %community_dir%\src\dnode\CMakeLists.txt
::src\os\src\linux\linuxEnv.c
%sed% -i "s/etc\/taos/etc\/tq/g" %community_dir%\src\os\src\linux\linuxEnv.c
%sed% -i "s/lib\/taos/lib\/tq/g" %community_dir%\src\os\src\linux\linuxEnv.c
%sed% -i "s/log\/taos/log\/tq/g" %community_dir%\src\os\src\linux\linuxEnv.c
::src\os\src\windows\wEnv.c
%sed% -i "s/TDengine/TQ/g" %community_dir%\src\os\src\windows\wEnv.c
::src\kit\shell\src\shellEngine.c
%sed% -i "s/TDengine shell/TQ shell/g" %community_dir%\src\kit\shell\src\shellEngine.c
%sed% -i "s/\"taos^> \"/\"tq^> \"/g" %community_dir%\src\kit\shell\src\shellEngine.c
%sed% -i "s/\" -^> \"/\" -^> \"/g" %community_dir%\src\kit\shell\src\shellEngine.c
%sed% -i "s/prompt_size = 6/prompt_size = 4/g" %community_dir%\src\kit\shell\src\shellEngine.c
::src\rpc\src\rpcMain.c
%sed% -i "s/taos connections/tq connections/g" %community_dir%\src\rpc\src\rpcMain.c
::src\plugins\monitor\src\monMain.c
%sed% -i "s/taosd is quiting/tqd is quiting/g" %community_dir%\src\plugins\monitor\src\monMain.c
#!/bin/bash
function replace_community_tq() {
# cmake/install.inc
sed -i "s/C:\/TDengine/C:\/TQ/g" ${top_dir}/cmake/install.inc
sed -i "s/taos\.cfg/tq\.cfg/g" ${top_dir}/cmake/install.inc
sed -i "s/taos\.exe/tq\.exe/g" ${top_dir}/cmake/install.inc
# src/kit/shell/CMakeLists.txt
sed -i "s/OUTPUT_NAME taos/OUTPUT_NAME tq/g" ${top_dir}/src/kit/shell/CMakeLists.txt
# src/kit/shell/inc/shell.h
sed -i "s/taos_history/tq_history/g" ${top_dir}/src/kit/shell/inc/shell.h
# src/inc/taosdef.h
sed -i "s/\"taosdata\"/\"tqueue\"/g" ${top_dir}/src/inc/taosdef.h
# src/util/src/tconfig.c
sed -i "s/taos\.cfg/tq\.cfg/g" ${top_dir}/src/util/src/tconfig.c
sed -i "s/etc\/taos/etc\/tq/g" ${top_dir}/src/util/src/tconfig.c
sed -i "s/taos config/tq config/g" ${top_dir}/src/util/src/tconfig.c
# src/util/src/tlog.c
sed -i "s/log\/taos/log\/tq/g" ${top_dir}/src/util/src/tlog.c
# src/dnode/src/dnodeSystem.c
sed -i "s/TDengine/TQ/g" ${top_dir}/src/dnode/src/dnodeSystem.c
sed -i "s/TDengine/TQ/g" ${top_dir}/src/dnode/src/dnodeMain.c
sed -i "s/taosdlog/tqdlog/g" ${top_dir}/src/dnode/src/dnodeMain.c
# src/client/src/tscSystem.c
sed -i "s/taoslog/tqlog/g" ${top_dir}/src/client/src/tscSystem.c
# src/util/src/tnote.c
sed -i "s/taosinfo/tqinfo/g" ${top_dir}/src/util/src/tnote.c
# src/dnode/CMakeLists.txt
sed -i "s/taos\.cfg/tq\.cfg/g" ${top_dir}/src/dnode/CMakeLists.txt
echo "SET_TARGET_PROPERTIES(taosd PROPERTIES OUTPUT_NAME tqd)" >>${top_dir}/src/dnode/CMakeLists.txt
# src/os/src/linux/linuxEnv.c
sed -i "s/etc\/taos/etc\/tq/g" ${top_dir}/src/os/src/linux/linuxEnv.c
sed -i "s/lib\/taos/lib\/tq/g" ${top_dir}/src/os/src/linux/linuxEnv.c
sed -i "s/log\/taos/log\/tq/g" ${top_dir}/src/os/src/linux/linuxEnv.c
# src/kit/shell/src/shellDarwin.c
sed -i "s/TDengine shell/TQ shell/g" ${top_dir}/src/kit/shell/src/shellDarwin.c
# src/kit/shell/src/shellLinux.c
sed -i "s/TDengine shell/TQ shell/g" ${top_dir}/src/kit/shell/src/shellLinux.c
# src/os/src/windows/wEnv.c
sed -i "s/C:\/TDengine/C:\/TQ/g" ${top_dir}/src/os/src/windows/wEnv.c
# src/kit/shell/src/shellEngine.c
sed -i "s/TDengine shell/TQ shell/g" ${top_dir}/src/kit/shell/src/shellEngine.c
sed -i "s/taos connect failed/tq connect failed/g" ${top_dir}/src/kit/shell/src/shellEngine.c
sed -i "s/\"taos> \"/\"tq> \"/g" ${top_dir}/src/kit/shell/src/shellEngine.c
sed -i "s/\" -> \"/\" -> \"/g" ${top_dir}/src/kit/shell/src/shellEngine.c
sed -i "s/prompt_size = 6/prompt_size = 4/g" ${top_dir}/src/kit/shell/src/shellEngine.c
# src/rpc/src/rpcMain.c
sed -i "s/taos connections/tq connections/g" ${top_dir}/src/rpc/src/rpcMain.c
# src/plugins/monitor/src/monMain.c
sed -i "s/taosd is quiting/tqd is quiting/g" ${top_dir}/src/plugins/monitor/src/monMain.c
# packaging/tools/makepkg.sh
sed -i "s/productName=\"TDengine\"/productName=\"TQ\"/g" ${top_dir}/packaging/tools/makepkg.sh
sed -i "s/serverName=\"taosd\"/serverName=\"tqd\"/g" ${top_dir}/packaging/tools/makepkg.sh
sed -i "s/clientName=\"taos\"/clientName=\"tq\"/g" ${top_dir}/packaging/tools/makepkg.sh
sed -i "s/configFile=\"taos\.cfg\"/configFile=\"tq\.cfg\"/g" ${top_dir}/packaging/tools/makepkg.sh
sed -i "s/tarName=\"taos\.tar\.gz\"/tarName=\"tq\.tar\.gz\"/g" ${top_dir}/packaging/tools/makepkg.sh
# packaging/tools/remove.sh
sed -i "s/installDir=\"\/usr\/local\/taos\"/installDir=\"\/usr\/local\/tq\"/g" ${top_dir}/packaging/tools/remove.sh
sed -i "s/serverName=\"taosd\"/serverName=\"tqd\"/g" ${top_dir}/packaging/tools/remove.sh
sed -i "s/clientName=\"taos\"/clientName=\"tq\"/g" ${top_dir}/packaging/tools/remove.sh
sed -i "s/uninstallScript=\"rmtaos\"/uninstallScript=\"rmtq\"/g" ${top_dir}/packaging/tools/remove.sh
sed -i "s/productName=\"TDengine\"/productName=\"TQ\"/g" ${top_dir}/packaging/tools/remove.sh
# packaging/tools/startPre.sh
sed -i "s/serverName=\"taosd\"/serverName=\"tqd\"/g" ${top_dir}/packaging/tools/startPre.sh
sed -i "s/logDir=\"\/var\/log\/taos\"/logDir=\"\/var\/log\/tq\"/g" ${top_dir}/packaging/tools/startPre.sh
# packaging/tools/run_taosd.sh
sed -i "s/taosd/tqd/g" ${top_dir}/packaging/tools/run_taosd.sh
# packaging/tools/install.sh
sed -i "s/clientName=\"taos\"/clientName=\"tq\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/serverName=\"taosd\"/serverName=\"tqd\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/configFile=\"taos\.cfg\"/configFile=\"tq\.cfg\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/productName=\"TDengine\"/productName=\"TQ\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/uninstallScript=\"rmtaos\"/uninstallScript=\"rmtq\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/historyFile=\"taos_history\"/historyFile=\"tq_history\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/tarName=\"taos\.tar\.gz\"/tarName=\"tq\.tar\.gz\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/dataDir=\"\/var\/lib\/taos\"/dataDir=\"\/var\/lib\/tq\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/logDir=\"\/var\/log\/taos\"/logDir=\"\/var\/log\/tq\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/configDir=\"\/etc\/taos\"/configDir=\"\/etc\/tq\"/g" ${top_dir}/packaging/tools/install.sh
sed -i "s/installDir=\"\/usr\/local\/taos\"/installDir=\"\/usr\/local\/tq\"/g" ${top_dir}/packaging/tools/install.sh
# packaging/tools/makeclient.sh
sed -i "s/productName=\"TDengine\"/productName=\"TQ\"/g" ${top_dir}/packaging/tools/makeclient.sh
sed -i "s/clientName=\"taos\"/clientName=\"tq\"/g" ${top_dir}/packaging/tools/makeclient.sh
sed -i "s/configFile=\"taos\.cfg\"/configFile=\"tq\.cfg\"/g" ${top_dir}/packaging/tools/makeclient.sh
sed -i "s/tarName=\"taos\.tar\.gz\"/tarName=\"tq\.tar\.gz\"/g" ${top_dir}/packaging/tools/makeclient.sh
# packaging/tools/remove_client.sh
sed -i "s/installDir=\"\/usr\/local\/taos\"/installDir=\"\/usr\/local\/tq\"/g" ${top_dir}/packaging/tools/remove_client.sh
sed -i "s/clientName=\"taos\"/clientName=\"tq\"/g" ${top_dir}/packaging/tools/remove_client.sh
sed -i "s/uninstallScript=\"rmtaos\"/uninstallScript=\"rmtq\"/g" ${top_dir}/packaging/tools/remove_client.sh
# packaging/tools/install_client.sh
sed -i "s/dataDir=\"\/var\/lib\/taos\"/dataDir=\"\/var\/lib\/tq\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/logDir=\"\/var\/log\/taos\"/logDir=\"\/var\/log\/tq\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/productName=\"TDengine\"/productName=\"TQ\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/installDir=\"\/usr\/local\/taos\"/installDir=\"\/usr\/local\/tq\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/configDir=\"\/etc\/taos\"/configDir=\"\/etc\/tq\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/serverName=\"taosd\"/serverName=\"tqd\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/clientName=\"taos\"/clientName=\"tq\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/uninstallScript=\"rmtaos\"/uninstallScript=\"rmtq\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/configFile=\"taos\.cfg\"/configFile=\"tq\.cfg\"/g" ${top_dir}/packaging/tools/install_client.sh
sed -i "s/tarName=\"taos\.tar\.gz\"/tarName=\"tq\.tar\.gz\"/g" ${top_dir}/packaging/tools/install_client.sh
# packaging/tools/makearbi.sh
sed -i "s/productName=\"TDengine\"/productName=\"TQ\"/g" ${top_dir}/packaging/tools/makearbi.sh
# packaging/tools/remove_arbi.sh
sed -i "s/TDengine/TQ/g" ${top_dir}/packaging/tools/remove_arbi.sh
# packaging/tools/install_arbi.sh
sed -i "s/TDengine/TQ/g" ${top_dir}/packaging/tools/install_arbi.sh
# packaging/tools/make_install.sh
sed -i "s/clientName=\"taos\"/clientName=\"tq\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/serverName=\"taosd\"/serverName=\"tqd\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/logDir=\"\/var\/log\/taos\"/logDir=\"\/var\/log\/tq\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/dataDir=\"\/var\/lib\/taos\"/dataDir=\"\/var\/lib\/tq\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/configDir=\"\/etc\/taos\"/configDir=\"\/etc\/tq\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/configFile=\"taos\.cfg\"/configFile=\"tq\.cfg\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/installDir=\"\/usr\/local\/taos\"/installDir=\"\/usr\/local\/tq\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/productName=\"TDengine\"/productName=\"TQ\"/g" ${top_dir}/packaging/tools/make_install.sh
sed -i "s/uninstallScript=\"rmtaos\"/uninstallScript=\"rmtq\"/g" ${top_dir}/packaging/tools/make_install.sh
# packaging/rpm/taosd
sed -i "s/TDengine/TQ/g" ${top_dir}/packaging/rpm/taosd
sed -i "s/usr\/local\/taos/usr\/local\/tq/g" ${top_dir}/packaging/rpm/taosd
sed -i "s/taosd/tqd/g" ${top_dir}/packaging/rpm/taosd
# packaging/deb/taosd
sed -i "s/TDengine/TQ/g" ${top_dir}/packaging/deb/taosd
sed -i "s/usr\/local\/taos/usr\/local\/tq/g" ${top_dir}/packaging/deb/taosd
sed -i "s/taosd/tqd/g" ${top_dir}/packaging/deb/taosd
}
function replace_enterprise_tq() {
# enterprise/src/kit/perfMonitor/perfMonitor.c
sed -i "s/\"taosdata\"/\"tqueue\"/g" ${top_dir}/../enterprise/src/kit/perfMonitor/perfMonitor.c
sed -i "s/TDengine/TQ/g" ${top_dir}/../enterprise/src/kit/perfMonitor/perfMonitor.c
# enterprise/src/plugins/admin/src/httpAdminHandle.c
sed -i "s/taos\.cfg/tq\.cfg/g" ${top_dir}/../enterprise/src/plugins/admin/src/httpAdminHandle.c
# enterprise/src/plugins/grant/src/grantMain.c
sed -i "s/taos\.cfg/tq\.cfg/g" ${top_dir}/../enterprise/src/plugins/grant/src/grantMain.c
# enterprise/src/plugins/module/src/moduleMain.c
sed -i "s/taos\.cfg/tq\.cfg/g" ${top_dir}/../enterprise/src/plugins/module/src/moduleMain.c
# enterprise/src/plugins/web
sed -i -e "s/taosd/tqd/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\">tqd<\/th>/g" ${top_dir}/../enterprise/src/plugins/web/admin/monitor.html
sed -i -e "s/data:\['taosd', 'system'\],/data:\['tqd', 'system'\],/g" ${top_dir}/../enterprise/src/plugins/web/admin/monitor.html
sed -i -e "s/name: 'taosd',/name: 'tqd',/g" ${top_dir}/../enterprise/src/plugins/web/admin/monitor.html
# enterprise/src/plugins/web/admin/*.html
sed -i "s/TDengine/TQ/g" ${top_dir}/../enterprise/src/plugins/web/admin/*.html
# enterprise/src/plugins/web/admin/js/*.js
sed -i "s/TDengine/TQ/g" ${top_dir}/../enterprise/src/plugins/web/admin/js/*.js
}
此差异已折叠。
......@@ -177,9 +177,6 @@ function install_jemalloc() {
}
function clean_service_on_sysvinit() {
#restart_config_str="taos:2345:respawn:${service_config_dir}/taosd start"
#${csudo}sed -i "\|${restart_config_str}|d" /etc/inittab || :
if pidof tarbitrator &> /dev/null; then
${csudo}service tarbitratord stop || :
fi
......@@ -210,7 +207,6 @@ function install_service_on_sysvinit() {
sleep 1
# Install taosd service
if ((${os_type}==1)); then
${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
......@@ -219,9 +215,6 @@ function install_service_on_sysvinit() {
${csudo}cp ${script_dir}/init.d/tarbitratord.rpm ${service_config_dir}/tarbitratord && ${csudo}chmod a+x ${service_config_dir}/tarbitratord
fi
#restart_config_str="taos:2345:respawn:${service_config_dir}/taosd start"
#${csudo}grep -q -F "$restart_config_str" /etc/inittab || ${csudo}bash -c "echo '${restart_config_str}' >> /etc/inittab"
if ((${initd_mod}==1)); then
${csudo}chkconfig --add tarbitratord || :
${csudo}chkconfig --level 2345 tarbitratord on || :
......@@ -244,8 +237,6 @@ function clean_service_on_systemd() {
${csudo}rm -f ${tarbitratord_service_config}
}
# taos:2345:respawn:/etc/init.d/tarbitratord start
function install_service_on_systemd() {
clean_service_on_systemd
......@@ -280,7 +271,6 @@ function install_service() {
elif ((${service_mod}==1)); then
install_service_on_sysvinit
else
# must manual stop taosd
kill_tarbitrator
fi
}
......@@ -307,7 +297,6 @@ function update_TDengine() {
install_jemalloc
echo
#echo -e "${GREEN_DARK}To configure TDengine ${NC}: edit /etc/taos/taos.cfg"
if ((${service_mod}==0)); then
echo -e "${GREEN_DARK}To start arbitrator ${NC}: ${csudo}systemctl start tarbitratord${NC}"
elif ((${service_mod}==1)); then
......@@ -330,7 +319,6 @@ function install_TDengine() {
install_jemalloc
echo
#echo -e "${GREEN_DARK}To configure TDengine ${NC}: edit /etc/taos/taos.cfg"
if ((${service_mod}==0)); then
echo -e "${GREEN_DARK}To start arbitrator ${NC}: ${csudo}systemctl start tarbitratord${NC}"
elif ((${service_mod}==1)); then
......
#!/bin/bash
#
# This file is used to install database on linux systems. The operating system
# is required to use systemd to manage services at boot
set -e
#set -x
# -----------------------Variables definition---------------------
script_dir=$(dirname $(readlink -f "$0"))
bin_link_dir="/usr/bin"
#inc_link_dir="/usr/include"
#install main path
install_main_dir="/usr/local/tarbitrator"
# old bin dir
bin_dir="/usr/local/tarbitrator/bin"
service_config_dir="/etc/systemd/system"
# Color setting
RED='\033[0;31m'
GREEN='\033[1;32m'
GREEN_DARK='\033[0;32m'
GREEN_UNDERLINE='\033[4;32m'
NC='\033[0m'
csudo=""
if command -v sudo > /dev/null; then
csudo="sudo "
fi
update_flag=0
initd_mod=0
service_mod=2
if pidof systemd &> /dev/null; then
service_mod=0
elif $(which service &> /dev/null); then
service_mod=1
service_config_dir="/etc/init.d"
if $(which chkconfig &> /dev/null); then
initd_mod=1
elif $(which insserv &> /dev/null); then
initd_mod=2
elif $(which update-rc.d &> /dev/null); then
initd_mod=3
else
service_mod=2
fi
else
service_mod=2
fi
# get the operating system type for using the corresponding init file
# ubuntu/debian(deb), centos/fedora(rpm), others: opensuse, redhat, ..., no verification
#osinfo=$(awk -F= '/^NAME/{print $2}' /etc/os-release)
if [[ -e /etc/os-release ]]; then
osinfo=$(cat /etc/os-release | grep "NAME" | cut -d '"' -f2) ||:
else
osinfo=""
fi
#echo "osinfo: ${osinfo}"
os_type=0
if echo $osinfo | grep -qwi "ubuntu" ; then
# echo "This is ubuntu system"
os_type=1
elif echo $osinfo | grep -qwi "debian" ; then
# echo "This is debian system"
os_type=1
elif echo $osinfo | grep -qwi "Kylin" ; then
# echo "This is Kylin system"
os_type=1
elif echo $osinfo | grep -qwi "centos" ; then
# echo "This is centos system"
os_type=2
elif echo $osinfo | grep -qwi "fedora" ; then
# echo "This is fedora system"
os_type=2
else
echo " osinfo: ${osinfo}"
echo " This is an officially unverified linux system,"
echo " if there are any problems with the installation and operation, "
echo " please feel free to contact jhict.com for support."
os_type=1
fi
function kill_tarbitrator() {
pid=$(ps -ef | grep "tarbitrator" | grep -v "grep" | awk '{print $2}')
if [ -n "$pid" ]; then
${csudo}kill -9 $pid || :
fi
}
function install_main_path() {
#create install main dir and all sub dir
${csudo}rm -rf ${install_main_dir} || :
${csudo}mkdir -p ${install_main_dir}
${csudo}mkdir -p ${install_main_dir}/bin
#${csudo}mkdir -p ${install_main_dir}/include
${csudo}mkdir -p ${install_main_dir}/init.d
}
function install_bin() {
# Remove links
${csudo}rm -f ${bin_link_dir}/rmtarbitrator || :
${csudo}rm -f ${bin_link_dir}/tarbitrator || :
${csudo}cp -r ${script_dir}/bin/* ${install_main_dir}/bin && ${csudo}chmod 0555 ${install_main_dir}/bin/*
#Make link
[ -x ${install_main_dir}/bin/remove_arbi_jh.sh ] && ${csudo}ln -s ${install_main_dir}/bin/remove_arbi_jh.sh ${bin_link_dir}/rmtarbitrator || :
[ -x ${install_main_dir}/bin/tarbitrator ] && ${csudo}ln -s ${install_main_dir}/bin/tarbitrator ${bin_link_dir}/tarbitrator || :
}
function install_header() {
${csudo}rm -f ${inc_link_dir}/taos.h ${inc_link_dir}/taoserror.h || :
${csudo}cp -f ${script_dir}/inc/* ${install_main_dir}/include && ${csudo}chmod 644 ${install_main_dir}/include/*
${csudo}ln -s ${install_main_dir}/include/taos.h ${inc_link_dir}/taos.h
${csudo}ln -s ${install_main_dir}/include/taoserror.h ${inc_link_dir}/taoserror.h
}
function clean_service_on_sysvinit() {
if pidof tarbitrator &> /dev/null; then
${csudo}service tarbitratord stop || :
fi
if ((${initd_mod}==1)); then
if [ -e ${service_config_dir}/tarbitratord ]; then
${csudo}chkconfig --del tarbitratord || :
fi
elif ((${initd_mod}==2)); then
if [ -e ${service_config_dir}/tarbitratord ]; then
${csudo}insserv -r tarbitratord || :
fi
elif ((${initd_mod}==3)); then
if [ -e ${service_config_dir}/tarbitratord ]; then
${csudo}update-rc.d -f tarbitratord remove || :
fi
fi
${csudo}rm -f ${service_config_dir}/tarbitratord || :
if $(which init &> /dev/null); then
${csudo}init q || :
fi
}
function install_service_on_sysvinit() {
clean_service_on_sysvinit
sleep 1
# Install server service
if ((${os_type}==1)); then
${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
elif ((${os_type}==2)); then
${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
fi
if ((${initd_mod}==1)); then
${csudo}chkconfig --add tarbitratord || :
${csudo}chkconfig --level 2345 tarbitratord on || :
elif ((${initd_mod}==2)); then
${csudo}insserv tarbitratord || :
${csudo}insserv -d tarbitratord || :
elif ((${initd_mod}==3)); then
${csudo}update-rc.d tarbitratord defaults || :
fi
}
function clean_service_on_systemd() {
tarbitratord_service_config="${service_config_dir}/tarbitratord.service"
if systemctl is-active --quiet tarbitratord; then
echo "tarbitrator is running, stopping it..."
${csudo}systemctl stop tarbitratord &> /dev/null || echo &> /dev/null
fi
${csudo}systemctl disable tarbitratord &> /dev/null || echo &> /dev/null
${csudo}rm -f ${tarbitratord_service_config}
}
function install_service_on_systemd() {
clean_service_on_systemd
tarbitratord_service_config="${service_config_dir}/tarbitratord.service"
${csudo}bash -c "echo '[Unit]' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'Description=jh_iot arbitrator service' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'After=network-online.target' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'Wants=network-online.target' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo >> ${tarbitratord_service_config}"
${csudo}bash -c "echo '[Service]' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'Type=simple' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'ExecStart=/usr/bin/tarbitrator' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'TimeoutStopSec=1000000s' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'LimitNOFILE=infinity' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'LimitNPROC=infinity' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'LimitCORE=infinity' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'TimeoutStartSec=0' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'StandardOutput=null' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'Restart=always' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'StartLimitBurst=3' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'StartLimitInterval=60s' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo >> ${tarbitratord_service_config}"
${csudo}bash -c "echo '[Install]' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'WantedBy=multi-user.target' >> ${tarbitratord_service_config}"
${csudo}systemctl enable tarbitratord
}
function install_service() {
if ((${service_mod}==0)); then
install_service_on_systemd
elif ((${service_mod}==1)); then
install_service_on_sysvinit
else
kill_tarbitrator
fi
}
function update() {
# Start to update
echo -e "${GREEN}Start to update jh_iot's arbitrator ...${NC}"
# Stop the service if running
if pidof tarbitrator &> /dev/null; then
if ((${service_mod}==0)); then
${csudo}systemctl stop tarbitratord || :
elif ((${service_mod}==1)); then
${csudo}service tarbitratord stop || :
else
kill_tarbitrator
fi
sleep 1
fi
install_main_path
#install_header
install_bin
install_service
echo
if ((${service_mod}==0)); then
echo -e "${GREEN_DARK}To start arbitrator ${NC}: ${csudo}systemctl start tarbitratord${NC}"
elif ((${service_mod}==1)); then
echo -e "${GREEN_DARK}To start arbitrator ${NC}: ${csudo}service tarbitratord start${NC}"
else
echo -e "${GREEN_DARK}To start arbitrator ${NC}: ./tarbitrator${NC}"
fi
echo
echo -e "\033[44;32;1mjh_iot's arbitrator is updated successfully!${NC}"
}
function install() {
# Start to install
echo -e "${GREEN}Start to install jh_iot's arbitrator ...${NC}"
install_main_path
#install_header
install_bin
install_service
echo
if ((${service_mod}==0)); then
echo -e "${GREEN_DARK}To start arbitrator ${NC}: ${csudo}systemctl start tarbitratord${NC}"
elif ((${service_mod}==1)); then
echo -e "${GREEN_DARK}To start arbitrator ${NC}: ${csudo}service tarbitratord start${NC}"
else
echo -e "${GREEN_DARK}To start arbitrator ${NC}: tarbitrator${NC}"
fi
echo -e "\033[44;32;1mjh_iot's arbitrator is installed successfully!${NC}"
echo
}
## ==============================Main program starts from here============================
# Install server and client
if [ -x ${bin_dir}/tarbitrator ]; then
update_flag=1
update
else
install
fi
#!/bin/bash
#
# This file is used to install database on linux systems. The operating system
# is required to use systemd to manage services at boot
set -e
#set -x
# -----------------------Variables definition---------------------
script_dir=$(dirname $(readlink -f "$0"))
bin_link_dir="/usr/bin"
#inc_link_dir="/usr/include"
#install main path
install_main_dir="/usr/local/tarbitrator"
# old bin dir
bin_dir="/usr/local/tarbitrator/bin"
service_config_dir="/etc/systemd/system"
# Color setting
RED='\033[0;31m'
GREEN='\033[1;32m'
GREEN_DARK='\033[0;32m'
GREEN_UNDERLINE='\033[4;32m'
NC='\033[0m'
csudo=""
if command -v sudo > /dev/null; then
csudo="sudo "
fi
update_flag=0
initd_mod=0
service_mod=2
if pidof systemd &> /dev/null; then
service_mod=0
elif $(which service &> /dev/null); then
service_mod=1
service_config_dir="/etc/init.d"
if $(which chkconfig &> /dev/null); then
initd_mod=1
elif $(which insserv &> /dev/null); then
initd_mod=2
elif $(which update-rc.d &> /dev/null); then
initd_mod=3
else
service_mod=2
fi
else
service_mod=2
fi
# get the operating system type for using the corresponding init file
# ubuntu/debian(deb), centos/fedora(rpm), others: opensuse, redhat, ..., no verification
#osinfo=$(awk -F= '/^NAME/{print $2}' /etc/os-release)
if [[ -e /etc/os-release ]]; then
osinfo=$(cat /etc/os-release | grep "NAME" | cut -d '"' -f2) ||:
else
osinfo=""
fi
#echo "osinfo: ${osinfo}"
os_type=0
if echo $osinfo | grep -qwi "ubuntu" ; then
# echo "This is ubuntu system"
os_type=1
elif echo $osinfo | grep -qwi "debian" ; then
# echo "This is debian system"
os_type=1
elif echo $osinfo | grep -qwi "Kylin" ; then
# echo "This is Kylin system"
os_type=1
elif echo $osinfo | grep -qwi "centos" ; then
# echo "This is centos system"
os_type=2
elif echo $osinfo | grep -qwi "fedora" ; then
# echo "This is fedora system"
os_type=2
else
echo " osinfo: ${osinfo}"
echo " This is an officially unverified linux system,"
echo " if there are any problems with the installation and operation, "
echo " please feel free to contact wellintech.com for support."
os_type=1
fi
function kill_tarbitrator() {
pid=$(ps -ef | grep "tarbitrator" | grep -v "grep" | awk '{print $2}')
if [ -n "$pid" ]; then
${csudo}kill -9 $pid || :
fi
}
function install_main_path() {
#create install main dir and all sub dir
${csudo}rm -rf ${install_main_dir} || :
${csudo}mkdir -p ${install_main_dir}
${csudo}mkdir -p ${install_main_dir}/bin
#${csudo}mkdir -p ${install_main_dir}/include
${csudo}mkdir -p ${install_main_dir}/init.d
}
function install_bin() {
# Remove links
${csudo}rm -f ${bin_link_dir}/rmtarbitrator || :
${csudo}rm -f ${bin_link_dir}/tarbitrator || :
${csudo}cp -r ${script_dir}/bin/* ${install_main_dir}/bin && ${csudo}chmod 0555 ${install_main_dir}/bin/*
#Make link
[ -x ${install_main_dir}/bin/remove_arbi_kh.sh ] && ${csudo}ln -s ${install_main_dir}/bin/remove_arbi_kh.sh ${bin_link_dir}/rmtarbitrator || :
[ -x ${install_main_dir}/bin/tarbitrator ] && ${csudo}ln -s ${install_main_dir}/bin/tarbitrator ${bin_link_dir}/tarbitrator || :
}
function install_header() {
${csudo}rm -f ${inc_link_dir}/taos.h ${inc_link_dir}/taoserror.h || :
${csudo}cp -f ${script_dir}/inc/* ${install_main_dir}/include && ${csudo}chmod 644 ${install_main_dir}/include/*
${csudo}ln -s ${install_main_dir}/include/taos.h ${inc_link_dir}/taos.h
${csudo}ln -s ${install_main_dir}/include/taoserror.h ${inc_link_dir}/taoserror.h
}
function clean_service_on_sysvinit() {
if pidof tarbitrator &> /dev/null; then
${csudo}service tarbitratord stop || :
fi
if ((${initd_mod}==1)); then
if [ -e ${service_config_dir}/tarbitratord ]; then
${csudo}chkconfig --del tarbitratord || :
fi
elif ((${initd_mod}==2)); then
if [ -e ${service_config_dir}/tarbitratord ]; then
${csudo}insserv -r tarbitratord || :
fi
elif ((${initd_mod}==3)); then
if [ -e ${service_config_dir}/tarbitratord ]; then
${csudo}update-rc.d -f tarbitratord remove || :
fi
fi
${csudo}rm -f ${service_config_dir}/tarbitratord || :
if $(which init &> /dev/null); then
${csudo}init q || :
fi
}
function install_service_on_sysvinit() {
clean_service_on_sysvinit
sleep 1
# Install khserver service
if ((${os_type}==1)); then
${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
elif ((${os_type}==2)); then
${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
fi
if ((${initd_mod}==1)); then
${csudo}chkconfig --add tarbitratord || :
${csudo}chkconfig --level 2345 tarbitratord on || :
elif ((${initd_mod}==2)); then
${csudo}insserv tarbitratord || :
${csudo}insserv -d tarbitratord || :
elif ((${initd_mod}==3)); then
${csudo}update-rc.d tarbitratord defaults || :
fi
}
function clean_service_on_systemd() {
tarbitratord_service_config="${service_config_dir}/tarbitratord.service"
if systemctl is-active --quiet tarbitratord; then
echo "tarbitrator is running, stopping it..."
${csudo}systemctl stop tarbitratord &> /dev/null || echo &> /dev/null
fi
${csudo}systemctl disable tarbitratord &> /dev/null || echo &> /dev/null
${csudo}rm -f ${tarbitratord_service_config}
}
function install_service_on_systemd() {
clean_service_on_systemd
tarbitratord_service_config="${service_config_dir}/tarbitratord.service"
${csudo}bash -c "echo '[Unit]' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'Description=KingHistorian arbitrator service' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'After=network-online.target' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'Wants=network-online.target' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo >> ${tarbitratord_service_config}"
${csudo}bash -c "echo '[Service]' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'Type=simple' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'ExecStart=/usr/bin/tarbitrator' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'TimeoutStopSec=1000000s' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'LimitNOFILE=infinity' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'LimitNPROC=infinity' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'LimitCORE=infinity' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'TimeoutStartSec=0' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'StandardOutput=null' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'Restart=always' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'StartLimitBurst=3' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'StartLimitInterval=60s' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo >> ${tarbitratord_service_config}"
${csudo}bash -c "echo '[Install]' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'WantedBy=multi-user.target' >> ${tarbitratord_service_config}"
${csudo}systemctl enable tarbitratord
}
function install_service() {
if ((${service_mod}==0)); then
install_service_on_systemd
elif ((${service_mod}==1)); then
install_service_on_sysvinit
else
kill_tarbitrator
fi
}
function update() {
# Start to update
echo -e "${GREEN}Start to update KingHistorian's arbitrator ...${NC}"
# Stop the service if running
if pidof tarbitrator &> /dev/null; then
if ((${service_mod}==0)); then
${csudo}systemctl stop tarbitratord || :
elif ((${service_mod}==1)); then
${csudo}service tarbitratord stop || :
else
kill_tarbitrator
fi
sleep 1
fi
install_main_path
#install_header
install_bin
install_service
echo
if ((${service_mod}==0)); then
echo -e "${GREEN_DARK}To start arbitrator ${NC}: ${csudo}systemctl start tarbitratord${NC}"
elif ((${service_mod}==1)); then
echo -e "${GREEN_DARK}To start arbitrator ${NC}: ${csudo}service tarbitratord start${NC}"
else
echo -e "${GREEN_DARK}To start arbitrator ${NC}: ./tarbitrator${NC}"
fi
echo
echo -e "\033[44;32;1mKingHistorian's arbitrator is updated successfully!${NC}"
}
function install() {
# Start to install
echo -e "${GREEN}Start to install KingHistorian's arbitrator ...${NC}"
install_main_path
#install_header
install_bin
install_service
echo
if ((${service_mod}==0)); then
echo -e "${GREEN_DARK}To start arbitrator ${NC}: ${csudo}systemctl start tarbitratord${NC}"
elif ((${service_mod}==1)); then
echo -e "${GREEN_DARK}To start arbitrator ${NC}: ${csudo}service tarbitratord start${NC}"
else
echo -e "${GREEN_DARK}To start arbitrator ${NC}: tarbitrator${NC}"
fi
echo -e "\033[44;32;1mKingHistorian's arbitrator is installed successfully!${NC}"
echo
}
## ==============================Main program starts from here============================
# Install server and client
if [ -x ${bin_dir}/tarbitrator ]; then
update_flag=1
update
else
install
fi
#!/bin/bash
#
# This file is used to install database on linux systems. The operating system
# is required to use systemd to manage services at boot
set -e
#set -x
# -----------------------Variables definition---------------------
script_dir=$(dirname $(readlink -f "$0"))
bin_link_dir="/usr/bin"
#inc_link_dir="/usr/include"
#install main path
install_main_dir="/usr/local/tarbitrator"
# old bin dir
bin_dir="/usr/local/tarbitrator/bin"
service_config_dir="/etc/systemd/system"
# Color setting
RED='\033[0;31m'
GREEN='\033[1;32m'
GREEN_DARK='\033[0;32m'
GREEN_UNDERLINE='\033[4;32m'
NC='\033[0m'
csudo=""
if command -v sudo > /dev/null; then
csudo="sudo "
fi
update_flag=0
initd_mod=0
service_mod=2
if pidof systemd &> /dev/null; then
service_mod=0
elif $(which service &> /dev/null); then
service_mod=1
service_config_dir="/etc/init.d"
if $(which chkconfig &> /dev/null); then
initd_mod=1
elif $(which insserv &> /dev/null); then
initd_mod=2
elif $(which update-rc.d &> /dev/null); then
initd_mod=3
else
service_mod=2
fi
else
service_mod=2
fi
# get the operating system type for using the corresponding init file
# ubuntu/debian(deb), centos/fedora(rpm), others: opensuse, redhat, ..., no verification
#osinfo=$(awk -F= '/^NAME/{print $2}' /etc/os-release)
if [[ -e /etc/os-release ]]; then
osinfo=$(cat /etc/os-release | grep "NAME" | cut -d '"' -f2) ||:
else
osinfo=""
fi
#echo "osinfo: ${osinfo}"
os_type=0
if echo $osinfo | grep -qwi "ubuntu" ; then
# echo "This is ubuntu system"
os_type=1
elif echo $osinfo | grep -qwi "debian" ; then
# echo "This is debian system"
os_type=1
elif echo $osinfo | grep -qwi "Kylin" ; then
# echo "This is Kylin system"
os_type=1
elif echo $osinfo | grep -qwi "centos" ; then
# echo "This is centos system"
os_type=2
elif echo $osinfo | grep -qwi "fedora" ; then
# echo "This is fedora system"
os_type=2
else
echo " osinfo: ${osinfo}"
echo " This is an officially unverified linux system,"
echo " if there are any problems with the installation and operation, "
echo " please feel free to contact taosdata.com for support."
os_type=1
fi
function kill_tarbitrator() {
pid=$(ps -ef | grep "tarbitrator" | grep -v "grep" | awk '{print $2}')
if [ -n "$pid" ]; then
${csudo}kill -9 $pid || :
fi
}
function install_main_path() {
#create install main dir and all sub dir
${csudo}rm -rf ${install_main_dir} || :
${csudo}mkdir -p ${install_main_dir}
${csudo}mkdir -p ${install_main_dir}/bin
#${csudo}mkdir -p ${install_main_dir}/include
${csudo}mkdir -p ${install_main_dir}/init.d
}
function install_bin() {
# Remove links
${csudo}rm -f ${bin_link_dir}/rmtarbitrator || :
${csudo}rm -f ${bin_link_dir}/tarbitrator || :
${csudo}cp -r ${script_dir}/bin/* ${install_main_dir}/bin && ${csudo}chmod 0555 ${install_main_dir}/bin/*
#Make link
[ -x ${install_main_dir}/bin/remove_arbi_power.sh ] && ${csudo}ln -s ${install_main_dir}/bin/remove_arbi_power.sh ${bin_link_dir}/rmtarbitrator || :
[ -x ${install_main_dir}/bin/tarbitrator ] && ${csudo}ln -s ${install_main_dir}/bin/tarbitrator ${bin_link_dir}/tarbitrator || :
}
function install_jemalloc() {
jemalloc_dir=${script_dir}/jemalloc
if [ -d ${jemalloc_dir} ]; then
${csudo}/usr/bin/install -c -d /usr/local/bin
if [ -f ${jemalloc_dir}/bin/jemalloc-config ]; then
${csudo}/usr/bin/install -c -m 755 ${jemalloc_dir}/bin/jemalloc-config /usr/local/bin
fi
if [ -f ${jemalloc_dir}/bin/jemalloc.sh ]; then
${csudo}/usr/bin/install -c -m 755 ${jemalloc_dir}/bin/jemalloc.sh /usr/local/bin
fi
if [ -f ${jemalloc_dir}/bin/jeprof ]; then
${csudo}/usr/bin/install -c -m 755 ${jemalloc_dir}/bin/jeprof /usr/local/bin
fi
if [ -f ${jemalloc_dir}/include/jemalloc/jemalloc.h ]; then
${csudo}/usr/bin/install -c -d /usr/local/include/jemalloc
${csudo}/usr/bin/install -c -m 644 ${jemalloc_dir}/include/jemalloc/jemalloc.h /usr/local/include/jemalloc
fi
if [ -f ${jemalloc_dir}/lib/libjemalloc.so.2 ]; then
${csudo}/usr/bin/install -c -d /usr/local/lib
${csudo}/usr/bin/install -c -m 755 ${jemalloc_dir}/lib/libjemalloc.so.2 /usr/local/lib
${csudo}ln -sf libjemalloc.so.2 /usr/local/lib/libjemalloc.so
${csudo}/usr/bin/install -c -d /usr/local/lib
if [ -f ${jemalloc_dir}/lib/libjemalloc.a ]; then
${csudo}/usr/bin/install -c -m 755 ${jemalloc_dir}/lib/libjemalloc.a /usr/local/lib
fi
if [ -f ${jemalloc_dir}/lib/libjemalloc_pic.a ]; then
${csudo}/usr/bin/install -c -m 755 ${jemalloc_dir}/lib/libjemalloc_pic.a /usr/local/lib
fi
if [ -f ${jemalloc_dir}/lib/libjemalloc_pic.a ]; then
${csudo}/usr/bin/install -c -d /usr/local/lib/pkgconfig
${csudo}/usr/bin/install -c -m 644 ${jemalloc_dir}/lib/pkgconfig/jemalloc.pc /usr/local/lib/pkgconfig
fi
fi
if [ -f ${jemalloc_dir}/share/doc/jemalloc/jemalloc.html ]; then
${csudo}/usr/bin/install -c -d /usr/local/share/doc/jemalloc
${csudo}/usr/bin/install -c -m 644 ${jemalloc_dir}/share/doc/jemalloc/jemalloc.html /usr/local/share/doc/jemalloc
fi
if [ -f ${jemalloc_dir}/share/man/man3/jemalloc.3 ]; then
${csudo}/usr/bin/install -c -d /usr/local/share/man/man3
${csudo}/usr/bin/install -c -m 644 ${jemalloc_dir}/share/man/man3/jemalloc.3 /usr/local/share/man/man3
fi
if [ -d /etc/ld.so.conf.d ]; then
echo "/usr/local/lib" | ${csudo}tee /etc/ld.so.conf.d/jemalloc.conf > /dev/null || echo -e "failed to write /etc/ld.so.conf.d/jemalloc.conf"
${csudo}ldconfig
else
echo "/etc/ld.so.conf.d not found!"
fi
fi
}
function install_header() {
${csudo}rm -f ${inc_link_dir}/taos.h ${inc_link_dir}/taosdef.h ${inc_link_dir}/taoserror.h || :
${csudo}cp -f ${script_dir}/inc/* ${install_main_dir}/include && ${csudo}chmod 644 ${install_main_dir}/include/*
${csudo}ln -s ${install_main_dir}/include/taos.h ${inc_link_dir}/taos.h
${csudo}ln -s ${install_main_dir}/include/taosdef.h ${inc_link_dir}/taosdef.h
${csudo}ln -s ${install_main_dir}/include/taoserror.h ${inc_link_dir}/taoserror.h
}
function clean_service_on_sysvinit() {
if pidof tarbitrator &> /dev/null; then
${csudo}service tarbitratord stop || :
fi
if ((${initd_mod}==1)); then
if [ -e ${service_config_dir}/tarbitratord ]; then
${csudo}chkconfig --del tarbitratord || :
fi
elif ((${initd_mod}==2)); then
if [ -e ${service_config_dir}/tarbitratord ]; then
${csudo}insserv -r tarbitratord || :
fi
elif ((${initd_mod}==3)); then
if [ -e ${service_config_dir}/tarbitratord ]; then
${csudo}update-rc.d -f tarbitratord remove || :
fi
fi
${csudo}rm -f ${service_config_dir}/tarbitratord || :
if $(which init &> /dev/null); then
${csudo}init q || :
fi
}
function install_service_on_sysvinit() {
clean_service_on_sysvinit
sleep 1
# Install powerd service
if ((${os_type}==1)); then
${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
elif ((${os_type}==2)); then
${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
fi
#restart_config_str="power:2345:respawn:${service_config_dir}/powerd start"
#${csudo}grep -q -F "$restart_config_str" /etc/inittab || ${csudo}bash -c "echo '${restart_config_str}' >> /etc/inittab"
if ((${initd_mod}==1)); then
${csudo}chkconfig --add tarbitratord || :
${csudo}chkconfig --level 2345 tarbitratord on || :
elif ((${initd_mod}==2)); then
${csudo}insserv tarbitratord || :
${csudo}insserv -d tarbitratord || :
elif ((${initd_mod}==3)); then
${csudo}update-rc.d tarbitratord defaults || :
fi
}
function clean_service_on_systemd() {
tarbitratord_service_config="${service_config_dir}/tarbitratord.service"
if systemctl is-active --quiet tarbitratord; then
echo "tarbitrator is running, stopping it..."
${csudo}systemctl stop tarbitratord &> /dev/null || echo &> /dev/null
fi
${csudo}systemctl disable tarbitratord &> /dev/null || echo &> /dev/null
${csudo}rm -f ${tarbitratord_service_config}
}
# power:2345:respawn:/etc/init.d/tarbitratord start
function install_service_on_systemd() {
clean_service_on_systemd
tarbitratord_service_config="${service_config_dir}/tarbitratord.service"
${csudo}bash -c "echo '[Unit]' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'Description=PowerDB arbitrator service' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'After=network-online.target' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'Wants=network-online.target' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo >> ${tarbitratord_service_config}"
${csudo}bash -c "echo '[Service]' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'Type=simple' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'ExecStart=/usr/bin/tarbitrator' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'TimeoutStopSec=1000000s' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'LimitNOFILE=infinity' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'LimitNPROC=infinity' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'LimitCORE=infinity' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'TimeoutStartSec=0' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'StandardOutput=null' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'Restart=always' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'StartLimitBurst=3' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'StartLimitInterval=60s' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo >> ${tarbitratord_service_config}"
${csudo}bash -c "echo '[Install]' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'WantedBy=multi-user.target' >> ${tarbitratord_service_config}"
${csudo}systemctl enable tarbitratord
}
function install_service() {
if ((${service_mod}==0)); then
install_service_on_systemd
elif ((${service_mod}==1)); then
install_service_on_sysvinit
else
kill_tarbitrator
fi
}
function update_PowerDB() {
# Start to update
echo -e "${GREEN}Start to update PowerDB's arbitrator ...${NC}"
# Stop the service if running
if pidof tarbitrator &> /dev/null; then
if ((${service_mod}==0)); then
${csudo}systemctl stop tarbitratord || :
elif ((${service_mod}==1)); then
${csudo}service tarbitratord stop || :
else
kill_tarbitrator
fi
sleep 1
fi
install_main_path
#install_header
install_bin
install_service
install_jemalloc
echo
if ((${service_mod}==0)); then
echo -e "${GREEN_DARK}To start arbitrator ${NC}: ${csudo}systemctl start tarbitratord${NC}"
elif ((${service_mod}==1)); then
echo -e "${GREEN_DARK}To start arbitrator ${NC}: ${csudo}service tarbitratord start${NC}"
else
echo -e "${GREEN_DARK}To start arbitrator ${NC}: ./tarbitrator${NC}"
fi
echo
echo -e "\033[44;32;1mPowerDB's arbitrator is updated successfully!${NC}"
}
function install_PowerDB() {
# Start to install
echo -e "${GREEN}Start to install PowerDB's arbitrator ...${NC}"
install_main_path
#install_header
install_bin
install_service
install_jemalloc
echo
if ((${service_mod}==0)); then
echo -e "${GREEN_DARK}To start arbitrator ${NC}: ${csudo}systemctl start tarbitratord${NC}"
elif ((${service_mod}==1)); then
echo -e "${GREEN_DARK}To start arbitrator ${NC}: ${csudo}service tarbitratord start${NC}"
else
echo -e "${GREEN_DARK}To start arbitrator ${NC}: tarbitrator${NC}"
fi
echo -e "\033[44;32;1mPowerDB's arbitrator is installed successfully!${NC}"
echo
}
## ==============================Main program starts from here============================
# Install server and client
if [ -x ${bin_dir}/tarbitrator ]; then
update_flag=1
update_PowerDB
else
install_PowerDB
fi
#!/bin/bash
#
# This file is used to install database on linux systems. The operating system
# is required to use systemd to manage services at boot
set -e
#set -x
# -----------------------Variables definition---------------------
script_dir=$(dirname $(readlink -f "$0"))
bin_link_dir="/usr/bin"
#inc_link_dir="/usr/include"
#install main path
install_main_dir="/usr/local/tarbitrator"
# old bin dir
bin_dir="/usr/local/tarbitrator/bin"
service_config_dir="/etc/systemd/system"
# Color setting
RED='\033[0;31m'
GREEN='\033[1;32m'
GREEN_DARK='\033[0;32m'
GREEN_UNDERLINE='\033[4;32m'
NC='\033[0m'
csudo=""
if command -v sudo > /dev/null; then
csudo="sudo "
fi
update_flag=0
initd_mod=0
service_mod=2
if pidof systemd &> /dev/null; then
service_mod=0
elif $(which service &> /dev/null); then
service_mod=1
service_config_dir="/etc/init.d"
if $(which chkconfig &> /dev/null); then
initd_mod=1
elif $(which insserv &> /dev/null); then
initd_mod=2
elif $(which update-rc.d &> /dev/null); then
initd_mod=3
else
service_mod=2
fi
else
service_mod=2
fi
# get the operating system type for using the corresponding init file
# ubuntu/debian(deb), centos/fedora(rpm), others: opensuse, redhat, ..., no verification
#osinfo=$(awk -F= '/^NAME/{print $2}' /etc/os-release)
if [[ -e /etc/os-release ]]; then
osinfo=$(cat /etc/os-release | grep "NAME" | cut -d '"' -f2) ||:
else
osinfo=""
fi
#echo "osinfo: ${osinfo}"
os_type=0
if echo $osinfo | grep -qwi "ubuntu" ; then
# echo "This is ubuntu system"
os_type=1
elif echo $osinfo | grep -qwi "debian" ; then
# echo "This is debian system"
os_type=1
elif echo $osinfo | grep -qwi "Kylin" ; then
# echo "This is Kylin system"
os_type=1
elif echo $osinfo | grep -qwi "centos" ; then
# echo "This is centos system"
os_type=2
elif echo $osinfo | grep -qwi "fedora" ; then
# echo "This is fedora system"
os_type=2
else
echo " osinfo: ${osinfo}"
echo " This is an officially unverified linux system,"
echo " if there are any problems with the installation and operation, "
echo " please feel free to contact hanatech.com.cn for support."
os_type=1
fi
function kill_tarbitrator() {
pid=$(ps -ef | grep "tarbitrator" | grep -v "grep" | awk '{print $2}')
if [ -n "$pid" ]; then
${csudo}kill -9 $pid || :
fi
}
function install_main_path() {
#create install main dir and all sub dir
${csudo}rm -rf ${install_main_dir} || :
${csudo}mkdir -p ${install_main_dir}
${csudo}mkdir -p ${install_main_dir}/bin
#${csudo}mkdir -p ${install_main_dir}/include
${csudo}mkdir -p ${install_main_dir}/init.d
}
function install_bin() {
# Remove links
${csudo}rm -f ${bin_link_dir}/rmtarbitrator || :
${csudo}rm -f ${bin_link_dir}/tarbitrator || :
${csudo}cp -r ${script_dir}/bin/* ${install_main_dir}/bin && ${csudo}chmod 0555 ${install_main_dir}/bin/*
#Make link
[ -x ${install_main_dir}/bin/remove_arbi_prodb.sh ] && ${csudo}ln -s ${install_main_dir}/bin/remove_arbi_prodb.sh ${bin_link_dir}/rmtarbitrator || :
[ -x ${install_main_dir}/bin/tarbitrator ] && ${csudo}ln -s ${install_main_dir}/bin/tarbitrator ${bin_link_dir}/tarbitrator || :
}
function install_header() {
${csudo}rm -f ${inc_link_dir}/taos.h ${inc_link_dir}/taosdef.h ${inc_link_dir}/taoserror.h || :
${csudo}cp -f ${script_dir}/inc/* ${install_main_dir}/include && ${csudo}chmod 644 ${install_main_dir}/include/*
${csudo}ln -s ${install_main_dir}/include/taos.h ${inc_link_dir}/taos.h
${csudo}ln -s ${install_main_dir}/include/taosdef.h ${inc_link_dir}/taosdef.h
${csudo}ln -s ${install_main_dir}/include/taoserror.h ${inc_link_dir}/taoserror.h
}
function clean_service_on_sysvinit() {
if pidof tarbitrator &> /dev/null; then
${csudo}service tarbitratord stop || :
fi
if ((${initd_mod}==1)); then
if [ -e ${service_config_dir}/tarbitratord ]; then
${csudo}chkconfig --del tarbitratord || :
fi
elif ((${initd_mod}==2)); then
if [ -e ${service_config_dir}/tarbitratord ]; then
${csudo}insserv -r tarbitratord || :
fi
elif ((${initd_mod}==3)); then
if [ -e ${service_config_dir}/tarbitratord ]; then
${csudo}update-rc.d -f tarbitratord remove || :
fi
fi
${csudo}rm -f ${service_config_dir}/tarbitratord || :
if $(which init &> /dev/null); then
${csudo}init q || :
fi
}
function install_service_on_sysvinit() {
clean_service_on_sysvinit
sleep 1
# Install prodbs service
if ((${os_type}==1)); then
${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
elif ((${os_type}==2)); then
${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
fi
if ((${initd_mod}==1)); then
${csudo}chkconfig --add tarbitratord || :
${csudo}chkconfig --level 2345 tarbitratord on || :
elif ((${initd_mod}==2)); then
${csudo}insserv tarbitratord || :
${csudo}insserv -d tarbitratord || :
elif ((${initd_mod}==3)); then
${csudo}update-rc.d tarbitratord defaults || :
fi
}
function clean_service_on_systemd() {
tarbitratord_service_config="${service_config_dir}/tarbitratord.service"
if systemctl is-active --quiet tarbitratord; then
echo "tarbitrator is running, stopping it..."
${csudo}systemctl stop tarbitratord &> /dev/null || echo &> /dev/null
fi
${csudo}systemctl disable tarbitratord &> /dev/null || echo &> /dev/null
${csudo}rm -f ${tarbitratord_service_config}
}
function install_service_on_systemd() {
clean_service_on_systemd
tarbitratord_service_config="${service_config_dir}/tarbitratord.service"
${csudo}bash -c "echo '[Unit]' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'Description=ProDB arbitrator service' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'After=network-online.target' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'Wants=network-online.target' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo >> ${tarbitratord_service_config}"
${csudo}bash -c "echo '[Service]' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'Type=simple' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'ExecStart=/usr/bin/tarbitrator' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'TimeoutStopSec=1000000s' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'LimitNOFILE=infinity' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'LimitNPROC=infinity' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'LimitCORE=infinity' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'TimeoutStartSec=0' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'StandardOutput=null' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'Restart=always' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'StartLimitBurst=3' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'StartLimitInterval=60s' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo >> ${tarbitratord_service_config}"
${csudo}bash -c "echo '[Install]' >> ${tarbitratord_service_config}"
${csudo}bash -c "echo 'WantedBy=multi-user.target' >> ${tarbitratord_service_config}"
${csudo}systemctl enable tarbitratord
}
function install_service() {
if ((${service_mod}==0)); then
install_service_on_systemd
elif ((${service_mod}==1)); then
install_service_on_sysvinit
else
kill_tarbitrator
fi
}
function update_prodb() {
# Start to update
echo -e "${GREEN}Start to update ProDB's arbitrator ...${NC}"
# Stop the service if running
if pidof tarbitrator &> /dev/null; then
if ((${service_mod}==0)); then
${csudo}systemctl stop tarbitratord || :
elif ((${service_mod}==1)); then
${csudo}service tarbitratord stop || :
else
kill_tarbitrator
fi
sleep 1
fi
install_main_path
#install_header
install_bin
install_service
echo
if ((${service_mod}==0)); then
echo -e "${GREEN_DARK}To start arbitrator ${NC}: ${csudo}systemctl start tarbitratord${NC}"
elif ((${service_mod}==1)); then
echo -e "${GREEN_DARK}To start arbitrator ${NC}: ${csudo}service tarbitratord start${NC}"
else
echo -e "${GREEN_DARK}To start arbitrator ${NC}: ./tarbitrator${NC}"
fi
echo
echo -e "\033[44;32;1mProDB's arbitrator is updated successfully!${NC}"
}
function install_prodb() {
# Start to install
echo -e "${GREEN}Start to install ProDB's arbitrator ...${NC}"
install_main_path
#install_header
install_bin
install_service
echo
if ((${service_mod}==0)); then
echo -e "${GREEN_DARK}To start arbitrator ${NC}: ${csudo}systemctl start tarbitratord${NC}"
elif ((${service_mod}==1)); then
echo -e "${GREEN_DARK}To start arbitrator ${NC}: ${csudo}service tarbitratord start${NC}"
else
echo -e "${GREEN_DARK}To start arbitrator ${NC}: tarbitrator${NC}"
fi
echo -e "\033[44;32;1mProDB's arbitrator is installed successfully!${NC}"
echo
}
## ==============================Main program starts from here============================
# Install server and client
if [ -x ${bin_dir}/tarbitrator ]; then
update_flag=1
update_prodb
else
install_prodb
fi
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册