提交 89084079 编写于 作者: wafwerar's avatar wafwerar

fix(os): add log data dir configure

上级 25b7ee99
...@@ -33,8 +33,19 @@ extern "C" { ...@@ -33,8 +33,19 @@ extern "C" {
#ifdef WINDOWS #ifdef WINDOWS
#define TD_TMP_DIR_PATH "C:\\Windows\\Temp\\" #define TD_TMP_DIR_PATH "C:\\Windows\\Temp\\"
#define TD_CFG_DIR_PATH "C:\\TDengine\\cfg\\"
#define TD_DATA_DIR_PATH "C:\\TDengine\\data\\"
#define TD_LOG_DIR_PATH "C:\\TDengine\\log\\"
#elif defined(_TD_DARWIN_64)
#define TD_TMP_DIR_PATH "/tmp/taosd/"
#define TD_CFG_DIR_PATH "/usr/local/etc/taos/"
#define TD_DATA_DIR_PATH "/usr/local/var/lib/taos/"
#define TD_LOG_DIR_PATH "/usr/local/var/log/taos/"
#else #else
#define TD_TMP_DIR_PATH "/tmp/" #define TD_TMP_DIR_PATH "/tmp/"
#define TD_CFG_DIR_PATH "/etc/taos/"
#define TD_DATA_DIR_PATH "/var/lib/taos/"
#define TD_LOG_DIR_PATH "/var/log/taos/"
#endif #endif
typedef struct TdDir *TdDirPtr; typedef struct TdDir *TdDirPtr;
......
...@@ -368,7 +368,7 @@ TEST(testCase, tSma_Data_Insert_Query_Test) { ...@@ -368,7 +368,7 @@ TEST(testCase, tSma_Data_Insert_Query_Test) {
SDiskCfg pDisks = {0}; SDiskCfg pDisks = {0};
pDisks.level = 0; pDisks.level = 0;
pDisks.primary = 1; pDisks.primary = 1;
strncpy(pDisks.dir, "/var/lib/taos", TSDB_FILENAME_LEN); strncpy(pDisks.dir, TD_DATA_DIR_PATH, TSDB_FILENAME_LEN);
int32_t numOfDisks = 1; int32_t numOfDisks = 1;
pTsdb->pTfs = tfsOpen(&pDisks, numOfDisks); pTsdb->pTfs = tfsOpen(&pDisks, numOfDisks);
EXPECT_NE(pTsdb->pTfs, nullptr); EXPECT_NE(pTsdb->pTfs, nullptr);
......
...@@ -137,7 +137,7 @@ void ctgTestInitLogFile() { ...@@ -137,7 +137,7 @@ void ctgTestInitLogFile() {
tsAsyncLog = 0; tsAsyncLog = 0;
qDebugFlag = 159; qDebugFlag = 159;
strcpy(tsLogDir, "/var/log/taos"); strcpy(tsLogDir, TD_LOG_DIR_PATH);
ctgdEnableDebug("api"); ctgdEnableDebug("api");
ctgdEnableDebug("meta"); ctgdEnableDebug("meta");
......
...@@ -108,7 +108,7 @@ void qwtInitLogFile() { ...@@ -108,7 +108,7 @@ void qwtInitLogFile() {
tsAsyncLog = 0; tsAsyncLog = 0;
qDebugFlag = 159; qDebugFlag = 159;
strcpy(tsLogDir, "/var/log/taos"); strcpy(tsLogDir, TD_LOG_DIR_PATH);
if (taosInitLog(defaultLogFileNamePrefix, maxLogFileNum) < 0) { if (taosInitLog(defaultLogFileNamePrefix, maxLogFileNum) < 0) {
printf("failed to open log file in directory:%s\n", tsLogDir); printf("failed to open log file in directory:%s\n", tsLogDir);
......
...@@ -60,7 +60,7 @@ void flttInitLogFile() { ...@@ -60,7 +60,7 @@ void flttInitLogFile() {
tsAsyncLog = 0; tsAsyncLog = 0;
qDebugFlag = 159; qDebugFlag = 159;
strcpy(tsLogDir, "/var/log/taos"); strcpy(tsLogDir, TD_LOG_DIR_PATH);
if (taosInitLog(defaultLogFileNamePrefix, maxLogFileNum) < 0) { if (taosInitLog(defaultLogFileNamePrefix, maxLogFileNum) < 0) {
printf("failed to open log file in directory:%s\n", tsLogDir); printf("failed to open log file in directory:%s\n", tsLogDir);
......
...@@ -74,7 +74,7 @@ void scltInitLogFile() { ...@@ -74,7 +74,7 @@ void scltInitLogFile() {
tsAsyncLog = 0; tsAsyncLog = 0;
qDebugFlag = 159; qDebugFlag = 159;
strcpy(tsLogDir, "/var/log/taos"); strcpy(tsLogDir, TD_LOG_DIR_PATH);
if (taosInitLog(defaultLogFileNamePrefix, maxLogFileNum) < 0) { if (taosInitLog(defaultLogFileNamePrefix, maxLogFileNum) < 0) {
printf("failed to open log file in directory:%s\n", tsLogDir); printf("failed to open log file in directory:%s\n", tsLogDir);
......
...@@ -79,7 +79,7 @@ void schtInitLogFile() { ...@@ -79,7 +79,7 @@ void schtInitLogFile() {
tsAsyncLog = 0; tsAsyncLog = 0;
qDebugFlag = 159; qDebugFlag = 159;
strcpy(tsLogDir, "/var/log/taos"); strcpy(tsLogDir, TD_LOG_DIR_PATH);
if (taosInitLog(defaultLogFileNamePrefix, maxLogFileNum) < 0) { if (taosInitLog(defaultLogFileNamePrefix, maxLogFileNum) < 0) {
printf("failed to open log file in directory:%s\n", tsLogDir); printf("failed to open log file in directory:%s\n", tsLogDir);
......
...@@ -70,11 +70,11 @@ void osDefaultInit() { ...@@ -70,11 +70,11 @@ void osDefaultInit() {
#elif defined(_TD_DARWIN_64) #elif defined(_TD_DARWIN_64)
if (configDir[0] == 0) { if (configDir[0] == 0) {
strcpy(configDir, "/tmp/taosd"); strcpy(configDir, "/usr/local/etc/taos");
} }
strcpy(tsDataDir, "/usr/local/var/lib/taos"); strcpy(tsDataDir, "/usr/local/var/lib/taos");
strcpy(tsLogDir, "/usr/local/var/log/taos"); strcpy(tsLogDir, "/usr/local/var/log/taos");
strcpy(tsTempDir, "/usr/local/etc/taos"); strcpy(tsTempDir, "/tmp/taosd");
strcpy(tsOsName, "Darwin"); strcpy(tsOsName, "Darwin");
#else #else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册