From 2c04cc0afef9b3b99e27c27af5f64ff6f398ffae Mon Sep 17 00:00:00 2001 From: Wang XiangYu Date: Sat, 9 May 2020 18:28:03 +0800 Subject: [PATCH] upgrade config to 0.4 (#2273) Signed-off-by: wxyu --- core/CMakeLists.txt | 3 --- core/conf/demo/log_config.conf | 27 -------------------- core/conf/demo/server_config.yaml | 42 ++++++++++++++++++++++++++++++- core/conf/log_config.template | 30 ---------------------- core/conf/server_config.template | 26 ++++++++++++++++++- core/src/config/Config.cpp | 2 +- 6 files changed, 67 insertions(+), 63 deletions(-) delete mode 100644 core/conf/demo/log_config.conf delete mode 100644 core/conf/log_config.template diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index bd79c3e0..8c8c29d1 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -217,8 +217,6 @@ else () @ONLY) endif () -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/conf/log_config.template ${CMAKE_CURRENT_SOURCE_DIR}/conf/log_config.conf) - install(DIRECTORY scripts/ DESTINATION scripts FILE_PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ @@ -232,7 +230,6 @@ install(DIRECTORY scripts/migration WORLD_EXECUTE WORLD_READ) install(FILES conf/server_config.yaml - conf/log_config.conf DESTINATION conf) diff --git a/core/conf/demo/log_config.conf b/core/conf/demo/log_config.conf deleted file mode 100644 index ce3e7c8e..00000000 --- a/core/conf/demo/log_config.conf +++ /dev/null @@ -1,27 +0,0 @@ -* GLOBAL: - FORMAT = "%datetime | %level | %logger | %msg" - FILENAME = "/var/lib/milvus/logs/milvus-%datetime{%y-%M-%d-%H:%m}-global.log" - ENABLED = true - TO_FILE = true - TO_STANDARD_OUTPUT = false - SUBSECOND_PRECISION = 3 - PERFORMANCE_TRACKING = false - MAX_LOG_FILE_SIZE = 209715200 ## Throw log files away after 200MB -* DEBUG: - FILENAME = "/var/lib/milvus/logs/milvus-%datetime{%y-%M-%d-%H:%m}-debug.log" - ENABLED = true -* WARNING: - FILENAME = "/var/lib/milvus/logs/milvus-%datetime{%y-%M-%d-%H:%m}-warning.log" -* TRACE: - FILENAME = "/var/lib/milvus/logs/milvus-%datetime{%y-%M-%d-%H:%m}-trace.log" -* VERBOSE: - FORMAT = "%datetime{%d/%M/%y} | %level-%vlevel | %msg" - TO_FILE = false - TO_STANDARD_OUTPUT = false -## Error logs -* ERROR: - ENABLED = true - FILENAME = "/var/lib/milvus/logs/milvus-%datetime{%y-%M-%d-%H:%m}-error.log" -* FATAL: - ENABLED = true - FILENAME = "/var/lib/milvus/logs/milvus-%datetime{%y-%M-%d-%H:%m}-fatal.log" diff --git a/core/conf/demo/server_config.yaml b/core/conf/demo/server_config.yaml index e4a6fa8e..d72eda34 100644 --- a/core/conf/demo/server_config.yaml +++ b/core/conf/demo/server_config.yaml @@ -9,7 +9,7 @@ # is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express # or implied. See the License for the specific language governing permissions and limitations under the License. -version: 0.3 +version: 0.4 #----------------------+------------------------------------------------------------+------------+-----------------+ # Server Config | Description | Type | Default | @@ -68,9 +68,13 @@ db_config: # secondary_path | A semicolon-separated list of secondary directories used | Path | | # | to save vector data and index data. | | | #----------------------+------------------------------------------------------------+------------+-----------------+ +# file_cleanup_timeout | time gap between soft-delete and hard-delete | Integer | 10 (s) | +# | range [0, 3600] | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ storage_config: primary_path: /var/lib/milvus secondary_path: + file_cleanup_timeout: 10 #----------------------+------------------------------------------------------------+------------+-----------------+ # Metric Config | Description | Type | Default | @@ -186,3 +190,39 @@ wal_config: recovery_error_ignore: true buffer_size: 256 wal_path: /var/lib/milvus/wal + +#----------------------+------------------------------------------------------------+------------+-----------------+ +# Logs | Description | Type | Default | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# trace.enable | Whether to enable trace level logging in Milvus. | Boolean | true | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# debug.enable | Whether to enable debug level logging in Milvus. | Boolean | true | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# info.enable | Whether to enable info level logging in Milvus. | Boolean | true | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# warning.enable | Whether to enable warning level logging in Milvus. | Boolean | true | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# error.enable | Whether to enable error level logging in Milvus. | Boolean | true | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# fatal.enable | Whether to enable fatal level logging in Milvus. | Boolean | true | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# path | Location of logs files. | String | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# max_log_file_size | Max size of a single log file. After exceeding this value, | Integer | 256 (MB) | +# | rename this file to xxx.log.n, means the nth file. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# delete_exceeds | Milvus will keep up to ${delete_exceeds} log files per | Integer | 10 | +# | level. For example, after xxx.log.11 file is generated, | | | +# | the xxx.log.1 file will be deleted. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +logs: + trace.enable: true + debug.enable: true + info.enable: true + warning.enable: true + error.enable: true + fatal.enable: true + path: /var/lib/milvus/logs + max_log_file_size: 256 + delete_exceeds: 10 + diff --git a/core/conf/log_config.template b/core/conf/log_config.template deleted file mode 100644 index c5a5be4c..00000000 --- a/core/conf/log_config.template +++ /dev/null @@ -1,30 +0,0 @@ -* GLOBAL: - FORMAT = "[%datetime][%level]%msg" - FILENAME = "@MILVUS_DB_PATH@/logs/milvus-%datetime{%y-%M-%d-%H:%m}-global.log" - ENABLED = true - TO_FILE = true - TO_STANDARD_OUTPUT = false - SUBSECOND_PRECISION = 3 - PERFORMANCE_TRACKING = false - MAX_LOG_FILE_SIZE = 209715200 ## Throw log files away after 200MB -* INFO: - FILENAME = "@MILVUS_DB_PATH@/logs/milvus-%datetime{%y-%M-%d-%H:%m}-info.log" - ENABLED = true -* DEBUG: - FILENAME = "@MILVUS_DB_PATH@/logs/milvus-%datetime{%y-%M-%d-%H:%m}-debug.log" - ENABLED = true -* WARNING: - FILENAME = "@MILVUS_DB_PATH@/logs/milvus-%datetime{%y-%M-%d-%H:%m}-warning.log" -* TRACE: - FILENAME = "@MILVUS_DB_PATH@/logs/milvus-%datetime{%y-%M-%d-%H:%m}-trace.log" -* VERBOSE: - FORMAT = "%datetime{%d/%M/%y} | %level-%vlevel | %msg" - TO_FILE = false - TO_STANDARD_OUTPUT = false -## Error logs -* ERROR: - ENABLED = true - FILENAME = "@MILVUS_DB_PATH@/logs/milvus-%datetime{%y-%M-%d-%H:%m}-error.log" -* FATAL: - ENABLED = true - FILENAME = "@MILVUS_DB_PATH@/logs/milvus-%datetime{%y-%M-%d-%H:%m}-fatal.log" diff --git a/core/conf/server_config.template b/core/conf/server_config.template index 9d7cbd8e..85115390 100644 --- a/core/conf/server_config.template +++ b/core/conf/server_config.template @@ -9,7 +9,7 @@ # is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express # or implied. See the License for the specific language governing permissions and limitations under the License. -version: 0.3 +version: 0.4 #----------------------+------------------------------------------------------------+------------+-----------------+ # Server Config | Description | Type | Default | @@ -191,6 +191,30 @@ wal_config: buffer_size: 256 wal_path: @MILVUS_DB_PATH@/wal +#----------------------+------------------------------------------------------------+------------+-----------------+ +# Logs | Description | Type | Default | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# trace.enable | Whether to enable trace level logging in Milvus. | Boolean | true | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# debug.enable | Whether to enable debug level logging in Milvus. | Boolean | true | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# info.enable | Whether to enable info level logging in Milvus. | Boolean | true | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# warning.enable | Whether to enable warning level logging in Milvus. | Boolean | true | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# error.enable | Whether to enable error level logging in Milvus. | Boolean | true | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# fatal.enable | Whether to enable fatal level logging in Milvus. | Boolean | true | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# path | Location of logs files. | String | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# max_log_file_size | Max size of a single log file. After exceeding this value, | Integer | 256 (MB) | +# | rename this file to xxx.log.n, means the nth file. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ +# delete_exceeds | Milvus will keep up to ${delete_exceeds} log files per | Integer | 10 | +# | level. For example, after xxx.log.11 file is generated, | | | +# | the xxx.log.1 file will be deleted. | | | +#----------------------+------------------------------------------------------------+------------+-----------------+ logs: trace.enable: true debug.enable: true diff --git a/core/src/config/Config.cpp b/core/src/config/Config.cpp index 2f54ea1d..e1e757fc 100644 --- a/core/src/config/Config.cpp +++ b/core/src/config/Config.cpp @@ -185,7 +185,7 @@ constexpr int32_t PORT_NUMBER_MIN = 1024; constexpr int32_t PORT_NUMBER_MAX = 65535; static const std::unordered_map milvus_config_version_map( - {{"0.6.0", "0.1"}, {"0.7.0", "0.2"}, {"0.7.1", "0.2"}, {"0.8.0", "0.3"}}); + {{"0.6.0", "0.1"}, {"0.7.0", "0.2"}, {"0.7.1", "0.2"}, {"0.8.0", "0.3"}, {"0.9.0", "0.4"}}); ///////////////////////////////////////////////////////////// Config::Config() { -- GitLab