提交 b8c6d6c0 编写于 作者: guanshengliang's avatar guanshengliang

failed to get bandwidth

上级 b50d04ef
...@@ -27,39 +27,19 @@ extern int32_t mdebugFlag; ...@@ -27,39 +27,19 @@ extern int32_t mdebugFlag;
extern int32_t sdbDebugFlag; extern int32_t sdbDebugFlag;
// mnode log function // mnode log function
#define mError(...) \ #define mError(...) if (mdebugFlag & DEBUG_ERROR) { taosPrintLog("ERROR MND ", 255, __VA_ARGS__); }
if (mdebugFlag & DEBUG_ERROR) { \ #define mWarn(...) if (mdebugFlag & DEBUG_WARN) { taosPrintLog("WARN MND ", mdebugFlag, __VA_ARGS__); }
taosPrintLog("ERROR MND ", 255, __VA_ARGS__); \ #define mTrace(...) if (mdebugFlag & DEBUG_TRACE) { taosPrintLog("MND ", mdebugFlag, __VA_ARGS__); }
} #define mPrint(...) { taosPrintLog("MND ", 255, __VA_ARGS__); }
#define mWarn(...) \
if (mdebugFlag & DEBUG_WARN) { \
taosPrintLog("WARN MND ", mdebugFlag, __VA_ARGS__); \
}
#define mTrace(...) \
if (mdebugFlag & DEBUG_TRACE) { \
taosPrintLog("MND ", mdebugFlag, __VA_ARGS__); \
}
#define mPrint(...) \
{ taosPrintLog("MND ", 255, __VA_ARGS__); }
#define mLError(...) monitorSaveLog(2, __VA_ARGS__); mError(__VA_ARGS__) #define mLError(...) monitorSaveLog(2, __VA_ARGS__); mError(__VA_ARGS__)
#define mLWarn(...) monitorSaveLog(1, __VA_ARGS__); mWarn(__VA_ARGS__) #define mLWarn(...) monitorSaveLog(1, __VA_ARGS__); mWarn(__VA_ARGS__)
#define mLPrint(...) monitorSaveLog(0, __VA_ARGS__); mPrint(__VA_ARGS__) #define mLPrint(...) monitorSaveLog(0, __VA_ARGS__); mPrint(__VA_ARGS__)
#define sdbError(...) \ #define sdbError(...) if (sdbDebugFlag & DEBUG_ERROR) { taosPrintLog("ERROR MND-SDB ", 255, __VA_ARGS__); }
if (sdbDebugFlag & DEBUG_ERROR) { \ #define sdbWarn(...) if (sdbDebugFlag & DEBUG_WARN) { taosPrintLog("WARN MND-SDB ", sdbDebugFlag, __VA_ARGS__); }
taosPrintLog("ERROR MND-SDB ", 255, __VA_ARGS__); \ #define sdbTrace(...) if (sdbDebugFlag & DEBUG_TRACE) { taosPrintLog("MND-SDB ", sdbDebugFlag, __VA_ARGS__);}
} #define sdbPrint(...) { taosPrintLog("MND-SDB ", 255, __VA_ARGS__); }
#define sdbWarn(...) \
if (sdbDebugFlag & DEBUG_WARN) { \
taosPrintLog("WARN MND-SDB ", sdbDebugFlag, __VA_ARGS__); \
}
#define sdbTrace(...) \
if (sdbDebugFlag & DEBUG_TRACE) { \
taosPrintLog("MND-SDB ", sdbDebugFlag, __VA_ARGS__); \
}
#define sdbPrint(...) \
{ taosPrintLog("MND-SDB ", 255, __VA_ARGS__); }
#define sdbLError(...) monitorSaveLog(2, __VA_ARGS__); sdbError(__VA_ARGS__) #define sdbLError(...) monitorSaveLog(2, __VA_ARGS__); sdbError(__VA_ARGS__)
#define sdbLWarn(...) monitorSaveLog(1, __VA_ARGS__); sdbWarn(__VA_ARGS__) #define sdbLWarn(...) monitorSaveLog(1, __VA_ARGS__); sdbWarn(__VA_ARGS__)
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include "tutil.h" #include "tutil.h"
#include "dnode.h" #include "dnode.h"
#include "mgmtDef.h" #include "mgmtDef.h"
#include "mgmtLog.h" #include "mgmtInt.h"
#include "mgmtAcct.h" #include "mgmtAcct.h"
#include "mgmtDb.h" #include "mgmtDb.h"
#include "mgmtSdb.h" #include "mgmtSdb.h"
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "tbalance.h" #include "tbalance.h"
#include "tglobal.h" #include "tglobal.h"
#include "mgmtDef.h" #include "mgmtDef.h"
#include "mgmtLog.h" #include "mgmtInt.h"
#include "mgmtMnode.h" #include "mgmtMnode.h"
#include "mgmtDnode.h" #include "mgmtDnode.h"
#include "mgmtVgroup.h" #include "mgmtVgroup.h"
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include "tbalance.h" #include "tbalance.h"
#include "tdataformat.h" #include "tdataformat.h"
#include "mgmtDef.h" #include "mgmtDef.h"
#include "mgmtLog.h" #include "mgmtInt.h"
#include "mgmtAcct.h" #include "mgmtAcct.h"
#include "mgmtDb.h" #include "mgmtDb.h"
#include "mgmtDnode.h" #include "mgmtDnode.h"
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include "tdataformat.h" #include "tdataformat.h"
#include "dnode.h" #include "dnode.h"
#include "mgmtDef.h" #include "mgmtDef.h"
#include "mgmtLog.h" #include "mgmtInt.h"
#include "mgmtDnode.h" #include "mgmtDnode.h"
#include "mgmtMnode.h" #include "mgmtMnode.h"
#include "mgmtSdb.h" #include "mgmtSdb.h"
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include "os.h" #include "os.h"
#include "taoserror.h" #include "taoserror.h"
#include "tgrant.h" #include "tgrant.h"
#include "mgmtLog.h" #include "mgmtInt.h"
int32_t grantInit() { return TSDB_CODE_SUCCESS; } int32_t grantInit() { return TSDB_CODE_SUCCESS; }
void grantCleanUp() {} void grantCleanUp() {}
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include "tglobal.h" #include "tglobal.h"
#include "dnode.h" #include "dnode.h"
#include "mgmtDef.h" #include "mgmtDef.h"
#include "mgmtLog.h" #include "mgmtInt.h"
#include "mgmtServer.h" #include "mgmtServer.h"
#include "mgmtAcct.h" #include "mgmtAcct.h"
#include "mgmtDnode.h" #include "mgmtDnode.h"
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "tsocket.h" #include "tsocket.h"
#include "tdataformat.h" #include "tdataformat.h"
#include "mgmtDef.h" #include "mgmtDef.h"
#include "mgmtLog.h" #include "mgmtInt.h"
#include "mgmtMnode.h" #include "mgmtMnode.h"
#include "mgmtDnode.h" #include "mgmtDnode.h"
#include "mgmtSdb.h" #include "mgmtSdb.h"
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "taoserror.h" #include "taoserror.h"
#include "tutil.h" #include "tutil.h"
#include "mgmtDef.h" #include "mgmtDef.h"
#include "mgmtLog.h" #include "mgmtInt.h"
#include "mgmtAcct.h" #include "mgmtAcct.h"
#include "mgmtDnode.h" #include "mgmtDnode.h"
#include "mgmtDb.h" #include "mgmtDb.h"
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include "hashstr.h" #include "hashstr.h"
#include "dnode.h" #include "dnode.h"
#include "mgmtDef.h" #include "mgmtDef.h"
#include "mgmtLog.h" #include "mgmtInt.h"
#include "mgmtMnode.h" #include "mgmtMnode.h"
#include "mgmtSdb.h" #include "mgmtSdb.h"
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include "tglobal.h" #include "tglobal.h"
#include "dnode.h" #include "dnode.h"
#include "mgmtDef.h" #include "mgmtDef.h"
#include "mgmtLog.h" #include "mgmtInt.h"
#include "mgmtDb.h" #include "mgmtDb.h"
#include "mgmtMnode.h" #include "mgmtMnode.h"
#include "mgmtProfile.h" #include "mgmtProfile.h"
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "tcache.h" #include "tcache.h"
#include "dnode.h" #include "dnode.h"
#include "mgmtDef.h" #include "mgmtDef.h"
#include "mgmtLog.h" #include "mgmtInt.h"
#include "mgmtAcct.h" #include "mgmtAcct.h"
#include "mgmtDb.h" #include "mgmtDb.h"
#include "mgmtDnode.h" #include "mgmtDnode.h"
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "tglobal.h" #include "tglobal.h"
#include "dnode.h" #include "dnode.h"
#include "mgmtDef.h" #include "mgmtDef.h"
#include "mgmtLog.h" #include "mgmtInt.h"
#include "mgmtAcct.h" #include "mgmtAcct.h"
#include "mgmtDb.h" #include "mgmtDb.h"
#include "mgmtDnode.h" #include "mgmtDnode.h"
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include "tdataformat.h" #include "tdataformat.h"
#include "dnode.h" #include "dnode.h"
#include "mgmtDef.h" #include "mgmtDef.h"
#include "mgmtLog.h" #include "mgmtInt.h"
#include "mgmtAcct.h" #include "mgmtAcct.h"
#include "mgmtMnode.h" #include "mgmtMnode.h"
#include "mgmtSdb.h" #include "mgmtSdb.h"
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "dnode.h" #include "dnode.h"
#include "tdataformat.h" #include "tdataformat.h"
#include "mgmtDef.h" #include "mgmtDef.h"
#include "mgmtLog.h" #include "mgmtInt.h"
#include "mgmtDb.h" #include "mgmtDb.h"
#include "mgmtDnode.h" #include "mgmtDnode.h"
#include "mgmtMnode.h" #include "mgmtMnode.h"
......
...@@ -356,10 +356,15 @@ static bool taosGetCardName(char *ip, char *name) { ...@@ -356,10 +356,15 @@ static bool taosGetCardName(char *ip, char *name) {
break; break;
} }
if (strcmp(host, ip) == 0) { if (strcmp(host, "127.0.0.1") == 0) {
continue;
}
// TODO: the ip not config
// if (strcmp(host, ip) == 0) {
strcpy(name, ifa->ifa_name); strcpy(name, ifa->ifa_name);
ret = true; ret = true;
} // }
} }
freeifaddrs(ifaddr); freeifaddrs(ifaddr);
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
{ taosPrintLog("MON ", 255, __VA_ARGS__); } { taosPrintLog("MON ", 255, __VA_ARGS__); }
#define SQL_LENGTH 1024 #define SQL_LENGTH 1024
#define LOG_LEN_STR 80 #define LOG_LEN_STR 100
#define IP_LEN_STR 18 #define IP_LEN_STR 18
#define CHECK_INTERVAL 1000 #define CHECK_INTERVAL 1000
...@@ -148,8 +148,8 @@ static void dnodeBuildMonitorSql(char *sql, int32_t cmd) { ...@@ -148,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 cache 2 " "create database if not exists %s replica 1 days 10 keep 30 cache 1 "
"blocks 2 maxtables 32 precision 'us'", "blocks 2 maxtables 16 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,
...@@ -407,7 +407,7 @@ void monitorSaveLog(int32_t level, const char *const format, ...) { ...@@ -407,7 +407,7 @@ void monitorSaveLog(int32_t level, const char *const format, ...) {
if (tsMonitorConn.state != MONITOR_STATE_INITIALIZED) return; if (tsMonitorConn.state != MONITOR_STATE_INITIALIZED) return;
int32_t len = snprintf(sql, (size_t)max_length, "import into %s.log values(%" PRId64 ", %d,'", tsMonitorDbName, int32_t len = snprintf(sql, (size_t)max_length, "insert into %s.log values(%" PRId64 ", %d,'", tsMonitorDbName,
taosGetTimestampUs(), level); taosGetTimestampUs(), level);
va_start(argpointer, format); va_start(argpointer, format);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册