提交 1383e53d 编写于 作者: S Shengliang Guan

tsim cfg

上级 6aab9380
...@@ -217,6 +217,10 @@ static void taosAddClientLogCfg(SConfig *pCfg) { ...@@ -217,6 +217,10 @@ static void taosAddClientLogCfg(SConfig *pCfg) {
cfgAddInt32(pCfg, "rpcDebugFlag", rpcDebugFlag, 0, 255, 1); cfgAddInt32(pCfg, "rpcDebugFlag", rpcDebugFlag, 0, 255, 1);
cfgAddInt32(pCfg, "tmrDebugFlag", tmrDebugFlag, 0, 255, 1); cfgAddInt32(pCfg, "tmrDebugFlag", tmrDebugFlag, 0, 255, 1);
cfgAddInt32(pCfg, "jniDebugFlag", jniDebugFlag, 0, 255, 1); cfgAddInt32(pCfg, "jniDebugFlag", jniDebugFlag, 0, 255, 1);
cfgAddInt32(pCfg, "simDebugFlag", 143, 0, 255, 1);
cfgAddDir(pCfg, "configDir", configDir, 1);
cfgAddDir(pCfg, "scriptDir", configDir, 1);
cfgAddInt32(pCfg, "debugFlag", 0, 0, 255, 1);
} }
static void taosAddServerLogCfg(SConfig *pCfg) { static void taosAddServerLogCfg(SConfig *pCfg) {
...@@ -229,8 +233,6 @@ static void taosAddServerLogCfg(SConfig *pCfg) { ...@@ -229,8 +233,6 @@ static void taosAddServerLogCfg(SConfig *pCfg) {
cfgAddInt32(pCfg, "tsdbDebugFlag", tsdbDebugFlag, 0, 255, 0); cfgAddInt32(pCfg, "tsdbDebugFlag", tsdbDebugFlag, 0, 255, 0);
cfgAddInt32(pCfg, "tqDebugFlag", tqDebugFlag, 0, 255, 0); cfgAddInt32(pCfg, "tqDebugFlag", tqDebugFlag, 0, 255, 0);
cfgAddInt32(pCfg, "fsDebugFlag", fsDebugFlag, 0, 255, 0); cfgAddInt32(pCfg, "fsDebugFlag", fsDebugFlag, 0, 255, 0);
cfgAddInt32(pCfg, "simDebugFlag", 143, 0, 255, 1);
cfgAddInt32(pCfg, "debugFlag", 0, 0, 255, 1);
} }
static void taosAddClientCfg(SConfig *pCfg) { static void taosAddClientCfg(SConfig *pCfg) {
...@@ -246,8 +248,6 @@ static void taosAddClientCfg(SConfig *pCfg) { ...@@ -246,8 +248,6 @@ static void taosAddClientCfg(SConfig *pCfg) {
cfgAddString(pCfg, "secondEp", defaultSecondEp, 1); cfgAddString(pCfg, "secondEp", defaultSecondEp, 1);
cfgAddString(pCfg, "fqdn", defaultFqdn, 1); cfgAddString(pCfg, "fqdn", defaultFqdn, 1);
cfgAddInt32(pCfg, "serverPort", defaultServerPort, 1, 65056, 1); cfgAddInt32(pCfg, "serverPort", defaultServerPort, 1, 65056, 1);
cfgAddString(pCfg, "configDir", configDir, 1);
cfgAddString(pCfg, "scriptDir", configDir, 1);
cfgAddDir(pCfg, "tempDir", osTempDir(), 1); cfgAddDir(pCfg, "tempDir", osTempDir(), 1);
cfgAddFloat(pCfg, "minimalTempDirGB", 1.0f, 0.001f, 10000000, 1); cfgAddFloat(pCfg, "minimalTempDirGB", 1.0f, 0.001f, 10000000, 1);
cfgAddFloat(pCfg, "numOfThreadsPerCore", tsNumOfThreadsPerCore, 0, 10, 1); cfgAddFloat(pCfg, "numOfThreadsPerCore", tsNumOfThreadsPerCore, 0, 10, 1);
...@@ -300,6 +300,7 @@ static void taosAddServerCfg(SConfig *pCfg) { ...@@ -300,6 +300,7 @@ static void taosAddServerCfg(SConfig *pCfg) {
} }
static void taosSetClientLogCfg(SConfig *pCfg) { static void taosSetClientLogCfg(SConfig *pCfg) {
SConfigItem *pItem = cfgGetItem(pCfg, "logDir");
osSetLogDir(cfgGetItem(pCfg, "logDir")->str); osSetLogDir(cfgGetItem(pCfg, "logDir")->str);
osSetDataReservedSpace(cfgGetItem(pCfg, "minimalLogDirGB")->fval); osSetDataReservedSpace(cfgGetItem(pCfg, "minimalLogDirGB")->fval);
tsNumOfLogLines = cfgGetItem(pCfg, "numOfLogLines")->i32; tsNumOfLogLines = cfgGetItem(pCfg, "numOfLogLines")->i32;
...@@ -397,6 +398,8 @@ static void taosSetServerCfg(SConfig *pCfg) { ...@@ -397,6 +398,8 @@ static void taosSetServerCfg(SConfig *pCfg) {
int32_t taosCreateLog(const char *logname, int32_t logFileNum, const char *cfgDir, const char *envFile, int32_t taosCreateLog(const char *logname, int32_t logFileNum, const char *cfgDir, const char *envFile,
const char *apolloUrl, bool tsc) { const char *apolloUrl, bool tsc) {
osInit();
SConfig *pCfg = cfgInit(); SConfig *pCfg = cfgInit();
if (pCfg == NULL) return -1; if (pCfg == NULL) return -1;
......
...@@ -97,8 +97,6 @@ int32_t dmnRunDnode() { ...@@ -97,8 +97,6 @@ int32_t dmnRunDnode() {
} }
int main(int argc, char const *argv[]) { int main(int argc, char const *argv[]) {
osInit();
if (dmnParseOption(argc, argv) != 0) { if (dmnParseOption(argc, argv) != 0) {
return -1; return -1;
} }
......
...@@ -92,21 +92,27 @@ void osInit() { ...@@ -92,21 +92,27 @@ void osInit() {
strcpy(env.tempDir, tmpDir); strcpy(env.tempDir, tmpDir);
} }
strcpy(configDir, "C:\\TDengine\\cfg"); if (configDir[0] == 0) {
strcpy(configDir, "C:\\TDengine\\cfg");
}
strcpy(env.dataDir, "C:\\TDengine\\data"); strcpy(env.dataDir, "C:\\TDengine\\data");
strcpy(env.logDir, "C:\\TDengine\\log"); strcpy(env.logDir, "C:\\TDengine\\log");
strcpy(env.tempDir, "C:\\Windows\\Temp"); strcpy(env.tempDir, "C:\\Windows\\Temp");
strcpy(env.osName, "Windows"); strcpy(env.osName, "Windows");
#elif defined(_TD_DARWIN_64) #elif defined(_TD_DARWIN_64)
strcpy(configDir, "/tmp/taosd"); if (configDir[0] == 0) {
strcpy(configDir, "/tmp/taosd");
}
strcpy(env.dataDir, "/usr/local/var/lib/taos"); strcpy(env.dataDir, "/usr/local/var/lib/taos");
strcpy(env.logDir, "/usr/local/var/log/taos"); strcpy(env.logDir, "/usr/local/var/log/taos");
strcpy(env.tempDir, "/usr/local/etc/taos"); strcpy(env.tempDir, "/usr/local/etc/taos");
strcpy(env.osName, "Darwin"); strcpy(env.osName, "Darwin");
#else #else
strcpy(configDir, "/etc/taos"); if (configDir[0] == 0) {
strcpy(configDir, "/etc/taos");
}
strcpy(env.dataDir, "/var/lib/taos"); strcpy(env.dataDir, "/var/lib/taos");
strcpy(env.logDir, "/var/log/taos"); strcpy(env.logDir, "/var/log/taos");
strcpy(env.tempDir, "/tmp"); strcpy(env.tempDir, "/tmp");
......
...@@ -75,8 +75,8 @@ void taosSetSystemLocale(const char *inLocale, const char *inCharSet) { ...@@ -75,8 +75,8 @@ void taosSetSystemLocale(const char *inLocale, const char *inCharSet) {
char *locale = setlocale(LC_CTYPE, inLocale); char *locale = setlocale(LC_CTYPE, inLocale);
// default locale or user specified locale is not valid, abort launch // default locale or user specified locale is not valid, abort launch
if (inLocale == NULL || strlen(inCharSet) == 0) { if (inLocale == NULL || strlen(inLocale) == 0) {
printf("Invalid locale:%s, please set the valid locale in config file\n", inLocale); //printf("Invalid locale:%s, please set the valid locale in config file\n", inLocale);
} }
if (!taosValidateEncodec(inCharSet)) { if (!taosValidateEncodec(inCharSet)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册