can’t create log database in monitor module
This commit is contained in:
parent
430c50c217
commit
ddaef5b5cf
|
@ -44,7 +44,7 @@
|
||||||
|
|
||||||
#define SQL_LENGTH 1024
|
#define SQL_LENGTH 1024
|
||||||
#define LOG_LEN_STR 80
|
#define LOG_LEN_STR 80
|
||||||
#define IP_LEN_STR 15
|
#define IP_LEN_STR 18
|
||||||
#define CHECK_INTERVAL 1000
|
#define CHECK_INTERVAL 1000
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
@ -115,6 +115,13 @@ static void monitorInitConn(void *para, void *unused) {
|
||||||
if (tsMonitorConn.ep[0] == 0)
|
if (tsMonitorConn.ep[0] == 0)
|
||||||
strcpy(tsMonitorConn.ep, tsLocalEp);
|
strcpy(tsMonitorConn.ep, tsLocalEp);
|
||||||
|
|
||||||
|
int len = strlen(tsMonitorConn.ep);
|
||||||
|
for (int i = 0; i < len; ++i) {
|
||||||
|
if (tsMonitorConn.ep[i] == ':' || tsMonitorConn.ep[i] == '-') {
|
||||||
|
tsMonitorConn.ep[i] = '_';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (tsMonitorConn.conn == NULL) {
|
if (tsMonitorConn.conn == NULL) {
|
||||||
taos_connect_a(NULL, "monitor", tsInternalPass, "", 0, monitorInitConnCb, &tsMonitorConn, &(tsMonitorConn.conn));
|
taos_connect_a(NULL, "monitor", tsInternalPass, "", 0, monitorInitConnCb, &tsMonitorConn, &(tsMonitorConn.conn));
|
||||||
} else {
|
} else {
|
||||||
|
@ -141,8 +148,8 @@ static void dnodeBuildMonitorSql(char *sql, int32_t cmd) {
|
||||||
|
|
||||||
if (cmd == MONITOR_CMD_CREATE_DB) {
|
if (cmd == MONITOR_CMD_CREATE_DB) {
|
||||||
snprintf(sql, SQL_LENGTH,
|
snprintf(sql, SQL_LENGTH,
|
||||||
"create database if not exists %s replica 1 days 10 keep 30 rows 1024 cache 2048 "
|
"create database if not exists %s replica 1 days 10 keep 30 cache 2 "
|
||||||
"ablocks 2 tblocks 32 tables 32 precision 'us'",
|
"blocks 2 maxtables 32 precision 'us'",
|
||||||
tsMonitorDbName);
|
tsMonitorDbName);
|
||||||
} else if (cmd == MONITOR_CMD_CREATE_MT_DN) {
|
} else if (cmd == MONITOR_CMD_CREATE_MT_DN) {
|
||||||
snprintf(sql, SQL_LENGTH,
|
snprintf(sql, SQL_LENGTH,
|
||||||
|
@ -154,7 +161,7 @@ static void dnodeBuildMonitorSql(char *sql, int32_t cmd) {
|
||||||
", io_read float, io_write float"
|
", io_read float, io_write float"
|
||||||
", req_http int, req_select int, req_insert int"
|
", req_http int, req_select int, req_insert int"
|
||||||
") tags (ipaddr binary(%d))",
|
") tags (ipaddr binary(%d))",
|
||||||
tsMonitorDbName, IP_LEN_STR + 1);
|
tsMonitorDbName, TSDB_FQDN_LEN + 1);
|
||||||
} else if (cmd == MONITOR_CMD_CREATE_TB_DN) {
|
} else if (cmd == MONITOR_CMD_CREATE_TB_DN) {
|
||||||
snprintf(sql, SQL_LENGTH, "create table if not exists %s.dn_%s using %s.dn tags('%s')", tsMonitorDbName,
|
snprintf(sql, SQL_LENGTH, "create table if not exists %s.dn_%s using %s.dn tags('%s')", tsMonitorDbName,
|
||||||
tsMonitorConn.ep, tsMonitorDbName, tsLocalEp);
|
tsMonitorConn.ep, tsMonitorDbName, tsLocalEp);
|
||||||
|
|
|
@ -14,7 +14,7 @@ print ========== step2
|
||||||
sql drop database log -x step21
|
sql drop database log -x step21
|
||||||
return -1
|
return -1
|
||||||
step21:
|
step21:
|
||||||
sql drop table log.cpu -x step22
|
sql drop table log.dn -x step22
|
||||||
return -1
|
return -1
|
||||||
step22:
|
step22:
|
||||||
sql drop user log -x step23
|
sql drop user log -x step23
|
||||||
|
|
Loading…
Reference in New Issue