From 5a5856de955ed72d42402574d76ffa7bd107b6f4 Mon Sep 17 00:00:00 2001 From: shuwenwei Date: Fri, 17 May 2024 16:08:15 +0800 Subject: [PATCH 01/20] merge all config file to iotdb-system.properties --- .../confignode/conf/ConfigNodeDescriptor.java | 48 +- .../apache/iotdb/db/conf/IoTDBDescriptor.java | 104 +- .../conf/rest/IoTDBRestServiceDescriptor.java | 9 +- .../resources/conf/iotdb-system.properties | 1539 +++++++++++++++++ .../iotdb/commons/conf/CommonConfig.java | 5 +- .../conf/ConfigFileAutoUpdateTool.java | 108 ++ 6 files changed, 1726 insertions(+), 87 deletions(-) create mode 100644 iotdb-core/node-commons/src/assembly/resources/conf/iotdb-system.properties create mode 100644 iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/ConfigFileAutoUpdateTool.java diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeDescriptor.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeDescriptor.java index ee9621d2393c..cea89efb02bb 100644 --- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeDescriptor.java +++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeDescriptor.java @@ -21,6 +21,7 @@ import org.apache.iotdb.commons.conf.CommonConfig; import org.apache.iotdb.commons.conf.CommonDescriptor; +import org.apache.iotdb.commons.conf.ConfigFileAutoUpdateTool; import org.apache.iotdb.commons.conf.IoTDBConstant; import org.apache.iotdb.commons.exception.BadNodeUrlException; import org.apache.iotdb.commons.schema.SchemaConstant; @@ -36,7 +37,6 @@ import org.slf4j.LoggerFactory; import java.io.File; -import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; @@ -54,6 +54,19 @@ public class ConfigNodeDescriptor { private final ConfigNodeConfig conf = new ConfigNodeConfig(); + static { + ConfigFileAutoUpdateTool updateTool = new ConfigFileAutoUpdateTool(); + URL systemConfigUrl = getPropsUrl(CommonConfig.SYSTEM_CONFIG_NAME); + URL configNodeUrl = getPropsUrl(CommonConfig.CONFIG_NODE_CONFIG_NAME); + URL dataNodeUrl = getPropsUrl(CommonConfig.DATA_NODE_CONFIG_NAME); + URL commonConfigUrl = getPropsUrl(CommonConfig.COMMON_CONFIG_NAME); + try { + updateTool.checkAndMayUpdate(systemConfigUrl, configNodeUrl, dataNodeUrl, commonConfigUrl); + } catch (Exception e) { + LOGGER.error("Failed to update config file", e); + } + } + private ConfigNodeDescriptor() { loadProps(); } @@ -67,7 +80,7 @@ public ConfigNodeConfig getConf() { * * @return url object if location exit, otherwise null. */ - public URL getPropsUrl(String configFileName) { + public static URL getPropsUrl(String configFileName) { // Check if a config-directory was specified first. String urlString = System.getProperty(ConfigNodeConstant.CONFIGNODE_CONF, null); // If it wasn't, check if a home directory was provided @@ -102,37 +115,12 @@ else if (!urlString.endsWith(".properties")) { } private void loadProps() { - URL url = getPropsUrl(CommonConfig.CONFIG_NAME); Properties commonProperties = new Properties(); - if (url != null) { - try (InputStream inputStream = url.openStream()) { - - LOGGER.info("Start to read config file {}", url); - commonProperties.load(new InputStreamReader(inputStream, StandardCharsets.UTF_8)); - - } catch (FileNotFoundException e) { - LOGGER.error("Fail to find config file {}, reject ConfigNode startup.", url, e); - System.exit(-1); - } catch (IOException e) { - LOGGER.error("Cannot load config file, reject ConfigNode startup.", e); - System.exit(-1); - } catch (Exception e) { - LOGGER.error("Incorrect format in config file, reject ConfigNode startup.", e); - System.exit(-1); - } - } else { - LOGGER.warn( - "Couldn't load the configuration {} from any of the known sources.", - CommonConfig.CONFIG_NAME); - } - - url = getPropsUrl(ConfigNodeConstant.CONF_FILE_NAME); + URL url = getPropsUrl(CommonConfig.SYSTEM_CONFIG_NAME); if (url != null) { try (InputStream inputStream = url.openStream()) { LOGGER.info("start reading ConfigNode conf file: {}", url); - Properties properties = new Properties(); - properties.load(new InputStreamReader(inputStream, StandardCharsets.UTF_8)); - commonProperties.putAll(properties); + commonProperties.load(new InputStreamReader(inputStream, StandardCharsets.UTF_8)); loadProperties(commonProperties); } catch (IOException | BadNodeUrlException e) { LOGGER.error("Couldn't load ConfigNode conf file, reject ConfigNode startup.", e); @@ -151,7 +139,7 @@ private void loadProps() { } else { LOGGER.warn( "Couldn't load the configuration {} from any of the known sources.", - ConfigNodeConstant.CONF_FILE_NAME); + CommonConfig.SYSTEM_CONFIG_NAME); } } diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java index 690ad97f6f5e..856d73cd9ac7 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java @@ -20,6 +20,7 @@ import org.apache.iotdb.commons.conf.CommonConfig; import org.apache.iotdb.commons.conf.CommonDescriptor; +import org.apache.iotdb.commons.conf.ConfigFileAutoUpdateTool; import org.apache.iotdb.commons.conf.IoTDBConstant; import org.apache.iotdb.commons.exception.BadNodeUrlException; import org.apache.iotdb.commons.schema.SchemaConstant; @@ -87,9 +88,9 @@ public class IoTDBDescriptor { private static final Logger LOGGER = LoggerFactory.getLogger(IoTDBDescriptor.class); - private final CommonDescriptor commonDescriptor = CommonDescriptor.getInstance(); + private static final CommonDescriptor commonDescriptor = CommonDescriptor.getInstance(); - private final IoTDBConfig conf = new IoTDBConfig(); + private static final IoTDBConfig conf = new IoTDBConfig(); private static final long MAX_THROTTLE_THRESHOLD = 600 * 1024 * 1024 * 1024L; @@ -99,6 +100,19 @@ public class IoTDBDescriptor { private static final double MIN_DIR_USE_PROPORTION = 0.5; + static { + ConfigFileAutoUpdateTool updateTool = new ConfigFileAutoUpdateTool(); + URL systemConfigUrl = getPropsUrl(CommonConfig.SYSTEM_CONFIG_NAME); + URL configNodeUrl = getPropsUrl(CommonConfig.CONFIG_NODE_CONFIG_NAME); + URL dataNodeUrl = getPropsUrl(CommonConfig.DATA_NODE_CONFIG_NAME); + URL commonConfigUrl = getPropsUrl(CommonConfig.COMMON_CONFIG_NAME); + try { + updateTool.checkAndMayUpdate(systemConfigUrl, configNodeUrl, dataNodeUrl, commonConfigUrl); + } catch (Exception e) { + LOGGER.error("Failed to update config file", e); + } + } + protected IoTDBDescriptor() { loadProps(); ServiceLoader propertiesLoaderServiceLoader = @@ -136,7 +150,7 @@ public IoTDBConfig getConfig() { * * @return url object if location exit, otherwise null. */ - public URL getPropsUrl(String configFileName) { + public static URL getPropsUrl(String configFileName) { String urlString = commonDescriptor.getConfDir(); if (urlString == null) { // If urlString wasn't provided, try to find a default config in the root of the classpath. @@ -174,28 +188,9 @@ else if (!urlString.endsWith(".properties")) { /** load a property file and set TsfileDBConfig variables. */ @SuppressWarnings("squid:S3776") // Suppress high Cognitive Complexity warning private void loadProps() { - URL url = getPropsUrl(CommonConfig.CONFIG_NAME); Properties commonProperties = new Properties(); - if (url != null) { - try (InputStream inputStream = url.openStream()) { - LOGGER.info("Start to read config file {}", url); - commonProperties.load(new InputStreamReader(inputStream, StandardCharsets.UTF_8)); - } catch (FileNotFoundException e) { - LOGGER.error("Fail to find config file {}, reject DataNode startup.", url, e); - System.exit(-1); - } catch (IOException e) { - LOGGER.error("Cannot load config file, reject DataNode startup.", e); - System.exit(-1); - } catch (Exception e) { - LOGGER.error("Incorrect format in config file, reject DataNode startup.", e); - System.exit(-1); - } - } else { - LOGGER.warn( - "Couldn't load the configuration {} from any of the known sources.", - CommonConfig.CONFIG_NAME); - } - url = getPropsUrl(IoTDBConfig.CONFIG_NAME); + // if new properties file exist, skip old properties files + URL url = getPropsUrl(CommonConfig.SYSTEM_CONFIG_NAME); if (url != null) { try (InputStream inputStream = url.openStream()) { LOGGER.info("Start to read config file {}", url); @@ -225,7 +220,7 @@ private void loadProps() { } else { LOGGER.warn( "Couldn't load the configuration {} from any of the known sources.", - IoTDBConfig.CONFIG_NAME); + CommonConfig.SYSTEM_CONFIG_NAME); } } @@ -1725,37 +1720,30 @@ public void loadHotModifiedProps(Properties properties) throws QueryProcessExcep } public void loadHotModifiedProps() throws QueryProcessException { - URL url = getPropsUrl(CommonConfig.CONFIG_NAME); - if (url == null) { - LOGGER.warn("Couldn't load the configuration from any of the known sources."); - return; - } - Properties commonProperties = new Properties(); - try (InputStream inputStream = url.openStream()) { - LOGGER.info("Start to reload config file {}", url); - commonProperties.load(new InputStreamReader(inputStream, StandardCharsets.UTF_8)); - } catch (Exception e) { - LOGGER.warn("Fail to reload config file {}", url, e); - throw new QueryProcessException( - String.format("Fail to reload config file %s because %s", url, e.getMessage())); - } - url = getPropsUrl(IoTDBConfig.CONFIG_NAME); - if (url == null) { - LOGGER.warn("Couldn't load the configuration from any of the known sources."); - return; + URL url = getPropsUrl(CommonConfig.SYSTEM_CONFIG_NAME); + if (url != null && new File(url.getFile()).exists()) { + loadHotModifiedPropertiesFromUrl(commonProperties, url); + } else { + url = getPropsUrl(CommonConfig.COMMON_CONFIG_NAME); + if (url == null) { + LOGGER.warn("Couldn't load the configuration from any of the known sources."); + return; + } + loadHotModifiedPropertiesFromUrl(commonProperties, url); + + url = getPropsUrl(IoTDBConfig.CONFIG_NAME); + if (url == null) { + LOGGER.warn("Couldn't load the configuration from any of the known sources."); + return; + } + loadHotModifiedPropertiesFromUrl(commonProperties, url); } - try (InputStream inputStream = url.openStream()) { - LOGGER.info("Start to reload config file {}", url); - Properties properties = new Properties(); - properties.load(new InputStreamReader(inputStream, StandardCharsets.UTF_8)); - commonProperties.putAll(properties); + try { loadHotModifiedProps(commonProperties); } catch (Exception e) { - LOGGER.warn("Fail to reload config file {}", url, e); - throw new QueryProcessException( - String.format("Fail to reload config file %s because %s", url, e.getMessage())); + LOGGER.error("Failed to reload configs because {}", e.getMessage()); } ReloadLevel reloadLevel = MetricConfigDescriptor.getInstance().loadHotProps(commonProperties); LOGGER.info("Reload metric service in level {}", reloadLevel); @@ -1773,6 +1761,20 @@ public void loadHotModifiedProps() throws QueryProcessException { } } + private void loadHotModifiedPropertiesFromUrl(Properties commonProperties, URL url) + throws QueryProcessException { + try (InputStream inputStream = url.openStream()) { + LOGGER.info("Start to reload config file {}", url); + Properties properties = new Properties(); + properties.load(new InputStreamReader(inputStream, StandardCharsets.UTF_8)); + commonProperties.putAll(properties); + } catch (Exception e) { + LOGGER.warn("Fail to reload config file {}", url, e); + throw new QueryProcessException( + String.format("Fail to reload config file %s because %s", url, e.getMessage())); + } + } + private void initMemoryAllocate(Properties properties) { String memoryAllocateProportion = properties.getProperty("datanode_memory_proportion", null); if (memoryAllocateProportion == null) { diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/rest/IoTDBRestServiceDescriptor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/rest/IoTDBRestServiceDescriptor.java index e0d0df3dee95..48725ef1839d 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/rest/IoTDBRestServiceDescriptor.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/rest/IoTDBRestServiceDescriptor.java @@ -18,6 +18,7 @@ */ package org.apache.iotdb.db.conf.rest; +import org.apache.iotdb.commons.conf.CommonConfig; import org.apache.iotdb.commons.conf.IoTDBConstant; import org.apache.iotdb.db.conf.IoTDBConfig; @@ -40,11 +41,9 @@ public class IoTDBRestServiceDescriptor { private final IoTDBRestServiceConfig conf = new IoTDBRestServiceConfig(); protected IoTDBRestServiceDescriptor() { - Properties properties = loadProps(IoTDBRestServiceConfig.CONFIG_NAME); - if (properties != null) { - if (!properties.containsKey("enable_rest_service")) { - properties = loadProps(IoTDBRestServiceConfig.OLD_CONFIG_NAME); - } + URL systemConfig = getPropsUrl(CommonConfig.SYSTEM_CONFIG_NAME); + if (systemConfig != null) { + Properties properties = loadProps(CommonConfig.SYSTEM_CONFIG_NAME); if (properties != null) { loadProps(properties); } diff --git a/iotdb-core/node-commons/src/assembly/resources/conf/iotdb-system.properties b/iotdb-core/node-commons/src/assembly/resources/conf/iotdb-system.properties new file mode 100644 index 000000000000..c58bf3026ee0 --- /dev/null +++ b/iotdb-core/node-commons/src/assembly/resources/conf/iotdb-system.properties @@ -0,0 +1,1539 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License 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. +# + +#################### +### Config Node RPC Configuration +#################### + +# Used for RPC communication inside cluster. +# Could set 127.0.0.1(for local test) or ipv4 address. +# Datatype: String +cn_internal_address=127.0.0.1 + +# Used for RPC communication inside cluster. +# Datatype: int +cn_internal_port=10710 + +# Used for consensus communication among ConfigNodes inside cluster. +# Datatype: int +cn_consensus_port=10720 + +#################### +### Seed ConfigNode +#################### + +# For the first ConfigNode to start, cn_seed_config_node points to its own cn_internal_address:cn_internal_port. +# For other ConfigNodes that to join the cluster, cn_seed_config_node points to any running ConfigNode's cn_internal_address:cn_internal_port. +# Note: After this ConfigNode successfully joins the cluster for the first time, this parameter is no longer used. +# Each node automatically maintains the list of ConfigNodes and traverses connections when restarting. +# Format: address:port e.g. 127.0.0.1:10710 +# Datatype: String +cn_seed_config_node=127.0.0.1:10710 + +#################### +### Directory configuration +#################### + +# system dir +# If this property is unset, system will save the data in the default relative path directory under the confignode folder(i.e., %CONFIGNODE_HOME%/data/confignode/system). +# If it is absolute, system will save the data in exact location it points to. +# If it is relative, system will save the data in the relative path directory it indicates under the confignode folder. +# For windows platform +# If its prefix is a drive specifier followed by "\\", or if its prefix is "\\\\", then the path is absolute. Otherwise, it is relative. +# cn_system_dir=data\\confignode\\system +# For Linux platform +# If its prefix is "/", then the path is absolute. Otherwise, it is relative. +# cn_system_dir=data/confignode/system + +# consensus dir +# If this property is unset, system will save the data in the default relative path directory under the confignode folder(i.e., %CONFIGNODE_HOME%/data/confignode/consensus). +# If it is absolute, system will save the data in exact location it points to. +# If it is relative, system will save the data in the relative path directory it indicates under the confignode folder. +# Note: If data_dir is assigned an empty string(i.e.,zero-size), it will be handled as a relative path. +# For windows platform +# If its prefix is a drive specifier followed by "\\", or if its prefix is "\\\\", then the path is absolute. Otherwise, it is relative. +# cn_consensus_dir=data\\confignode\\consensus +# For Linux platform +# If its prefix is "/", then the path is absolute. Otherwise, it is relative. +# cn_consensus_dir=data/confignode/consensus + +# pipe_receiver_file_dir +# If this property is unset, system will save the data in the default relative path directory under the IoTDB folder(i.e., %IOTDB_HOME%/${cn_system_dir}/pipe/receiver). +# If it is absolute, system will save the data in the exact location it points to. +# If it is relative, system will save the data in the relative path directory it indicates under the IoTDB folder. +# Note: If pipe_receiver_file_dir is assigned an empty string(i.e.,zero-size), it will be handled as a relative path. +# For windows platform +# If its prefix is a drive specifier followed by "\\", or if its prefix is "\\\\", then the path is absolute. Otherwise, it is relative. +# pipe_receiver_file_dir=data\\confignode\\system\\pipe\\receiver +# For Linux platform +# If its prefix is "/", then the path is absolute. Otherwise, it is relative. +# pipe_receiver_file_dir=data/confignode/system/pipe/receiver + +#################### +### thrift rpc configuration +#################### + +# this feature is under development, set this as false before it is done. +# Datatype: boolean +# cn_rpc_thrift_compression_enable=false + +# if true, a snappy based compression method will be called before sending data by the network +# Datatype: boolean +# this feature is under development, set this as false before it is done. +# cn_rpc_advanced_compression_enable=false + +# Datatype: int +# cn_rpc_max_concurrent_client_num=65535 + +# thrift max frame size, 512MB by default +# Datatype: int +# cn_thrift_max_frame_size=536870912 + +# thrift init buffer size +# Datatype: int +# cn_thrift_init_buffer_size=1024 + +# Thrift socket and connection timeout between raft nodes, in milliseconds. +# Datatype: int +# cn_connection_timeout_ms=60000 + +# selector thread (TAsyncClientManager) nums for async thread in a clientManager +# Datatype: int +# cn_selector_thread_nums_of_client_manager=1 + +# The maximum number of clients that can be allocated for a node in a clientManager. +# when the number of the client to a single node exceeds this number, the thread for applying for a client will be blocked +# for a while, then ClientManager will throw ClientManagerException if there are no clients after the block time. +# Datatype: int +# cn_max_client_count_for_each_node_in_client_manager=300 + +#################### +### Metric Configuration +#################### + +# The reporters of metric module to report metrics +# If there are more than one reporter, please separate them by commas ",". +# Options: [JMX, PROMETHEUS] +# Datatype: String +# cn_metric_reporter_list= + +# The level of metric module +# Options: [OFF, CORE, IMPORTANT, NORMAL, ALL] +# Datatype: String +# cn_metric_level=CORE + +# The period of async collection of some metrics in second +# Datatype: int +# cn_metric_async_collect_period=5 + +# The port of prometheus reporter of metric module +# Datatype: int +# cn_metric_prometheus_reporter_port=9091 + + + +#################### +### Data Node RPC Configuration +#################### + +# Used for connection of IoTDB native clients(Session) +# Could set 127.0.0.1(for local test) or ipv4 address +# Datatype: String +dn_rpc_address=0.0.0.0 + +# Used for connection of IoTDB native clients(Session) +# Bind with dn_rpc_address +# Datatype: int +dn_rpc_port=6667 + +# Used for communication inside cluster. +# could set 127.0.0.1(for local test) or ipv4 address. +# Datatype: String +dn_internal_address=127.0.0.1 + +# Used for communication inside cluster. +# Bind with dn_internal_address +# Datatype: int +dn_internal_port=10730 + +# Port for data exchange among DataNodes inside cluster +# Bind with dn_internal_address +# Datatype: int +dn_mpp_data_exchange_port=10740 + +# port for consensus's communication for schema region inside cluster. +# Bind with dn_internal_address +# Datatype: int +dn_schema_region_consensus_port=10750 + +# port for consensus's communication for data region inside cluster. +# Bind with dn_internal_address +# Datatype: int +dn_data_region_consensus_port=10760 + +# Datatype: long +# The time of data node waiting for the next retry to join into the cluster. +# dn_join_cluster_retry_interval_ms=5000 + +#################### +### SSL Configuration +#################### + +# Does dn_rpc_port enable SSL +# enable_thrift_ssl=false + +# Rest Service enabled SSL +# enable_https=false + +# SSL key store path +# linux e.g. /home/iotdb/server.keystore (absolute path) or server.keystore (relative path) +# windows e.g. C:\\iotdb\\server.keystore (absolute path) or server.keystore (relative path) +# key_store_path= + +# SSL key store password +# key_store_pwd= + +#################### +### Seed ConfigNode +#################### + +# dn_seed_config_node points to any running ConfigNode's cn_internal_address:cn_internal_port. +# Note: After this DataNode successfully joins the cluster for the first time, this parameter is no longer used. +# Each node automatically maintains the list of ConfigNodes and traverses connections when restarting. +# Format: address:port e.g. 127.0.0.1:10710 +# Datatype: String +dn_seed_config_node=127.0.0.1:10710 + +#################### +### Connection Configuration +#################### + +# The maximum session idle time. unit: ms +# Idle sessions are the ones that performs neither query or non-query operations for a period of time +# Set to 0 to disable session timeout +# Datatype: int +# dn_session_timeout_threshold=0 + +# Datatype: boolean +# dn_rpc_thrift_compression_enable=false + +# if true, a snappy based compression method will be called before sending data by the network +# Datatype: boolean +# this feature is under development, set this as false before it is done. +# dn_rpc_advanced_compression_enable=false + +# Datatype: int +# dn_rpc_selector_thread_count=1 + +# Datatype: int +# dn_rpc_min_concurrent_client_num=1 + +# Datatype: int +# dn_rpc_max_concurrent_client_num=65535 + +# thrift max frame size, 512MB by default +# Datatype: int +# dn_thrift_max_frame_size=536870912 + +# thrift init buffer size +# Datatype: int +# dn_thrift_init_buffer_size=1024 + +# Thrift socket and connection timeout between raft nodes, in milliseconds. +# Datatype: int +# dn_connection_timeout_ms=60000 + +# selector thread (TAsyncClientManager) nums for async thread in a clientManager +# Datatype: int +# dn_selector_thread_count_of_client_manager=1 + +# The maximum number of clients that can be allocated for a node in a clientManager. +# When the number of the client to a single node exceeds this number, the thread for applying for a client will be blocked +# for a while, then ClientManager will throw ClientManagerException if there are no clients after the block time. +# Datatype: int +# dn_max_client_count_for_each_node_in_client_manager=300 + +#################### +### Directory Configuration +#################### + +# system dir +# If this property is unset, system will save the data in the default relative path directory under the IoTDB folder(i.e., %IOTDB_HOME%/data/datanode/system). +# If it is absolute, system will save the data in exact location it points to. +# If it is relative, system will save the data in the relative path directory it indicates under the IoTDB folder. +# For windows platform +# If its prefix is a drive specifier followed by "\\", or if its prefix is "\\\\", then the path is absolute. Otherwise, it is relative. +# dn_system_dir=data\\datanode\\system +# For Linux platform +# If its prefix is "/", then the path is absolute. Otherwise, it is relative. +# dn_system_dir=data/datanode/system + + +# data dirs +# If this property is unset, system will save the data in the default relative path directory under the IoTDB folder(i.e., %IOTDB_HOME%/data/datanode/data). +# If it is absolute, system will save the data in exact location it points to. +# If it is relative, system will save the data in the relative path directory it indicates under the IoTDB folder. +# If there are more than one directory, please separate them by commas ",". +# Note: If data_dirs is assigned an empty string(i.e.,zero-size), it will be handled as a relative path. +# For windows platform +# If its prefix is a drive specifier followed by "\\", or if its prefix is "\\\\", then the path is absolute. Otherwise, it is relative. +# dn_data_dirs=data\\datanode\\data +# For Linux platform +# If its prefix is "/", then the path is absolute. Otherwise, it is relative. +# dn_data_dirs=data/datanode/data + + +# multi_dir_strategy +# The strategy is used to choose a directory from data_dirs for the system to store a new tsfile. +# System provides two strategies to choose from, or user can create his own strategy by extending org.apache.iotdb.db.conf.directories.strategy.DirectoryStrategy. +# The info of the two strategies are as follows: +# 1. SequenceStrategy: the system will choose the directory in sequence. +# 2. MaxDiskUsableSpaceFirstStrategy: the system will choose the directory whose disk has the maximum space. +# Set SequenceStrategy or MaxDiskUsableSpaceFirstStrategy to apply the corresponding strategy. +# If this property is unset, system will use SequenceStrategy as default strategy. +# For this property, fully-qualified class name (include package name) and simple class name are both acceptable. +# dn_multi_dir_strategy=SequenceStrategy + +# consensus dir +# If this property is unset, system will save the data in the default relative path directory under the IoTDB folder(i.e., %IOTDB_HOME%/data/datanode). +# If it is absolute, system will save the data in the exact location it points to. +# If it is relative, system will save the data in the relative path directory it indicates under the IoTDB folder. +# Note: If consensus_dir is assigned an empty string(i.e.,zero-size), it will be handled as a relative path. +# For windows platform +# If its prefix is a drive specifier followed by "\\", or if its prefix is "\\\\", then the path is absolute. Otherwise, it is relative. +# dn_consensus_dir=data\\datanode\\consensus +# For Linux platform +# If its prefix is "/", then the path is absolute. Otherwise, it is relative. +# dn_consensus_dir=data/datanode/consensus + +# wal dirs +# If this property is unset, system will save the data in the default relative path directory under the IoTDB folder(i.e., %IOTDB_HOME%/data/datanode). +# If it is absolute, system will save the data in the exact location it points to. +# If it is relative, system will save the data in the relative path directory it indicates under the IoTDB folder. +# If there are more than one directory, please separate them by commas ",". +# Note: If wal_dirs is assigned an empty string(i.e.,zero-size), it will be handled as a relative path. +# For windows platform +# If its prefix is a drive specifier followed by "\\", or if its prefix is "\\\\", then the path is absolute. Otherwise, it is relative. +# dn_wal_dirs=data\\datanode\\wal +# For Linux platform +# If its prefix is "/", then the path is absolute. Otherwise, it is relative. +# dn_wal_dirs=data/datanode/wal + +# tracing dir +# Uncomment following fields to configure the tracing root directory. +# For Windows platform, the index is as follows: +# dn_tracing_dir=datanode\\tracing +# For Linux platform +# If its prefix is "/", then the path is absolute. Otherwise, it is relative. +# dn_tracing_dir=datanode/tracing + +# sync dir +# If this property is unset, system will save the data in the default relative path directory under the IoTDB folder(i.e., %IOTDB_HOME%/data/datanode). +# If it is absolute, system will save the data in the exact location it points to. +# If it is relative, system will save the data in the relative path directory it indicates under the IoTDB folder. +# Note: If sync_dir is assigned an empty string(i.e.,zero-size), it will be handled as a relative path. +# For windows platform +# If its prefix is a drive specifier followed by "\\", or if its prefix is "\\\\", then the path is absolute. Otherwise, it is relative. +# dn_sync_dir=data\\datanode\\sync +# For Linux platform +# If its prefix is "/", then the path is absolute. Otherwise, it is relative. +# dn_sync_dir=data/datanode/sync + +# sort_tmp_dir +# This property is used to configure the temporary directory for sorting operation. +# If this property is unset, system will save the data in the default relative path directory under the IoTDB folder(i.e., %IOTDB_HOME%/data/datanode). +# If it is absolute, system will save the data in the exact location it points to. +# If it is relative, system will save the data in the relative path directory it indicates under the IoTDB folder. +# Note: If sort_tmp_dir is assigned an empty string(i.e.,zero-size), it will be handled as a relative path. +# For windows platform +# If its prefix is a drive specifier followed by "\\", or if its prefix is "\\\\", then the path is absolute. Otherwise, it is relative. +# sort_tmp_dir=data\\datanode\\tmp +# For Linux platform +# If its prefix is "/", then the path is absolute. Otherwise, it is relative. +# sort_tmp_dir=data/datanode/tmp + +# pipe_receiver_file_dirs +# If this property is unset, system will save the data in the default relative path directory under the IoTDB folder(i.e., %IOTDB_HOME%/${dn_system_dir}/pipe/receiver). +# If it is absolute, system will save the data in the exact location it points to. +# If it is relative, system will save the data in the relative path directory it indicates under the IoTDB folder. +# If there are more than one directory, please separate them by commas ",". +# Note: If pipe_receiver_file_dirs is assigned an empty string(i.e.,zero-size), it will be handled as a relative path. +# For windows platform +# If its prefix is a drive specifier followed by "\\", or if its prefix is "\\\\", then the path is absolute. Otherwise, it is relative. +# pipe_receiver_file_dirs=data\\datanode\\system\\pipe\\receiver +# For Linux platform +# If its prefix is "/", then the path is absolute. Otherwise, it is relative. +# pipe_receiver_file_dirs=data/datanode/system/pipe/receiver + +#################### +### Metric Configuration +#################### + +# The reporters of metric module to report metrics +# If there are more than one reporter, please separate them by commas ",". +# Options: [JMX, PROMETHEUS] +# Datatype: String +# dn_metric_reporter_list= + +# The level of metric module +# Options: [OFF, CORE, IMPORTANT, NORMAL, ALL] +# Datatype: String +# dn_metric_level=CORE + +# The period of async collection of some metrics in second +# Datatype: int +# dn_metric_async_collect_period=5 + +# The port of prometheus reporter of metric module +# Datatype: int +dn_metric_prometheus_reporter_port=9092 + +# The type of internal reporter in metric module, used for checking flushed point number +# Options: [MEMORY, IOTDB] +# Datatype: String +# dn_metric_internal_reporter_type=MEMORY + +#################### +### REST Service Configuration +#################### + +# Is the REST service enabled +# enable_rest_service=false + +# the binding port of the REST service +# rest_service_port=18080 + +# Whether to display rest service interface information through swagger. eg: http://ip:port/swagger.json +# enable_swagger=false + +# the default row limit to a REST query response when the rowSize parameter is not given in request +# rest_query_default_row_size_limit=10000 + +# the expiration time of the user login information cache (in seconds) +# cache_expire_in_seconds=28800 + +# maximum number of users can be stored in the user login cache. +# cache_max_num=100 + +# init capacity of users can be stored in the user login cache. +# cache_init_num=10 + +# Is client authentication required +# client_auth=false + +# SSL trust store path +# trust_store_path="" + +# SSL trust store password. +# trust_store_pwd="" + +# SSL timeout (in seconds) +# idle_timeout_in_seconds=50000 + + + + +#################### +### Cluster Configuration +#################### + +# Used for indicate cluster name and distinguish different cluster. +# Datatype: string +cluster_name=defaultCluster + +#################### +### Replication configuration +#################### + +# ConfigNode consensus protocol type. +# This parameter is unmodifiable after ConfigNode starts for the first time. +# These consensus protocols are currently supported: +# 1. org.apache.iotdb.consensus.ratis.RatisConsensus +# 2. org.apache.iotdb.consensus.simple.SimpleConsensus (Only 1 ConfigNode can be deployed) +# Datatype: string +# config_node_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus + +# Default number of schema replicas +# Can not be changed after the first start +# Datatype: int +schema_replication_factor=1 + +# SchemaRegion consensus protocol type. +# This parameter is unmodifiable after ConfigNode starts for the first time. +# These consensus protocols are currently supported: +# 1. org.apache.iotdb.consensus.ratis.RatisConsensus +# 2. org.apache.iotdb.consensus.simple.SimpleConsensus (The schema_replication_factor can only be set to 1) +# Datatype: string +# schema_region_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus + +# Default number of data replicas +# Can not be changed after the first start +# Datatype: int +data_replication_factor=1 + +# DataRegion consensus protocol type. +# This parameter is unmodifiable after ConfigNode starts for the first time. +# These consensus protocols are currently supported: +# 1. org.apache.iotdb.consensus.simple.SimpleConsensus (The data_replication_factor can only be set to 1) +# 2. org.apache.iotdb.consensus.iot.IoTConsensus +# 3. org.apache.iotdb.consensus.ratis.RatisConsensus +# Datatype: string +# data_region_consensus_protocol_class=org.apache.iotdb.consensus.iot.IoTConsensus + +#################### +### Load balancing configuration +#################### + +# All parameters in Partition configuration is unmodifiable after ConfigNode starts for the first time. +# And these parameters should be consistent within the ConfigNodeGroup. +# Number of SeriesPartitionSlots per Database +# Datatype: Integer +# series_slot_num=1000 + +# SeriesPartitionSlot executor class +# These hashing algorithms are currently supported: +# 1. BKDRHashExecutor(Default) +# 2. APHashExecutor +# 3. JSHashExecutor +# 4. SDBMHashExecutor +# Also, if you want to implement your own SeriesPartition executor, you can inherit the SeriesPartitionExecutor class and +# modify this parameter to correspond to your Java class +# Datatype: String +# series_partition_executor_class=org.apache.iotdb.commons.partition.executor.hash.BKDRHashExecutor + +# The policy of extension SchemaRegionGroup for each Database. +# These policies are currently supported: +# 1. CUSTOM(Each Database will allocate schema_region_group_per_database RegionGroups as soon as created) +# 2. AUTO(Each Database will automatically extend SchemaRegionGroups based on the data it has) +# Datatype: String +# schema_region_group_extension_policy=AUTO + +# When set schema_region_group_extension_policy=CUSTOM, +# this parameter is the default number of SchemaRegionGroups for each Database. +# When set schema_region_group_extension_policy=AUTO, +# this parameter is the default minimal number of SchemaRegionGroups for each Database. +# Datatype: Integer +# default_schema_region_group_num_per_database=1 + +# Only take effect when set schema_region_group_extension_policy=AUTO. +# This parameter is the maximum number of SchemaRegions expected to be managed by each DataNode. +# Notice: Since each Database requires at least one SchemaRegionGroup to manage its schema, +# this parameter doesn't limit the upper bound of cluster SchemaRegions when there are too many Databases. +# Datatype: Double +# schema_region_per_data_node=1.0 + +# The policy of extension DataRegionGroup for each Database. +# These policies are currently supported: +# 1. CUSTOM(Each Database will allocate data_region_group_per_database DataRegionGroups as soon as created) +# 2. AUTO(Each Database will automatically extend DataRegionGroups based on the data it has) +# Datatype: String +# data_region_group_extension_policy=AUTO + +# When set data_region_group_extension_policy=CUSTOM, +# this parameter is the default number of DataRegionGroups for each Database. +# When set data_region_group_extension_policy=AUTO, +# this parameter is the default minimal number of DataRegionGroups for each Database. +# Datatype: Integer +# default_data_region_group_num_per_database=2 + +# Only take effect when set data_region_group_extension_policy=AUTO. +# This parameter is the maximum number of DataRegions expected to be managed by each DataNode. +# Notice: Since each Database requires at least two DataRegionGroups to manage its data, +# this parameter doesn't limit the upper bound of cluster DataRegions when there are too many Databases. +# Datatype: Double +# data_region_per_data_node=5.0 + +# Whether to enable auto leader balance for Ratis consensus protocol. +# The ConfigNode-leader will balance the leader of Ratis-RegionGroups by leader_distribution_policy if set true. +# Notice: Default is false because the Ratis is unstable for this function. +# Datatype: Boolean +# enable_auto_leader_balance_for_ratis_consensus=true + +# Whether to enable auto leader balance for IoTConsensus protocol. +# The ConfigNode-leader will balance the leader of IoTConsensus-RegionGroups by leader_distribution_policy if set true. +# Notice: Default is true because the IoTConsensus depends on this function to distribute leader. +# Datatype: Boolean +# enable_auto_leader_balance_for_iot_consensus=true + +#################### +### Cluster management +#################### + +# Time partition interval in milliseconds, and partitioning data inside each data region, default is equal to one week +# Can not be changed after the first start +# Datatype: long +# time_partition_interval=604800000 + +# The heartbeat interval in milliseconds, default is 1000ms +# Datatype: long +# heartbeat_interval_in_ms=1000 + +# Disk remaining threshold at which DataNode is set to ReadOnly status +# Datatype: double(percentage) +# disk_space_warning_threshold=0.05 + +#################### +### Memory Control Configuration +#################### + +# Memory Allocation Ratio: StorageEngine, QueryEngine, SchemaEngine, Consensus, StreamingEngine and Free Memory. +# The parameter form is a:b:c:d:e:f, where a, b, c, d, e and f are integers. for example: 1:1:1:1:1:1 , 6:2:1:1:1:1 +# If you have high level of writing pressure and low level of reading pressure, please adjust it to for example 6:1:1:1:1:1 +# datanode_memory_proportion=3:3:1:1:1:1 + +# Schema Memory Allocation Ratio: SchemaRegion, SchemaCache, and PartitionCache. +# The parameter form is a:b:c, where a, b and c are integers. for example: 1:1:1 , 6:2:1 +# schema_memory_proportion=5:4:1 + +# Memory allocation ratio in StorageEngine: Write, Compaction +# The parameter form is a:b:c:d, where a, b, c and d are integers. for example: 8:2 , 7:3 +# storage_engine_memory_proportion=8:2 + +# Memory allocation ratio in writing: Memtable, TimePartitionInfo +# Memtable is the total memory size of all memtables +# TimePartitionInfo is the total memory size of last flush time of all data regions +# write_memory_proportion=19:1 + +# primitive array size (length of each array) in array pool +# Datatype: int +# primitive_array_size=64 + +# Ratio of compaction memory for chunk metadata maintains in memory when doing compaction +# Datatype: double +# chunk_metadata_size_proportion=0.1 + +# Ratio of write memory for invoking flush disk, 0.4 by default +# If you have extremely high write load (like batch=1000), it can be set lower than the default value like 0.2 +# Datatype: double +# flush_proportion=0.4 + +# Ratio of write memory allocated for buffered arrays, 0.6 by default +# Datatype: double +# buffered_arrays_memory_proportion=0.6 + +# Ratio of write memory for rejecting insertion, 0.8 by default +# If you have extremely high write load (like batch=1000) and the physical memory size is large enough, +# it can be set higher than the default value like 0.9 +# Datatype: double +# reject_proportion=0.8 + +# Ratio of memory for the DevicePathCache. DevicePathCache is the deviceId cache, keep only one copy of the same deviceId in memory +# Datatype: double +# device_path_cache_proportion=0.05 + +# If memory cost of data region increased more than proportion of allocated memory for write, report to system. The default value is 0.001 +# Datatype: double +# write_memory_variation_report_proportion=0.001 + +# When an inserting is rejected, waiting period (in ms) to check system again, 50 by default. +# If the insertion has been rejected and the read load is low, it can be set larger. +# Datatype: int +# check_period_when_insert_blocked=50 + +# size of ioTaskQueue. The default value is 10 +# Datatype: int +# io_task_queue_size_for_flushing=10 + +# If true, we will estimate each query's possible memory footprint before executing it and deny it if its estimated memory exceeds current free memory +# Datatype: bool +# enable_query_memory_estimation=true + +#################### +### Schema Engine Configuration +#################### + +# The schema management mode of schema engine. Currently support Memory and PBTree. +# This config of all DataNodes in one cluster must keep same. +# Datatype: string +# schema_engine_mode=Memory + +# cache size for partition. +# This cache is used to improve partition fetch from config node. +# Datatype: int +# partition_cache_size=1000 + +# Size of log buffer in each metadata operation plan(in byte). +# If the size of a metadata operation plan is larger than this parameter, then it will be rejected by SchemaRegion +# If it sets a value smaller than 0, use the default value 1024*1024 +# Datatype: int +# mlog_buffer_size=1048576 + +# The cycle when metadata log is periodically forced to be written to disk(in milliseconds) +# If sync_mlog_period_in_ms=0 it means force metadata log to be written to disk after each refreshment +# Set this parameter to 0 may slow down the operation on slow disk. +# sync_mlog_period_in_ms=100 + +# interval num for tag and attribute records when force flushing to disk +# When a certain amount of tag and attribute records is reached, they will be force flushed to disk +# It is possible to lose at most tag_attribute_flush_interval records +# tag_attribute_flush_interval=1000 + +# max size for a storage block for tags and attributes of one time series. If the combined size of tags and +# attributes exceeds the tag_attribute_total_size, a new storage block will be allocated to continue storing +# the excess data. +# the unit is byte +# Datatype: int +# tag_attribute_total_size=700 + +# max measurement num of internal request +# When creating timeseries with Session.createMultiTimeseries, the user input plan, the timeseries num of +# which exceeds this num, will be split to several plans with timeseries no more than this num. +# max_measurement_num_of_internal_request=10000 + +# Policy of DataNodeSchemaCache eviction. +# Support FIFO and LRU policy. FIFO takes low cache update overhead. LRU takes high cache hit rate. +# datanode_schema_cache_eviction_policy=FIFO + +# This configuration parameter sets the maximum number of time series allowed in the cluster. +# The value should be a positive integer representing the desired threshold. +# When the threshold is reached, users will be prohibited from creating new time series. +# -1 means unlimited +# cluster_timeseries_limit_threshold=-1 + +# This configuration parameter sets the maximum number of device allowed in the cluster. +# The value should be a positive integer representing the desired threshold. +# When the threshold is reached, users will be prohibited from creating new time series. +# -1 means unlimited +# cluster_device_limit_threshold=-1 + +# This configuration parameter sets the maximum number of Cluster Databases allowed. +# The value should be a positive integer representing the desired threshold. +# When the threshold is reached, users will be prohibited from creating new databases. +# -1 means unlimited. +# database_limit_threshold = -1 + + + +#################### +### Configurations for creating schema automatically +#################### + +# Whether creating schema automatically is enabled +# If true, then create database and timeseries automatically when not exists in insertion +# Or else, user need to create database and timeseries before insertion. +# Datatype: boolean +# enable_auto_create_schema=true + +# Database level when creating schema automatically is enabled +# e.g. root.sg0.d1.s2 +# we will set root.sg0 as the database if database level is 1 +# Datatype: int +# default_storage_group_level=1 + +# ALL data types: BOOLEAN, INT32, INT64, FLOAT, DOUBLE, TEXT + +# register time series as which type when receiving boolean string "true" or "false" +# Datatype: TSDataType +# Options: BOOLEAN, TEXT +# boolean_string_infer_type=BOOLEAN + +# register time series as which type when receiving an integer string and using float or double may lose precision +# Datatype: TSDataType +# Options: DOUBLE, FLOAT, INT32, INT64, TEXT +# integer_string_infer_type=DOUBLE + +# register time series as which type when receiving a floating number string "6.7" +# Datatype: TSDataType +# Options: DOUBLE, FLOAT, TEXT +# floating_string_infer_type=DOUBLE + +# register time series as which type when receiving the Literal NaN. +# Datatype: TSDataType +# Options: DOUBLE, FLOAT, TEXT +# nan_string_infer_type=DOUBLE + +# BOOLEAN encoding when creating schema automatically is enabled +# Datatype: TSEncoding +# default_boolean_encoding=RLE + +# INT32 encoding when creating schema automatically is enabled +# Datatype: TSEncoding +# default_int32_encoding=TS_2DIFF + +# INT64 encoding when creating schema automatically is enabled +# Datatype: TSEncoding +# default_int64_encoding=TS_2DIFF + +# FLOAT encoding when creating schema automatically is enabled +# Datatype: TSEncoding +# default_float_encoding=GORILLA + +# DOUBLE encoding when creating schema automatically is enabled +# Datatype: TSEncoding +# default_double_encoding=GORILLA + +# TEXT encoding when creating schema automatically is enabled +# Datatype: TSEncoding +# default_text_encoding=PLAIN + +#################### +### Query Configurations +#################### + +# The read consistency level +# These consistency levels are currently supported: +# 1. strong(Default, read from the leader replica) +# 2. weak(Read from a random replica) +# Datatype: string +# read_consistency_level=strong + +# Whether to cache meta data(BloomFilter, ChunkMetadata and TimeSeriesMetadata) or not. +# Datatype: boolean +# meta_data_cache_enable=true + +# Read memory Allocation Ratio: BloomFilterCache : ChunkCache : TimeSeriesMetadataCache : Coordinator : Operators : DataExchange : timeIndex in TsFileResourceList : others. +# The parameter form is a:b:c:d:e:f:g:h, where a, b, c, d, e, f, g and h are integers. for example: 1:1:1:1:1:1:1:1 , 1:100:200:50:200:200:200:50 +# chunk_timeseriesmeta_free_memory_proportion=1:100:200:50:200:200:200:50 + +# Whether to enable LAST cache +# Datatype: boolean +# enable_last_cache=true + +# Core size of ThreadPool of MPP data exchange +# Datatype: int +# mpp_data_exchange_core_pool_size=10 + +# Max size of ThreadPool of MPP data exchange +# Datatype: int +# mpp_data_exchange_max_pool_size=10 + +# Max waiting time for MPP data exchange +# Datatype: int +# mpp_data_exchange_keep_alive_time_in_ms=1000 + +# The max execution time of a DriverTask +# Datatype: int, Unit: ms +# driver_task_execution_time_slice_in_ms=200 + +# The max capacity of a TsBlock +# Datatype: int, Unit: byte +# max_tsblock_size_in_bytes=131072 + +# The max number of lines in a single TsBlock +# Datatype: int +# max_tsblock_line_number=1000 + +# Time cost(ms) threshold for slow query +# Datatype: long +# slow_query_threshold=10000 + +# The max executing time of query. unit: ms +# Datatype: int +# query_timeout_threshold=60000 + +# The maximum allowed concurrently executing queries +# Datatype: int +# max_allowed_concurrent_queries=1000 + +# How many threads can concurrently execute query statement. When <= 0, use CPU core number. +# Datatype: int +# query_thread_count=0 + +# How many pipeline drivers will be created for one fragment instance. When <= 0, use CPU core number / 2. +# Datatype: int +# degree_of_query_parallelism=0 + +# The threshold of count map size when calculating the MODE aggregation function +# Datatype: int +# mode_map_size_threshold=10000 + +# The amount of data iterate each time in server (the number of data strips, that is, the number of different timestamps.) +# Datatype: int +# batch_size=100000 + +# The memory for external sort in sort operator, when the data size is smaller than sort_buffer_size_in_bytes, the sort operator will use in-memory sort. +# Datatype: long +# sort_buffer_size_in_bytes=1048576 + +# The threshold of operator count in the result set of EXPLAIN ANALYZE, if the number of operator in the result set is larger than this threshold, operator will be merged. +# Datatype: int +# merge_threshold_of_explain_analyze=10 + +#################### +### Storage Engine Configuration +#################### + +# Use this value to set timestamp precision as "ms", "us" or "ns". +# Once the precision has been set, it can not be changed. +# Datatype: String +# timestamp_precision=ms + +# When the timestamp precision check is enabled, the timestamps those are over 13 digits for ms precision, or over 16 digits for us precision are not allowed to be inserted. +# Datatype: Boolean +# timestamp_precision_check_enabled=true + +# Default TTL for databases that are not set TTL by statements, If not set (default), the TTL will be unlimited. +# Negative value means the TTL is unlimited. +# Notice: if this property is changed, previous created database which are not set TTL will also be affected. +# Datatype: long +# Unit: ms +# default_ttl_in_ms=-1 + +# When the waiting time (in ms) of an inserting exceeds this, throw an exception. 10000 by default. +# If the insertion has been rejected and the read load is low, it can be set larger +# Datatype: int +# max_waiting_time_when_insert_blocked=10000 + +# Add a switch to enable separate sequence and unsequence data. +# If it is true, then data will be separated into seq and unseq data dir. If it is false, then all data will be written into unseq data dir. +# Datatype: boolean +# enable_separate_data=true + +# What will the system do when unrecoverable error occurs. +# Datatype: String +# Optional strategies are as follows: +# 1. CHANGE_TO_READ_ONLY: set system status to read-only and the system only accepts query operations. +# 2. SHUTDOWN: the system will be shutdown. +# handle_system_error=CHANGE_TO_READ_ONLY + +# Whether to timed flush sequence tsfiles' memtables. +# Datatype: boolean +# enable_timed_flush_seq_memtable=true + +# If a memTable's last update time is older than current time minus this, the memtable will be flushed to disk. +# Only check sequence tsfiles' memtables. +# The default flush interval is 10 * 60 * 1000. (unit: ms) +# Datatype: long +# seq_memtable_flush_interval_in_ms=600000 + +# The interval to check whether sequence memtables need flushing. +# The default flush check interval is 30 * 1000. (unit: ms) +# Datatype: long +# seq_memtable_flush_check_interval_in_ms=30000 + +# Whether to timed flush unsequence tsfiles' memtables. +# Datatype: boolean +# enable_timed_flush_unseq_memtable=true + +# If a memTable's last update time is older than current time minus this, the memtable will be flushed to disk. +# Only check unsequence tsfiles' memtables. +# The default flush interval is 10 * 60 * 1000. (unit: ms) +# Datatype: long +# unseq_memtable_flush_interval_in_ms=600000 + +# The interval to check whether unsequence memtables need flushing. +# The default flush check interval is 30 * 1000. (unit: ms) +# Datatype: long +# unseq_memtable_flush_check_interval_in_ms=30000 + +# The sort algorithms used in the memtable's TVList +# TIM: default tim sort, +# QUICK: quick sort, +# BACKWARD: backward sort +# tvlist_sort_algorithm=TIM + +# When the average point number of timeseries in memtable exceeds this, the memtable is flushed to disk. The default threshold is 100000. +# Datatype: int +# avg_series_point_number_threshold=100000 + +# How many threads can concurrently flush. When <= 0, use CPU core number. +# Datatype: int +# flush_thread_count=0 + +# In one insert (one device, one timestamp, multiple measurements), +# if enable partial insert, one measurement failure will not impact other measurements +# Datatype: boolean +# enable_partial_insert=true + +# the interval to log recover progress of each vsg when starting iotdb +# Datatype: int +# recovery_log_interval_in_ms=5000 + +# If using v0.13 client to insert data, please set this configuration to true. +# Notice: if using v0.13/v1.0 client or setting Client Version to V_0_13 manually, enable this config will disable insert redirection. +# Datatype: boolean +# 0.13_data_insert_adapt=false + +# Verify that TSfiles generated by Flush, Load, and Compaction are correct. The following is verified: +# 1. Check whether the file contains a header and a tail +# 2. Check whether files can be deserialized successfully +# 3. Check whether the file contains data +# 4. Whether there is time range overlap between data, whether it is increased, and whether the metadata index offset of the sequence is correct +# Datatype: boolean +# enable_tsfile_validation=false + +#################### +### Compaction Configurations +#################### +# sequence space compaction: only compact the sequence files +# Datatype: boolean +# enable_seq_space_compaction=true + +# unsequence space compaction: only compact the unsequence files +# Datatype: boolean +# enable_unseq_space_compaction=true + +# cross space compaction: compact the unsequence files into the overlapped sequence files +# Datatype: boolean +# enable_cross_space_compaction=true + +# the selector of cross space compaction task +# Options: rewrite +# cross_selector=rewrite + +# the compaction performer of cross space compaction task +# Options: read_point, fast +# cross_performer=fast + +# the selector of inner sequence space compaction task +# Options: size_tiered +# inner_seq_selector=size_tiered + +# the performer of inner sequence space compaction task +# Options: read_chunk, fast +# inner_seq_performer=read_chunk + +# the selector of inner unsequence space compaction task +# Options: size_tiered +# inner_unseq_selector=size_tiered + +# the performer of inner unsequence space compaction task +# Options: read_point, fast +# inner_unseq_performer=fast + +# The priority of compaction execution +# INNER_CROSS: prioritize inner space compaction, reduce the number of files first +# CROSS_INNER: prioritize cross space compaction, eliminate the unsequence files first +# BALANCE: alternate two compaction types +# compaction_priority=BALANCE + +# The size of candidate compaction task queue. +# Datatype: int +# candidate_compaction_task_queue_size = 200 + +# This parameter is used in two places: +# 1. The target tsfile size of inner space compaction. +# 2. The candidate size of seq tsfile in cross space compaction will be smaller than target_compaction_file_size * 1.5. +# In most cases, the target file size of cross compaction won't exceed this threshold, and if it does, it will not be much larger than it. +# default is 2GB +# Datatype: long, Unit: byte +# target_compaction_file_size=2147483648 + +# The target chunk size in compaction and when memtable reaches this threshold, flush the memtable to disk. +# default is 1MB +# Datatype: long, Unit: byte +# target_chunk_size=1048576 + +# The target point nums in one chunk in compaction +# Datatype: long +# target_chunk_point_num=100000 + +# If the chunk size is lower than this threshold, it will be deserialize into points, default is 128 byte +# Datatype: long, Unit:byte +# chunk_size_lower_bound_in_compaction=128 + +# If the chunk point num is lower than this threshold, it will be deserialize into points +# Datatype: long +# chunk_point_num_lower_bound_in_compaction=100 + +# The max file when selecting inner space compaction candidate files +# Datatype: int +# max_inner_compaction_candidate_file_num=30 + +# The max file when selecting cross space compaction candidate files +# At least one unseq file with it's overlapped seq files will be selected even exceeded this number +# Datatype: int +# max_cross_compaction_candidate_file_num=500 + +# The max total size when selecting cross space compaction candidate files +# At least one unseq file with it's overlapped seq files will be selected even exceeded this number +# Datatype: long, Unit: byte +# max_cross_compaction_candidate_file_size=5368709120 + +# The min inner compaction level of unsequence file which can be selected as candidate +# Datatype: int +# min_cross_compaction_unseq_file_level=1 + +# If one merge file selection runs for more than this time, it will be ended and its current +# selection will be used as final selection. +# When < 0, it means time is unbounded. +# Datatype: long, Unit: ms +# cross_compaction_file_selection_time_budget=30000 + +# How many threads will be set up to perform compaction, 10 by default. +# Set to 1 when less than or equal to 0. +# Datatype: int +# compaction_thread_count=10 + +# The interval of compaction task schedule +# Datatype: long, Unit: ms +# compaction_schedule_interval_in_ms=60000 + +# The interval of compaction task submission +# Datatype: long, Unit: ms +# compaction_submission_interval_in_ms=60000 + +# The limit of write throughput merge can reach per second +# values less than or equal to 0 means no limit +# Datatype: int, Unit: megabyte +# compaction_write_throughput_mb_per_sec=16 + +# The limit of read throughput merge can reach per second +# values less than or equal to 0 means no limit +# Datatype: int, Unit: megabyte +# compaction_read_throughput_mb_per_sec=0 + +# The limit of read operation merge can reach per second +# values less than or equal to 0 means no limit +# Datatype: int +# compaction_read_operation_per_sec=0 + +# The number of sub compaction threads to be set up to perform compaction. +# Currently only works for nonAligned data in cross space compaction and unseq inner space compaction. +# Set to 1 when less than or equal to 0. +# Datatype: int +# sub_compaction_thread_count=4 + +# Redundancy value of disk availability, only use for inner compaction. +# When disk availability is lower than the sum of (disk_space_warning_threshold + inner_compaction_task_selection_disk_redundancy), inner compaction tasks containing mods files are selected first. +# DataType: double +# inner_compaction_task_selection_disk_redundancy=0.05 + +# Mods file size threshold, only use for inner compaction. +# When the size of the mods file corresponding to TsFile exceeds this value, inner compaction tasks containing mods files are selected first. +# DataType: long +# inner_compaction_task_selection_mods_file_threshold=10485760 + +# The number of threads to be set up to select compaction task. +# Datatype: int +# compaction_schedule_thread_num=4 + +#################### +### Write Ahead Log Configuration +#################### + +# Write mode of wal +# The details of these three modes are as follows: +# 1. DISABLE: the system will disable wal. +# 2. SYNC: the system will submit wal synchronously, write request will not return until its wal is fsynced to the disk successfully. +# 3. ASYNC: the system will submit wal asynchronously, write request will return immediately no matter its wal is fsynced to the disk successfully. +# The write performance order is DISABLE > ASYNC > SYNC, but only SYNC mode can ensure data durability. +# wal_mode=ASYNC + +# Max number of wal nodes, each node corresponds to one wal directory +# This parameter is only valid in the standalone mode. IoTConsensus uses one wal per data region and RatisConsensus doesn't use wal. +# The default value 0 means the number is determined by the system, the number is in the range of [data region num / 2, data region num]. +# Notice: this value affects write performance significantly. +# For non-SSD disks, values between one third and half of databases number are recommended. +# Datatype: int +# max_wal_nodes_num=0 + +# Duration a wal flush operation will wait before calling fsync in the async mode +# A duration greater than 0 batches multiple wal fsync calls into one. This is useful when disks are slow or WAL write contention exists. +# Notice: this value affects write performance significantly, values in the range of 10ms-2000ms are recommended. +# Datatype: long +# wal_async_mode_fsync_delay_in_ms=1000 + +# Duration a wal flush operation will wait before calling fsync in the sync mode +# A duration greater than 0 batches multiple wal fsync calls into one. This is useful when disks are slow or WAL write contention exists. +# Notice: this value affects write performance significantly, values in the range of 0ms-10ms are recommended. +# Datatype: long +# wal_sync_mode_fsync_delay_in_ms=3 + +# Buffer size of each wal node +# If it's a value smaller than 0, use the default value 32 * 1024 * 1024 bytes (32MB). +# Datatype: int +# wal_buffer_size_in_byte=33554432 + +# Blocking queue capacity of each wal buffer, restricts maximum number of WALEdits cached in the blocking queue. +# Datatype: int +# wal_buffer_queue_capacity=500 + +# Size threshold of each wal file +# When a wal file's size exceeds this, the wal file will be closed and a new wal file will be created. +# If it's a value smaller than 0, use the default value 30 * 1024 * 1024 (30MB). +# Datatype: long +# wal_file_size_threshold_in_byte=31457280 + +# Minimum ratio of effective information in wal files +# This value should be between 0.0 and 1.0 +# If effective information ratio is below this value, MemTable snapshot or flush will be triggered. +# Increase this value when wal occupies too much disk space. But, if this parameter is too large, the write performance may decline. +# Datatype: double +# wal_min_effective_info_ratio=0.1 + +# MemTable size threshold for triggering MemTable snapshot in wal +# When a memTable's size (in byte) exceeds this, wal can flush this memtable to disk, otherwise wal will snapshot this memtable in wal. +# If it's a value smaller than 0, use the default value 8 * 1024 * 1024 bytes (8MB). +# Datatype: long +# wal_memtable_snapshot_threshold_in_byte=8388608 + +# MemTable's max snapshot number in wal +# If one memTable's snapshot number in wal exceeds this value, it will be flushed to disk. +# Datatype: int +# max_wal_memtable_snapshot_num=1 + +# The period when outdated wal files are periodically deleted +# If this value is too large, outdated wal files may not able to be deleted in time. +# If it's a value smaller than 0, use the default value 20 * 1000 ms (20 seconds). +# Datatype: long +# delete_wal_files_period_in_ms=20000 + +# The minimum size of wal files when throttle down in IoTConsensus +# If this value is not set, it will be carefully chosen according to the available disk space. +# If this value is set smaller than 0, it will default to 50 * 1024 * 1024 * 1024 bytes (50GB). +# Datatype: long +# iot_consensus_throttle_threshold_in_byte=53687091200 + +# Maximum wait time of write cache in IoTConsensus +# If this value is less than or equal to 0, use the default value 10 * 1000 ms (10s) +# Datatype: long +# iot_consensus_cache_window_time_in_ms=-1 + +#################### +### IoTConsensus Configuration +#################### + +# The maximum log entries num in IoTConsensus Batch +# Datatype: int +# data_region_iot_max_log_entries_num_per_batch = 1024 + +# The maximum size in IoTConsensus Batch +# Datatype: int +# data_region_iot_max_size_per_batch = 16777216 + +# The maximum pending batches num in IoTConsensus +# Datatype: int +# data_region_iot_max_pending_batches_num = 5 + +# The maximum memory ratio for queue in IoTConsensus +# Datatype: double +# data_region_iot_max_memory_ratio_for_queue = 0.6 + +# The maximum transit size in byte per second for region migration +# values less than or equal to 0 means no limit +# Datatype: long +# region_migration_speed_limit_bytes_per_second = 33554432 + +#################### +### TsFile Configurations +#################### + +# Datatype: int +# group_size_in_byte=134217728 + +# The memory size for each series writer to pack page, default value is 64KB +# Datatype: int +# page_size_in_byte=65536 + +# The maximum number of data points in a page, default 10000 +# Datatype: int +# max_number_of_points_in_page=10000 + +# The threshold for pattern matching in regex +# Datatype: int +# pattern_matching_threshold=1000000 + +# Floating-point precision +# Datatype: int +# float_precision=2 + +# Encoder of value series. default value is PLAIN. +# For int, long data type, also supports TS_2DIFF and RLE(run-length encoding), GORILLA and ZIGZAG. +# value_encoder=PLAIN + +# Compression configuration +# Data compression method, supports UNCOMPRESSED, SNAPPY, ZSTD, LZMA2 or LZ4. Default value is LZ4 +# And it is also used as the default compressor of time column in aligned timeseries. +# compressor=LZ4 + +#################### +### Authorization Configuration +#################### + +# which class to serve for authorization. By default, it is LocalFileAuthorizer. +# Another choice is org.apache.iotdb.commons.auth.authorizer.OpenIdAuthorizer +# authorizer_provider_class=org.apache.iotdb.commons.auth.authorizer.LocalFileAuthorizer + +# If OpenIdAuthorizer is enabled, then openID_url must be set. +# openID_url= + +# encryption provider class +# iotdb_server_encrypt_decrypt_provider=org.apache.iotdb.commons.security.encrypt.MessageDigestEncrypt + +# encryption provided class parameter +# iotdb_server_encrypt_decrypt_provider_parameter= + +# Cache size of user and role +# Datatype: int +# author_cache_size=1000 + +# Cache expire time of user and role +# Datatype: int +# author_cache_expire_time=30 + +#################### +### UDF Configuration +#################### + +# Used to estimate the memory usage of text fields in a UDF query. +# It is recommended to set this value to be slightly larger than the average length of all text +# records. +# Datatype: int +# udf_initial_byte_array_length_for_memory_control=48 + +# How much memory may be used in ONE UDF query (in MB). +# The upper limit is 20% of allocated memory for read. +# Datatype: float +# udf_memory_budget_in_mb=30.0 + +# UDF memory allocation ratio. +# The parameter form is a:b:c, where a, b, and c are integers. +# udf_reader_transformer_collector_memory_proportion=1:1:1 + +# UDF lib dir +# If this property is unset, system will save the data in the default relative path directory under +# the UDF folder(i.e., %CONFIGNODE_HOME%/ext/udf). +# +# If it is absolute, system will save the data in exact location it points to. +# If it is relative, system will save the data in the relative path directory it indicates under the +# UDF folder. +# Note: If data_dir is assigned an empty string(i.e.,zero-size), it will be handled as a relative +# path. +# +# For Windows platform +# If its prefix is a drive specifier followed by "\\", or if its prefix is "\\\\", then the path is +# absolute. Otherwise, it is relative. +# udf_lib_dir=ext\\udf +# +# For Linux platform +# If its prefix is "/", then the path is absolute. Otherwise, it is relative. +# udf_lib_dir=ext/udf + +#################### +### Trigger Configuration +#################### + +# Uncomment the following field to configure the trigger lib directory. +# For Windows platform +# If its prefix is a drive specifier followed by "\\", or if its prefix is "\\\\", then the path is +# absolute. Otherwise, it is relative. +# trigger_lib_dir=ext\\trigger +# For Linux platform +# If its prefix is "/", then the path is absolute. Otherwise, it is relative. +# trigger_lib_dir=ext/trigger + +# How many times will we retry to found an instance of stateful trigger on DataNodes +# 3 by default. +# Datatype: int +# stateful_trigger_retry_num_when_not_found=3 + + +#################### +### Select-Into Configuration +#################### + +# The maximum memory occupied by the data to be written when executing select-into statements. +# Datatype: long +# into_operation_buffer_size_in_byte=104857600 + +# The maximum number of rows can be processed in insert-tablet-plan when executing select-into statements. +# When <= 0, use 10000. +# Datatype: int +# select_into_insert_tablet_plan_row_limit=10000 + +# The number of threads in the thread pool that execute insert-tablet tasks +# Datatype: int +# into_operation_execution_thread_count=2 + +#################### +### Continuous Query Configuration +#################### + +# The number of threads in the scheduled thread pool that submit continuous query tasks periodically +# Datatype: int +# continuous_query_submit_thread_count=2 + +# The minimum value of the continuous query execution time interval +# Datatype: long(duration) +# continuous_query_min_every_interval_in_ms=1000 + +#################### +### Pipe Configuration +#################### + +# Uncomment the following field to configure the pipe lib directory. +# For Windows platform +# If its prefix is a drive specifier followed by "\\", or if its prefix is "\\\\", then the path is +# absolute. Otherwise, it is relative. +# pipe_lib_dir=ext\\pipe +# For Linux platform +# If its prefix is "/", then the path is absolute. Otherwise, it is relative. +# pipe_lib_dir=ext/pipe + +# The maximum number of threads that can be used to execute the pipe subtasks in PipeSubtaskExecutor. +# The actual value will be min(pipe_subtask_executor_max_thread_num, max(1, CPU core number / 2)). +# pipe_subtask_executor_max_thread_num=5 + +# The connection timeout (in milliseconds) for the thrift client. +# pipe_sink_timeout_ms=900000 + +# The maximum number of selectors that can be used in the sink. +# Recommend to set this value to less than or equal to pipe_sink_max_client_number. +# pipe_sink_selector_number=4 + +# The maximum number of clients that can be used in the sink. +# pipe_sink_max_client_number=16 + +# Whether to enable receiving pipe data through air gap. +# The receiver can only return 0 or 1 in tcp mode to indicate whether the data is received successfully. +# pipe_air_gap_receiver_enabled=false + +# The port for the server to receive pipe data through air gap. +# pipe_air_gap_receiver_port=9780 + +#################### +### RatisConsensus Configuration +#################### + +# max payload size for a single log-sync-RPC from leader to follower(in byte, by default 16MB) +# config_node_ratis_log_appender_buffer_size_max=16777216 +# schema_region_ratis_log_appender_buffer_size_max=16777216 +# data_region_ratis_log_appender_buffer_size_max=16777216 + +# trigger a snapshot when snapshot_trigger_threshold logs are written +# config_node_ratis_snapshot_trigger_threshold=400000 +# schema_region_ratis_snapshot_trigger_threshold=400000 +# data_region_ratis_snapshot_trigger_threshold=400000 + +# allow flushing Raft Log asynchronously +# config_node_ratis_log_unsafe_flush_enable=false +# schema_region_ratis_log_unsafe_flush_enable=false +# data_region_ratis_log_unsafe_flush_enable=false + +# max capacity of a single Log segment file (in byte, by default 24MB) +# config_node_ratis_log_segment_size_max_in_byte=25165824 +# schema_region_ratis_log_segment_size_max_in_byte=25165824 +# data_region_ratis_log_segment_size_max_in_byte=25165824 +# config_node_simple_consensus_log_segment_size_max_in_byte=25165824 + +# flow control window for ratis grpc log appender +# config_node_ratis_grpc_flow_control_window=4194304 +# schema_region_ratis_grpc_flow_control_window=4194304 +# data_region_ratis_grpc_flow_control_window=4194304 +# config_node_ratis_grpc_leader_outstanding_appends_max=128 +# schema_region_ratis_grpc_leader_outstanding_appends_max=128 +# data_region_ratis_grpc_leader_outstanding_appends_max=128 +# config_node_ratis_log_force_sync_num=128 +# schema_region_ratis_log_force_sync_num=128 +# data_region_ratis_log_force_sync_num=128 + +# min election timeout for leader election +# config_node_ratis_rpc_leader_election_timeout_min_ms=2000 +# schema_region_ratis_rpc_leader_election_timeout_min_ms=2000 +# data_region_ratis_rpc_leader_election_timeout_min_ms=2000 + +# max election timeout for leader election +# config_node_ratis_rpc_leader_election_timeout_max_ms=4000 +# schema_region_ratis_rpc_leader_election_timeout_max_ms=4000 +# data_region_ratis_rpc_leader_election_timeout_max_ms=4000 + +# ratis client retry threshold +# config_node_ratis_request_timeout_ms=10000 +# schema_region_ratis_request_timeout_ms=10000 +# data_region_ratis_request_timeout_ms=10000 + +# currently we use exponential back-off retry policy for ratis +# config_node_ratis_max_retry_attempts=10 +# config_node_ratis_initial_sleep_time_ms=100 +# config_node_ratis_max_sleep_time_ms=10000 +# schema_region_ratis_max_retry_attempts=10 +# schema_region_ratis_initial_sleep_time_ms=100 +# schema_region_ratis_max_sleep_time_ms=10000 +# data_region_ratis_max_retry_attempts=10 +# data_region_ratis_initial_sleep_time_ms=100 +# data_region_ratis_max_sleep_time_ms=10000 + +# first election timeout +# ratis_first_election_timeout_min_ms=50 +# ratis_first_election_timeout_max_ms=150 + +# preserve certain logs when take snapshot and purge +# config_node_ratis_preserve_logs_num_when_purge=1000 +# schema_region_ratis_preserve_logs_num_when_purge=1000 +# data_region_ratis_preserve_logs_num_when_purge=1000 + +# Raft Log disk size control +# config_node_ratis_log_max_size = 2147483648 +# schema_region_ratis_log_max_size = 2147483648 +# data_region_ratis_log_max_size = 21474836480 + +# Raft periodic snapshot interval, time unit is second +# config_node_ratis_periodic_snapshot_interval=86400 +# schema_region_ratis_periodic_snapshot_interval=86400 +# data_region_ratis_periodic_snapshot_interval=86400 + +#################### +### Procedure Configuration +#################### + +# Default number of worker thread count +# Datatype: int +# procedure_core_worker_thread_count=4 + +# Default time interval of completed procedure cleaner work in, time unit is second +# Datatype: int +# procedure_completed_clean_interval=30 + +# Default ttl of completed procedure, time unit is second +# Datatype: int +# procedure_completed_evict_ttl=800 + +#################### +### MQTT Broker Configuration +#################### + +# whether to enable the mqtt service. +# Datatype: boolean +# enable_mqtt_service=false + +# the mqtt service binding host. +# Datatype: String +# mqtt_host=127.0.0.1 + +# the mqtt service binding port. +# Datatype: int +# mqtt_port=1883 + +# the handler pool size for handing the mqtt messages. +# Datatype: int +# mqtt_handler_pool_size=1 + +# the mqtt message payload formatter. +# Datatype: String +# mqtt_payload_formatter=json + +# max length of mqtt message in byte +# Datatype: int +# mqtt_max_message_size=1048576 + +#################### +### IoTDB-ML Configuration +#################### + +# The thread count which can be used for model inference operation. +# model_inference_execution_thread_count=5 + +#################### +### Load TsFile Configuration +#################### + +# Load clean up task is used to clean up the unsuccessful loaded tsfile after a certain period of time. +# The parameter is the delay time after an unsuccessful load operation (in seconds). +# load_clean_up_task_execution_delay_time_seconds=1800 diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java index 86014cd7b6c6..ee42c0ca32ff 100644 --- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java +++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java @@ -36,7 +36,10 @@ public class CommonConfig { - public static final String CONFIG_NAME = "iotdb-common.properties"; + public static final String CONFIG_NODE_CONFIG_NAME = "iotdb-confignode.properties"; + public static final String DATA_NODE_CONFIG_NAME = "iotdb-datanode.properties"; + public static final String COMMON_CONFIG_NAME = "iotdb-common.properties"; + public static final String SYSTEM_CONFIG_NAME = "iotdb-system.properties"; private static final Logger logger = LoggerFactory.getLogger(CommonConfig.class); // Open ID Secret diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/ConfigFileAutoUpdateTool.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/ConfigFileAutoUpdateTool.java new file mode 100644 index 000000000000..ffd1038385e6 --- /dev/null +++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/ConfigFileAutoUpdateTool.java @@ -0,0 +1,108 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License 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. + */ + +package org.apache.iotdb.commons.conf; + +import java.io.File; +import java.io.IOException; +import java.io.RandomAccessFile; +import java.net.URL; +import java.nio.file.Files; +import java.util.concurrent.TimeUnit; + +public class ConfigFileAutoUpdateTool { + + private final String lockFileSuffix = ".lock"; + private String license = + "#\n" + + "# Licensed to the Apache Software Foundation (ASF) under one\n" + + "# or more contributor license agreements. See the NOTICE file\n" + + "# distributed with this work for additional information\n" + + "# regarding copyright ownership. The ASF licenses this file\n" + + "# to you under the Apache License, Version 2.0 (the\n" + + "# \"License\"); you may not use this file except in compliance\n" + + "# with the License. You may obtain a copy of the License at\n" + + "#\n" + + "# http://www.apache.org/licenses/LICENSE-2.0\n" + + "#\n" + + "# Unless required by applicable law or agreed to in writing,\n" + + "# software distributed under the License is distributed on an\n" + + "# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n" + + "# KIND, either express or implied. See the License for the\n" + + "# specific language governing permissions and limitations\n" + + "# under the License."; + + public void checkAndMayUpdate(URL systemUrl, URL configNodeUrl, URL dataNodeUrl, URL commonUrl) + throws IOException, InterruptedException { + if (systemUrl == null || configNodeUrl == null || dataNodeUrl == null || commonUrl == null) { + return; + } + File systemFile = new File(systemUrl.getFile()); + File configNodeFile = new File(configNodeUrl.getFile()); + File dataNodeFile = new File(dataNodeUrl.getFile()); + File commonFile = new File(commonUrl.getFile()); + + if (!systemFile.exists()) { + if (!configNodeFile.exists() || !dataNodeFile.exists() || !commonFile.exists()) { + return; + } + systemFile.createNewFile(); + } + + acquireTargetFileLock(systemFile); + try { + // other progress updated this file + if (systemFile.length() != 0) { + return; + } + try (RandomAccessFile raf = new RandomAccessFile(systemFile, "rw")) { + raf.write(license.getBytes()); + String configNodeContent = readConfigLines(configNodeFile); + raf.write(configNodeContent.getBytes()); + String dataNodeContent = readConfigLines(dataNodeFile); + raf.write(dataNodeContent.getBytes()); + String commonContent = readConfigLines(commonFile); + raf.write(commonContent.getBytes()); + } + } finally { + releaseFileLock(systemFile); + } + } + + private String readConfigLines(File file) throws IOException { + byte[] bytes = Files.readAllBytes(file.toPath()); + String content = new String(bytes); + return content.replace(license, ""); + } + + private void acquireTargetFileLock(File file) throws IOException, InterruptedException { + long waitTime = System.currentTimeMillis() + TimeUnit.SECONDS.toMillis(20); + File lockFile = new File(file.getPath() + lockFileSuffix); + while (System.currentTimeMillis() < waitTime) { + if (lockFile.createNewFile()) { + return; + } + Thread.sleep(TimeUnit.MICROSECONDS.toMillis(100)); + } + } + + private void releaseFileLock(File file) throws IOException { + Files.deleteIfExists(new File(file.getPath() + lockFileSuffix).toPath()); + } +} From 2dab0a2ff4a5338aed2bdb8b824768808aa4f354 Mon Sep 17 00:00:00 2001 From: shuwenwei Date: Fri, 17 May 2024 16:21:46 +0800 Subject: [PATCH 02/20] modify loadHotModifiedProps --- .../apache/iotdb/db/conf/IoTDBDescriptor.java | 31 +++++++------------ 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java index 856d73cd9ac7..309825006a91 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java @@ -1720,30 +1720,21 @@ public void loadHotModifiedProps(Properties properties) throws QueryProcessExcep } public void loadHotModifiedProps() throws QueryProcessException { - Properties commonProperties = new Properties(); - URL url = getPropsUrl(CommonConfig.SYSTEM_CONFIG_NAME); - if (url != null && new File(url.getFile()).exists()) { - loadHotModifiedPropertiesFromUrl(commonProperties, url); - } else { - url = getPropsUrl(CommonConfig.COMMON_CONFIG_NAME); - if (url == null) { - LOGGER.warn("Couldn't load the configuration from any of the known sources."); - return; - } - loadHotModifiedPropertiesFromUrl(commonProperties, url); - - url = getPropsUrl(IoTDBConfig.CONFIG_NAME); - if (url == null) { - LOGGER.warn("Couldn't load the configuration from any of the known sources."); - return; - } - loadHotModifiedPropertiesFromUrl(commonProperties, url); + if (url == null) { + LOGGER.warn("Couldn't load the configuration from any of the known sources."); + return; } - try { + + Properties commonProperties = new Properties(); + try (InputStream inputStream = url.openStream()) { + LOGGER.info("Start to reload config file {}", url); + commonProperties.load(new InputStreamReader(inputStream, StandardCharsets.UTF_8)); loadHotModifiedProps(commonProperties); } catch (Exception e) { - LOGGER.error("Failed to reload configs because {}", e.getMessage()); + LOGGER.warn("Fail to reload config file {}", url, e); + throw new QueryProcessException( + String.format("Fail to reload config file %s because %s", url, e.getMessage())); } ReloadLevel reloadLevel = MetricConfigDescriptor.getInstance().loadHotProps(commonProperties); LOGGER.info("Reload metric service in level {}", reloadLevel); From da41d83dc15eb058e248ea7ef0b83ad22dc819c4 Mon Sep 17 00:00:00 2001 From: shuwenwei Date: Fri, 17 May 2024 17:06:55 +0800 Subject: [PATCH 03/20] check old version config files exist --- .../apache/iotdb/tool/IoTDBDataBackTool.java | 20 +++++++++---------- .../conf/ConfigFileAutoUpdateTool.java | 8 +++++--- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/iotdb-client/cli/src/main/java/org/apache/iotdb/tool/IoTDBDataBackTool.java b/iotdb-client/cli/src/main/java/org/apache/iotdb/tool/IoTDBDataBackTool.java index 7d3315d1f67d..e5f76e1b7f9f 100644 --- a/iotdb-client/cli/src/main/java/org/apache/iotdb/tool/IoTDBDataBackTool.java +++ b/iotdb-client/cli/src/main/java/org/apache/iotdb/tool/IoTDBDataBackTool.java @@ -19,6 +19,7 @@ package org.apache.iotdb.tool; +import org.apache.iotdb.commons.conf.CommonConfig; import org.apache.iotdb.commons.conf.IoTDBConstant; import org.apache.iotdb.db.conf.IoTDBConfig; import org.apache.iotdb.db.conf.IoTDBDescriptor; @@ -162,10 +163,10 @@ public static void main(String[] args) { System.setProperty("IOTDB_HOME", System.getenv("IOTDB_HOME")); argsParse(args); File sourceDir = new File(sourcePath); - Properties dataProperties = getProperties(IoTDBConfig.CONFIG_NAME); - initDataNodeProperties(dataProperties); - Properties configProperties = getProperties(CONFIG_NODE_CONF_NAME); - initConfigNodeProperties(configProperties); + + Properties properties = getProperties(CommonConfig.SYSTEM_CONFIG_NAME); + initDataNodeProperties(properties); + initConfigNodeProperties(properties); StringBuilder targetDirString = new StringBuilder(); Map copyMap = new HashMap<>(); @@ -429,10 +430,9 @@ private static void ioTDBDataBack( private static void countNodeBack(String targetDirString, Map copyMap) { File sourceDir = new File(sourcePath); - Properties dataProperties = getProperties(IoTDBConfig.CONFIG_NAME); - initDataNodeProperties(dataProperties); - Properties configProperties = getProperties(CONFIG_NODE_CONF_NAME); - initConfigNodeProperties(configProperties); + Properties properties = getProperties(CommonConfig.SYSTEM_CONFIG_NAME); + initDataNodeProperties(properties); + initConfigNodeProperties(properties); copyMap.put( sourceDir.getAbsolutePath() + File.separatorChar + ".env", @@ -480,7 +480,7 @@ private static void countDataNodeFile( Map copyMap, Map dnDataDirsMap, Map dnMapProperties) { - Properties dataProperties = getProperties(IoTDBConfig.CONFIG_NAME); + Properties dataProperties = getProperties(CommonConfig.SYSTEM_CONFIG_NAME); initDataNodeProperties(dataProperties); String dnSystemDir = dataProperties.getProperty("dn_system_dir"); @@ -553,7 +553,7 @@ private static void countDataNodeFile( private static void countConfigNodeFile( String targetDirString, Map copyMap, Map cnMapProperties) { - Properties configProperties = getProperties(CONFIG_NODE_CONF_NAME); + Properties configProperties = getProperties(CommonConfig.SYSTEM_CONFIG_NAME); initConfigNodeProperties(configProperties); String bakCnSystemDir = targetDirString + File.separatorChar + DEFAULT_CN_SYSTEM_DIR; diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/ConfigFileAutoUpdateTool.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/ConfigFileAutoUpdateTool.java index ffd1038385e6..ee93362c457b 100644 --- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/ConfigFileAutoUpdateTool.java +++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/ConfigFileAutoUpdateTool.java @@ -58,10 +58,12 @@ public void checkAndMayUpdate(URL systemUrl, URL configNodeUrl, URL dataNodeUrl, File dataNodeFile = new File(dataNodeUrl.getFile()); File commonFile = new File(commonUrl.getFile()); + boolean canUpdate = configNodeFile.exists() && dataNodeFile.exists() && commonFile.exists(); + if (!canUpdate) { + return; + } + if (!systemFile.exists()) { - if (!configNodeFile.exists() || !dataNodeFile.exists() || !commonFile.exists()) { - return; - } systemFile.createNewFile(); } From 6b1e85dd3f2ea7bdfa98559291a2cb867c563d53 Mon Sep 17 00:00:00 2001 From: shuwenwei Date: Fri, 17 May 2024 18:20:22 +0800 Subject: [PATCH 04/20] modify docker --- docker/src/main/DockerCompose/entrypoint.sh | 2 +- .../DockerCompose/replace-conf-from-env.sh | 13 +---------- docker/src/main/Dockerfile-1c1d | 14 +++++------ .../manager/node/ClusterNodeStartUtils.java | 23 +++++-------------- 4 files changed, 15 insertions(+), 37 deletions(-) diff --git a/docker/src/main/DockerCompose/entrypoint.sh b/docker/src/main/DockerCompose/entrypoint.sh index 55be9899b003..72beea010eeb 100755 --- a/docker/src/main/DockerCompose/entrypoint.sh +++ b/docker/src/main/DockerCompose/entrypoint.sh @@ -36,7 +36,7 @@ function on_stop(){ trap 'on_stop' SIGTERM SIGKILL SIGQUIT -replace-conf-from-env.sh ${start_what} +replace-conf-from-env.sh case "$1" in datanode) diff --git a/docker/src/main/DockerCompose/replace-conf-from-env.sh b/docker/src/main/DockerCompose/replace-conf-from-env.sh index 93be28bc2425..887faf1bdcd6 100755 --- a/docker/src/main/DockerCompose/replace-conf-from-env.sh +++ b/docker/src/main/DockerCompose/replace-conf-from-env.sh @@ -19,6 +19,7 @@ # conf_path=${IOTDB_HOME}/conf +target_files="iotdb-system.properties" function process_single(){ local key_value="$1" @@ -48,17 +49,5 @@ function replace_configs(){ done } -case "$1" in - confignode) - target_files="iotdb-common.properties iotdb-confignode.properties" - ;; - datanode) - target_files="iotdb-common.properties iotdb-datanode.properties" - ;; - all) - target_files="iotdb-common.properties iotdb-confignode.properties iotdb-datanode.properties" - ;; -esac - replace_configs diff --git a/docker/src/main/Dockerfile-1c1d b/docker/src/main/Dockerfile-1c1d index 9aacd0aa0ca9..71548de08b78 100644 --- a/docker/src/main/Dockerfile-1c1d +++ b/docker/src/main/Dockerfile-1c1d @@ -30,13 +30,13 @@ RUN apt update \ && rm /apache-iotdb-*-bin.zip \ && mv /apache-iotdb-* /iotdb \ && mv /start-1c1d.sh /iotdb/sbin \ - && sed -i 's/dn_internal_address=127.0.0.1/dn_internal_address=0.0.0.0/g' /iotdb/conf/iotdb-datanode.properties \ - && sed -i 's/cn_internal_address=127.0.0.1/cn_internal_address=0.0.0.0/g' /iotdb/conf/iotdb-confignode.properties \ - && sed -i 's/cn_seed_config_node=127.0.0.1:10710/cn_seed_config_node=0.0.0.0:10710/g' /iotdb/conf/iotdb-confignode.properties \ - && sed -i 's/dn_seed_config_node=127.0.0.1:10710/dn_seed_config_node=0.0.0.0:10710/g' /iotdb/conf/iotdb-datanode.properties \ - && sed -i 's/# config_node_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus/config_node_consensus_protocol_class=org.apache.iotdb.consensus.simple.SimpleConsensus/g' /iotdb/conf/iotdb-common.properties \ - && sed -i 's/# schema_region_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus/schema_region_consensus_protocol_class=org.apache.iotdb.consensus.simple.SimpleConsensus/g' /iotdb/conf/iotdb-common.properties \ - && sed -i 's/# data_region_consensus_protocol_class=org.apache.iotdb.consensus.iot.IoTConsensus/data_region_consensus_protocol_class=org.apache.iotdb.consensus.simple.SimpleConsensus/g' /iotdb/conf/iotdb-common.properties \ + && sed -i 's/dn_internal_address=127.0.0.1/dn_internal_address=0.0.0.0/g' /iotdb/conf/iotdb-system.properties \ + && sed -i 's/cn_internal_address=127.0.0.1/cn_internal_address=0.0.0.0/g' /iotdb/conf/iotdb-system.properties \ + && sed -i 's/cn_seed_config_node=127.0.0.1:10710/cn_seed_config_node=0.0.0.0:10710/g' /iotdb/conf/iotdb-system.properties \ + && sed -i 's/dn_seed_config_node=127.0.0.1:10710/dn_seed_config_node=0.0.0.0:10710/g' /iotdb/conf/iotdb-system.properties \ + && sed -i 's/# config_node_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus/config_node_consensus_protocol_class=org.apache.iotdb.consensus.simple.SimpleConsensus/g' /iotdb/conf/iotdb-system.properties \ + && sed -i 's/# schema_region_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus/schema_region_consensus_protocol_class=org.apache.iotdb.consensus.simple.SimpleConsensus/g' /iotdb/conf/iotdb-system.properties \ + && sed -i 's/# data_region_consensus_protocol_class=org.apache.iotdb.consensus.iot.IoTConsensus/data_region_consensus_protocol_class=org.apache.iotdb.consensus.simple.SimpleConsensus/g' /iotdb/conf/iotdb-system.properties \ && apt remove unzip -y \ && apt autoremove -y \ && apt purge --auto-remove -y \ diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/node/ClusterNodeStartUtils.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/node/ClusterNodeStartUtils.java index 697dd65525d9..13cd42393fab 100644 --- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/node/ClusterNodeStartUtils.java +++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/node/ClusterNodeStartUtils.java @@ -25,8 +25,7 @@ import org.apache.iotdb.common.rpc.thrift.TEndPoint; import org.apache.iotdb.common.rpc.thrift.TSStatus; import org.apache.iotdb.commons.cluster.NodeType; -import org.apache.iotdb.commons.conf.IoTDBConstant; -import org.apache.iotdb.confignode.conf.ConfigNodeConstant; +import org.apache.iotdb.commons.conf.CommonConfig; import org.apache.iotdb.confignode.conf.ConfigNodeDescriptor; import org.apache.iotdb.confignode.manager.ConfigManager; import org.apache.iotdb.rpc.TSStatusCode; @@ -56,11 +55,6 @@ private ClusterNodeStartUtils() { public static TSStatus confirmNodeRegistration( NodeType nodeType, String clusterName, Object nodeLocation, ConfigManager configManager) { - - final String CONF_FILE_NAME = - NodeType.ConfigNode.equals(nodeType) - ? ConfigNodeConstant.CONF_FILE_NAME - : IoTDBConstant.DATA_NODE_CONF_FILE_NAME; TSStatus status = new TSStatus(); /* Reject start if the cluster name is error */ @@ -77,8 +71,8 @@ public static TSStatus confirmNodeRegistration( nodeType.getNodeType(), clusterName, CLUSTER_NAME, - CONF_FILE_NAME, - CONF_FILE_NAME)); + CommonConfig.SYSTEM_CONFIG_NAME, + CommonConfig.SYSTEM_CONFIG_NAME)); return status; } @@ -116,7 +110,7 @@ public static TSStatus confirmNodeRegistration( nodeType.getNodeType(), conflictEndPoints, nodeType.getNodeType(), - CONF_FILE_NAME)); + CommonConfig.SYSTEM_CONFIG_NAME)); return status; } else { /* Accept registration if all TEndPoints aren't conflict */ @@ -130,11 +124,6 @@ public static TSStatus confirmNodeRestart( int nodeId, Object nodeLocation, ConfigManager configManager) { - - final String CONF_FILE_NAME = - NodeType.ConfigNode.equals(nodeType) - ? ConfigNodeConstant.CONF_FILE_NAME - : IoTDBConstant.DATA_NODE_CONF_FILE_NAME; TSStatus status = new TSStatus(); /* Reject restart if the cluster name is error */ @@ -151,8 +140,8 @@ public static TSStatus confirmNodeRestart( nodeType.getNodeType(), clusterName, CLUSTER_NAME, - CONF_FILE_NAME, - CONF_FILE_NAME)); + CommonConfig.SYSTEM_CONFIG_NAME, + CommonConfig.SYSTEM_CONFIG_NAME)); return status; } From 0a2b4b9892a952f9a14b3331cbf07fd5f46942bc Mon Sep 17 00:00:00 2001 From: shuwenwei Date: Mon, 20 May 2024 15:32:20 +0800 Subject: [PATCH 05/20] modify scripts --- .../apache/iotdb/tool/IoTDBDataBackTool.java | 19 ++--- .../resources/sbin/start-confignode.bat | 30 ++++---- .../resources/sbin/stop-confignode.bat | 10 ++- .../resources/sbin/stop-confignode.sh | 8 +- .../confignode/conf/ConfigNodeConstant.java | 1 - .../confignode/conf/ConfigNodeDescriptor.java | 6 +- .../iotdb/confignode/service/ConfigNode.java | 3 +- .../resources/sbin/start-datanode.bat | 48 +++++------- .../assembly/resources/sbin/stop-datanode.bat | 10 ++- .../assembly/resources/sbin/stop-datanode.sh | 7 +- .../apache/iotdb/db/conf/IoTDBDescriptor.java | 6 +- .../db/conf/rest/IoTDBRestServiceConfig.java | 2 - .../schemaregion/tag/TagLogFile.java | 2 +- .../resources/sbin/destroy-confignode.bat | 6 +- .../resources/sbin/destroy-confignode.sh | 7 +- .../resources/sbin/destroy-datanode.bat | 6 +- .../resources/sbin/destroy-datanode.sh | 8 +- .../assembly/resources/sbin/health_check.bat | 76 +++++++++---------- .../assembly/resources/sbin/health_check.sh | 7 +- .../assembly/resources/sbin/iotdb-common.sh | 26 ++++++- .../iotdb/commons/conf/CommonConfig.java | 6 +- 21 files changed, 172 insertions(+), 122 deletions(-) diff --git a/iotdb-client/cli/src/main/java/org/apache/iotdb/tool/IoTDBDataBackTool.java b/iotdb-client/cli/src/main/java/org/apache/iotdb/tool/IoTDBDataBackTool.java index e5f76e1b7f9f..44530aa9cc97 100644 --- a/iotdb-client/cli/src/main/java/org/apache/iotdb/tool/IoTDBDataBackTool.java +++ b/iotdb-client/cli/src/main/java/org/apache/iotdb/tool/IoTDBDataBackTool.java @@ -21,7 +21,6 @@ import org.apache.iotdb.commons.conf.CommonConfig; import org.apache.iotdb.commons.conf.IoTDBConstant; -import org.apache.iotdb.db.conf.IoTDBConfig; import org.apache.iotdb.db.conf.IoTDBDescriptor; import org.slf4j.Logger; @@ -62,8 +61,6 @@ public class IoTDBDataBackTool { static String targetDataDirParam = ""; static String targetWalDirParam = ""; - static String DATA_NODE_CONF_NAME = IoTDBConfig.CONFIG_NAME; - static String CONFIG_NODE_CONF_NAME = "iotdb-confignode.properties"; static AtomicInteger fileCount = new AtomicInteger(0); static AtomicInteger targetFileCount = new AtomicInteger(0); static AtomicInteger processFileCount = new AtomicInteger(0); @@ -201,7 +198,7 @@ public static void main(String[] args) { + File.separatorChar + "conf" + File.separatorChar - + CONFIG_NODE_CONF_NAME, + + CommonConfig.SYSTEM_CONFIG_NAME, cnMapProperties); } else if (nodeTypeParam.equalsIgnoreCase("datanode")) { countDataNodeFile(targetDirString.toString(), copyMap, dnDataDirsMap, dnMapProperties); @@ -223,7 +220,7 @@ public static void main(String[] args) { + File.separatorChar + "conf" + File.separatorChar - + DATA_NODE_CONF_NAME, + + CommonConfig.SYSTEM_CONFIG_NAME, dnMapProperties); } else if (nodeTypeParam.equalsIgnoreCase("all") || nodeTypeParam.isEmpty()) { countConfigNodeFile(targetDirString.toString(), copyMap, cnMapProperties); @@ -246,14 +243,14 @@ public static void main(String[] args) { + File.separatorChar + "conf" + File.separatorChar - + CONFIG_NODE_CONF_NAME, + + CommonConfig.SYSTEM_CONFIG_NAME, cnMapProperties); propertiesFileUpdate( targetDirString.toString() + File.separatorChar + "conf" + File.separatorChar - + DATA_NODE_CONF_NAME, + + CommonConfig.SYSTEM_CONFIG_NAME, dnMapProperties); } @@ -279,7 +276,7 @@ public static void main(String[] args) { + File.separatorChar + "conf" + File.separatorChar - + CONFIG_NODE_CONF_NAME, + + CommonConfig.SYSTEM_CONFIG_NAME, cnMapProperties); } else if (nodeTypeParam.equalsIgnoreCase("datanode")) { countNodeBack(targetDirString.toString(), copyMap); @@ -299,7 +296,7 @@ public static void main(String[] args) { + File.separatorChar + "conf" + File.separatorChar - + DATA_NODE_CONF_NAME, + + CommonConfig.SYSTEM_CONFIG_NAME, dnMapProperties); } else if (nodeTypeParam.equalsIgnoreCase("all") || nodeTypeParam.isEmpty()) { countNodeBack(targetDirString.toString(), copyMap); @@ -321,14 +318,14 @@ public static void main(String[] args) { + File.separatorChar + "conf" + File.separatorChar - + CONFIG_NODE_CONF_NAME, + + CommonConfig.SYSTEM_CONFIG_NAME, cnMapProperties); propertiesFileUpdate( targetDirString.toString() + File.separatorChar + "conf" + File.separatorChar - + DATA_NODE_CONF_NAME, + + CommonConfig.SYSTEM_CONFIG_NAME, dnMapProperties); } } diff --git a/iotdb-core/confignode/src/assembly/resources/sbin/start-confignode.bat b/iotdb-core/confignode/src/assembly/resources/sbin/start-confignode.bat index 532c79933051..f73f13d21c00 100644 --- a/iotdb-core/confignode/src/assembly/resources/sbin/start-confignode.bat +++ b/iotdb-core/confignode/src/assembly/resources/sbin/start-confignode.bat @@ -83,26 +83,30 @@ IF EXIST "%CONFIGNODE_CONF%\confignode-env.bat" ( ) @REM CHECK THE PORT USAGES -IF EXIST "%CONFIGNODE_CONF%\iotdb-confignode.properties" ( +@REM SET CONFIG FILE +IF EXIST "%IOTDB_CONF%\iotdb-system.properties" ( + set CONFIG_FILE="%IOTDB_CONF%\iotdb-system.properties" +) ELSE IF EXIST "%IOTDB_HOME%\conf\iotdb-system.properties" ( + set CONFIG_FILE="%IOTDB_HOME%\conf\iotdb-system.properties" +) ELSE IF EXIST "%IOTDB_CONF%\iotdb-confignode.properties" ( + set CONFIG_FILE="%IOTDB_CONF%\iotdb-confignode.properties" +) ELSE IF EXIST "%IOTDB_HOME%\conf\iotdb-confignode.properties" ( + set CONFIG_FILE="%IOTDB_HOME%\conf\iotdb-confignode.properties" +) ELSE ( + set CONFIG_FILE= +) + +IF DEFINED CONFIG_FILE ( for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^cn_internal_port" - "%CONFIGNODE_CONF%\iotdb-confignode.properties"') do ( + "%CONFIG_FILE%"') do ( set cn_internal_port=%%i ) for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^cn_consensus_port" - "%CONFIGNODE_CONF%\iotdb-confignode.properties"') do ( + "%CONFIG_FILE%"') do ( set cn_consensus_port=%%i ) -) ELSE IF EXIST "%CONFIGNODE_HOME%\conf\iotdb-confignode.properties" ( - for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^cn_internal_port" - "%CONFIGNODE_HOME%\conf\iotdb-confignode.properties"') do ( - set cn_internal_port=%%i - ) - for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^cn_consensus_port" - "%CONFIGNODE_HOME%\conf\iotdb-confignode.properties"') do ( - set cn_consensus_port=%%i - ) ) ELSE ( - echo "Can't find iotdb-confignode.properties, check the default ports" + echo "Can't find iotdb-system.properties or iotdb-confignode.properties, check the default ports" set cn_internal_port=10710 set cn_consensus_port=10720 ) diff --git a/iotdb-core/confignode/src/assembly/resources/sbin/stop-confignode.bat b/iotdb-core/confignode/src/assembly/resources/sbin/stop-confignode.bat index c82a095ec1fa..f7db1e156d36 100644 --- a/iotdb-core/confignode/src/assembly/resources/sbin/stop-confignode.bat +++ b/iotdb-core/confignode/src/assembly/resources/sbin/stop-confignode.bat @@ -22,15 +22,21 @@ set current_dir=%~dp0 set superior_dir=%current_dir%\..\ +IF EXIST "%superior%\conf\iotdb-system.properties" ( + set config_file="%superior_dir%\iotdb-system.properties" +) ELSE ( + set config_file="%superior_dir%\iotdb-confignode.properties" +) + for /f "eol=; tokens=2,2 delims==" %%i in ('findstr /i "^cn_internal_port" -"%superior_dir%\conf\iotdb-confignode.properties"') do ( +"%config_file%"') do ( set cn_internal_port=%%i ) echo "check whether the cn_internal_port is used..., port is %cn_internal_port%" for /f "eol=; tokens=2,2 delims==" %%i in ('findstr /i "cn_internal_address" -"%superior_dir%\conf\iotdb-confignode.properties"') do ( +"%config_file%"') do ( set cn_internal_address=%%i ) diff --git a/iotdb-core/confignode/src/assembly/resources/sbin/stop-confignode.sh b/iotdb-core/confignode/src/assembly/resources/sbin/stop-confignode.sh index c9467faec55f..b44d35fb03f8 100644 --- a/iotdb-core/confignode/src/assembly/resources/sbin/stop-confignode.sh +++ b/iotdb-core/confignode/src/assembly/resources/sbin/stop-confignode.sh @@ -19,7 +19,13 @@ # CONFIGNODE_CONF="$(dirname "$0")/../conf" -cn_internal_port=$(sed '/^cn_internal_port=/!d;s/.*=//' "${CONFIGNODE_CONF}"/iotdb-confignode.properties) + +if [ -f "${CONFIG_DIR}/iotdb-system.properties" ]; then + cn_internal_port=$(sed '/^cn_internal_port=/!d;s/.*=//' "${CONFIGNODE_CONF}"/iotdb-system.properties) +else + cn_internal_port=$(sed '/^cn_internal_port=/!d;s/.*=//' "${CONFIGNODE_CONF}"/iotdb-confignode.properties) +fi + echo Check whether the internal_port is used..., port is "$cn_internal_port" diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeConstant.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeConstant.java index ca521e3a73c9..5724eb1862fe 100644 --- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeConstant.java +++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeConstant.java @@ -25,7 +25,6 @@ public class ConfigNodeConstant { public static final String CONFIGNODE_CONF = "CONFIGNODE_CONF"; public static final String CONFIGNODE_HOME = "CONFIGNODE_HOME"; - public static final String CONF_FILE_NAME = "iotdb-confignode.properties"; public static final String SYSTEM_FILE_NAME = "confignode-system.properties"; public static final String CONFIGNODE_PACKAGE = "org.apache.iotdb.confignode.service"; diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeDescriptor.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeDescriptor.java index cea89efb02bb..db777cfa26d7 100644 --- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeDescriptor.java +++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeDescriptor.java @@ -57,9 +57,9 @@ public class ConfigNodeDescriptor { static { ConfigFileAutoUpdateTool updateTool = new ConfigFileAutoUpdateTool(); URL systemConfigUrl = getPropsUrl(CommonConfig.SYSTEM_CONFIG_NAME); - URL configNodeUrl = getPropsUrl(CommonConfig.CONFIG_NODE_CONFIG_NAME); - URL dataNodeUrl = getPropsUrl(CommonConfig.DATA_NODE_CONFIG_NAME); - URL commonConfigUrl = getPropsUrl(CommonConfig.COMMON_CONFIG_NAME); + URL configNodeUrl = getPropsUrl(CommonConfig.OLD_CONFIG_NODE_CONFIG_NAME); + URL dataNodeUrl = getPropsUrl(CommonConfig.OLD_DATA_NODE_CONFIG_NAME); + URL commonConfigUrl = getPropsUrl(CommonConfig.OLD_COMMON_CONFIG_NAME); try { updateTool.checkAndMayUpdate(systemConfigUrl, configNodeUrl, dataNodeUrl, commonConfigUrl); } catch (Exception e) { diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java index b92918f58a5b..3ee8af7ec77c 100644 --- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java +++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java @@ -323,8 +323,7 @@ private void sendRegisterConfigNodeRequest() throws StartupException, IOExceptio TEndPoint seedConfigNode = CONF.getSeedConfigNode(); if (seedConfigNode == null) { - LOGGER.error( - "Please set the cn_seed_config_node parameter in iotdb-confignode.properties file."); + LOGGER.error("Please set the cn_seed_config_node parameter in iotdb-system.properties file."); throw new StartupException("The seedConfigNode setting in conf is empty"); } diff --git a/iotdb-core/datanode/src/assembly/resources/sbin/start-datanode.bat b/iotdb-core/datanode/src/assembly/resources/sbin/start-datanode.bat index 569374a89d26..c6fd64e8fb34 100755 --- a/iotdb-core/datanode/src/assembly/resources/sbin/start-datanode.bat +++ b/iotdb-core/datanode/src/assembly/resources/sbin/start-datanode.bat @@ -102,51 +102,43 @@ IF EXIST "%IOTDB_CONF%\datanode-env.bat" ( echo "Can't find datanode-env.bat" ) +@REM SET CONFIG FILE +IF EXIST "%IOTDB_CONF%\iotdb-system.properties" ( + set CONFIG_FILE="%IOTDB_CONF%\iotdb-system.properties" +) ELSE IF EXIST "%IOTDB_HOME%\conf\iotdb-system.properties" ( + set CONFIG_FILE="%IOTDB_HOME%\conf\iotdb-system.properties" +) ELSE IF EXIST "%IOTDB_CONF%\iotdb-datanode.properties" ( + set CONFIG_FILE="%IOTDB_CONF%\iotdb-datanode.properties" +) ELSE IF EXIST "%IOTDB_HOME%\conf\iotdb-datanode.properties" ( + set CONFIG_FILE="%IOTDB_HOME%\conf\iotdb-datanode.properties" +) ELSE ( + set CONFIG_FILE= +) + @REM CHECK THE PORT USAGES -IF EXIST "%IOTDB_CONF%\iotdb-datanode.properties" ( +IF DEFINED CONFIG_FILE ( for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^dn_rpc_port" - "%IOTDB_CONF%\iotdb-datanode.properties"') do ( + "%CONFIG_FILE%"') do ( set dn_rpc_port=%%i ) for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^dn_internal_port" - "%IOTDB_CONF%\iotdb-datanode.properties"') do ( + "%CONFIG_FILE%"') do ( set dn_internal_port=%%i ) for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^dn_mpp_data_exchange_port" - "%IOTDB_CONF%\iotdb-datanode.properties"') do ( - set dn_mpp_data_exchange_port=%%i - ) - for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^dn_schema_region_consensus_port" - "%IOTDB_CONF%\iotdb-datanode.properties"') do ( - set dn_schema_region_consensus_port=%%i - ) - for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^dn_data_region_consensus_port" - "%IOTDB_CONF%\iotdb-datanode.properties"') do ( - set dn_data_region_consensus_port=%%i - ) -) ELSE IF EXIST "%IOTDB_HOME%\conf\iotdb-datanode.properties" ( - for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^dn_rpc_port" - "%IOTDB_HOME%\conf\iotdb-datanode.properties"') do ( - set dn_rpc_port=%%i - ) - for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^dn_internal_port" - "%IOTDB_HOME%\conf\iotdb-datanode.properties"') do ( - set dn_internal_port=%%i - ) - for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^dn_mpp_data_exchange_port" - "%IOTDB_HOME%\conf\iotdb-datanode.properties"') do ( + "%CONFIG_FILE%"') do ( set dn_mpp_data_exchange_port=%%i ) for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^dn_schema_region_consensus_port" - "%IOTDB_HOME%\conf\iotdb-datanode.properties"') do ( + "%CONFIG_FILE%"') do ( set dn_schema_region_consensus_port=%%i ) for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^dn_data_region_consensus_port" - "%IOTDB_HOME%\conf\iotdb-datanode.properties"') do ( + "%CONFIG_FILE%"') do ( set dn_data_region_consensus_port=%%i ) ) ELSE ( - echo "Can't find iotdb-datanode.properties, check the default ports" + echo "Can't find iotdb-system.properties or iotdb-datanode.properties, check the default ports" set dn_rpc_port=6667 set dn_internal_port=10730 set dn_mpp_data_exchange_port=10740 diff --git a/iotdb-core/datanode/src/assembly/resources/sbin/stop-datanode.bat b/iotdb-core/datanode/src/assembly/resources/sbin/stop-datanode.bat index 2197251570e5..27d09f156b1d 100644 --- a/iotdb-core/datanode/src/assembly/resources/sbin/stop-datanode.bat +++ b/iotdb-core/datanode/src/assembly/resources/sbin/stop-datanode.bat @@ -22,15 +22,21 @@ set current_dir=%~dp0 set superior_dir=%current_dir%\..\ +IF EXIST "%superior%\conf\iotdb-system.properties" ( + set config_file="%superior_dir%\iotdb-system.properties" +) ELSE ( + set config_file="%superior_dir%\iotdb-datanode.properties" +) + for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^dn_rpc_port" -"%superior_dir%\conf\iotdb-datanode.properties"') do ( +"%config_file%"') do ( set dn_rpc_port=%%i ) echo Check whether the rpc_port is used..., port is %dn_rpc_port% for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "dn_rpc_address" -"%superior_dir%\conf\iotdb-datanode.properties"') do ( +"%config_file%"') do ( set dn_rpc_address=%%i ) diff --git a/iotdb-core/datanode/src/assembly/resources/sbin/stop-datanode.sh b/iotdb-core/datanode/src/assembly/resources/sbin/stop-datanode.sh index cb253f1a1edf..92d18ebd668b 100644 --- a/iotdb-core/datanode/src/assembly/resources/sbin/stop-datanode.sh +++ b/iotdb-core/datanode/src/assembly/resources/sbin/stop-datanode.sh @@ -19,7 +19,12 @@ # DATANODE_CONF="`dirname "$0"`/../conf" -dn_rpc_port=`sed '/^dn_rpc_port=/!d;s/.*=//' ${DATANODE_CONF}/iotdb-datanode.properties` + +if [ -f "${CONFIG_DIR}/iotdb-system.properties" ]; then + dn_rpc_port=`sed '/^dn_rpc_port=/!d;s/.*=//' ${DATANODE_CONF}/iotdb-system.properties` +else + dn_rpc_port=`sed '/^dn_rpc_port=/!d;s/.*=//' ${DATANODE_CONF}/iotdb-datanode.properties` +fi force="" diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java index 309825006a91..1ad67a99da5e 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java @@ -103,9 +103,9 @@ public class IoTDBDescriptor { static { ConfigFileAutoUpdateTool updateTool = new ConfigFileAutoUpdateTool(); URL systemConfigUrl = getPropsUrl(CommonConfig.SYSTEM_CONFIG_NAME); - URL configNodeUrl = getPropsUrl(CommonConfig.CONFIG_NODE_CONFIG_NAME); - URL dataNodeUrl = getPropsUrl(CommonConfig.DATA_NODE_CONFIG_NAME); - URL commonConfigUrl = getPropsUrl(CommonConfig.COMMON_CONFIG_NAME); + URL configNodeUrl = getPropsUrl(CommonConfig.OLD_CONFIG_NODE_CONFIG_NAME); + URL dataNodeUrl = getPropsUrl(CommonConfig.OLD_DATA_NODE_CONFIG_NAME); + URL commonConfigUrl = getPropsUrl(CommonConfig.OLD_COMMON_CONFIG_NAME); try { updateTool.checkAndMayUpdate(systemConfigUrl, configNodeUrl, dataNodeUrl, commonConfigUrl); } catch (Exception e) { diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/rest/IoTDBRestServiceConfig.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/rest/IoTDBRestServiceConfig.java index 50c698079ff1..64c0f65fe303 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/rest/IoTDBRestServiceConfig.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/rest/IoTDBRestServiceConfig.java @@ -20,8 +20,6 @@ package org.apache.iotdb.db.conf.rest; public class IoTDBRestServiceConfig { - static final String CONFIG_NAME = "iotdb-datanode.properties"; - static final String OLD_CONFIG_NAME = "iotdb-common.properties"; /** If the enableRestService is true, we will start REST Service. */ private boolean enableRestService = false; diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/tag/TagLogFile.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/tag/TagLogFile.java index 7a9a16aa20db..9cf9d51cf211 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/tag/TagLogFile.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/tag/TagLogFile.java @@ -49,7 +49,7 @@ public class TagLogFile implements AutoCloseable { private FileChannel fileChannel; private static final String LENGTH_EXCEED_MSG = "Tag/Attribute exceeds the max length limit. " - + "Please enlarge tag_attribute_total_size in iotdb-common.properties"; + + "Please enlarge tag_attribute_total_size in iotdb-system.properties"; private static final int MAX_LENGTH = CommonDescriptor.getInstance().getConfig().getTagAttributeTotalSize(); diff --git a/iotdb-core/node-commons/src/assembly/resources/sbin/destroy-confignode.bat b/iotdb-core/node-commons/src/assembly/resources/sbin/destroy-confignode.bat index 36691cff4095..0fd3bd5d9947 100644 --- a/iotdb-core/node-commons/src/assembly/resources/sbin/destroy-confignode.bat +++ b/iotdb-core/node-commons/src/assembly/resources/sbin/destroy-confignode.bat @@ -35,7 +35,11 @@ if not "%CLEAN_SERVICE%"=="y" if not "%CLEAN_SERVICE%"=="Y" ( start cmd /c "%IOTDB_HOME%\\sbin\\stop-confignode.bat -f" timeout /t 3 > nul rmdir /s /q "%IOTDB_HOME%\data\confignode\" 2>nul -set IOTDB_CONFIGNODE_CONFIG="%IOTDB_HOME%\conf\iotdb-confignode.properties" +if exist "%IOTDB_HOME%\conf\iotdb-system.properties" ( + set IOTDB_CONFIGNODE_CONFIG="%IOTDB_HOME%\conf\iotdb-system.properties" +) ELSE ( + set IOTDB_CONFIGNODE_CONFIG="%IOTDB_HOME%\conf\iotdb-confignode.properties" +) set "delimiter=,;" for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^cn_system_dir" %IOTDB_CONFIGNODE_CONFIG%') do ( diff --git a/iotdb-core/node-commons/src/assembly/resources/sbin/destroy-confignode.sh b/iotdb-core/node-commons/src/assembly/resources/sbin/destroy-confignode.sh index 88a5e3488308..fee896993620 100644 --- a/iotdb-core/node-commons/src/assembly/resources/sbin/destroy-confignode.sh +++ b/iotdb-core/node-commons/src/assembly/resources/sbin/destroy-confignode.sh @@ -33,7 +33,12 @@ fi nohup bash ${IOTDB_HOME}/sbin/stop-confignode.sh -f >/dev/null 2>&1 & rm -rf ${IOTDB_HOME}/data/confignode/ >/dev/null 2>&1 & -IOTDB_CONFIGNODE_CONFIG=${IOTDB_HOME}/conf/iotdb-confignode.properties +if [ -f "${IOTDB_HOME}/conf/iotdb-system.properties" ]; then + IOTDB_CONFIGNODE_CONFIG="${IOTDB_HOME}/conf/iotdb-system.properties" +else + IOTDB_CONFIGNODE_CONFIG="${IOTDB_HOME}/conf/iotdb-confignode.properties" +fi + cn_system_dir=$(echo $(grep '^cn_system_dir=' ${IOTDB_CONFIGNODE_CONFIG} || echo "data/confignode/system") | sed 's/.*=//') cn_consensus_dir=$(echo $(grep '^cn_consensus_dir=' ${IOTDB_CONFIGNODE_CONFIG} || echo "data/confignode/consensus") | sed 's/.*=//') diff --git a/iotdb-core/node-commons/src/assembly/resources/sbin/destroy-datanode.bat b/iotdb-core/node-commons/src/assembly/resources/sbin/destroy-datanode.bat index 1ccf0346f504..26aab580e851 100644 --- a/iotdb-core/node-commons/src/assembly/resources/sbin/destroy-datanode.bat +++ b/iotdb-core/node-commons/src/assembly/resources/sbin/destroy-datanode.bat @@ -34,7 +34,11 @@ if not "%CLEAN_SERVICE%"=="y" if not "%CLEAN_SERVICE%"=="Y" ( start cmd /c "%IOTDB_HOME%\\sbin\\stop-datanode.bat -f" timeout /t 3 > nul rmdir /s /q "%IOTDB_HOME%\data\datanode\" 2>nul -set IOTDB_DATANODE_CONFIG="%IOTDB_HOME%\conf\iotdb-datanode.properties" +if exist "%IOTDB_HOME%\conf\iotdb-system.properties" ( + set IOTDB_DATANODE_CONFIG="%IOTDB_HOME%\conf\iotdb-system.properties" +) ELSE ( + set IOTDB_DATANODE_CONFIG="%IOTDB_HOME%\conf\iotdb-datanode.properties" +) set "delimiter=,;" for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^dn_system_dir" %IOTDB_DATANODE_CONFIG%') do ( diff --git a/iotdb-core/node-commons/src/assembly/resources/sbin/destroy-datanode.sh b/iotdb-core/node-commons/src/assembly/resources/sbin/destroy-datanode.sh index 98e287ef4e6f..9a1580a2a9e6 100644 --- a/iotdb-core/node-commons/src/assembly/resources/sbin/destroy-datanode.sh +++ b/iotdb-core/node-commons/src/assembly/resources/sbin/destroy-datanode.sh @@ -32,7 +32,13 @@ fi nohup bash ${IOTDB_HOME}/sbin/stop-datanode.sh -f >/dev/null 2>&1 & rm -rf ${IOTDB_HOME}/data/datanode/ >/dev/null 2>&1 & -IOTDB_DATANODE_CONFIG=${IOTDB_HOME}/conf/iotdb-datanode.properties + +if [ -f "${IOTDB_HOME}/conf/iotdb-system.properties" ]; then + IOTDB_DATANODE_CONFIG="${IOTDB_HOME}/conf/iotdb-system.properties" +else + IOTDB_DATANODE_CONFIG="${IOTDB_HOME}/conf/iotdb-datanode.properties" +fi + dn_system_dir=$(echo $(grep '^dn_system_dir=' ${IOTDB_DATANODE_CONFIG} || echo "data/datanode/system") | sed 's/.*=//') dn_data_dirs=$(echo $(grep '^dn_data_dirs=' ${IOTDB_DATANODE_CONFIG} || echo "data/datanode/data") | sed 's/.*=//') dn_consensus_dir=$(echo $(grep '^dn_consensus_dir=' ${IOTDB_DATANODE_CONFIG} || echo "data/datanode/consensus") | sed 's/.*=//') diff --git a/iotdb-core/node-commons/src/assembly/resources/sbin/health_check.bat b/iotdb-core/node-commons/src/assembly/resources/sbin/health_check.bat index f3df96a54b19..b9c4a099ad2c 100644 --- a/iotdb-core/node-commons/src/assembly/resources/sbin/health_check.bat +++ b/iotdb-core/node-commons/src/assembly/resources/sbin/health_check.bat @@ -234,7 +234,11 @@ exit /b :local_dirs_check setlocal enabledelayedexpansion -set "properties_file=%IOTDB_HOME%\conf\iotdb-datanode.properties" +if exist "%IOTDB_HOME%\conf\iotdb-system.properties" ( + set "properties_file=%IOTDB_HOME%\conf\iotdb-system.properties" +) ELSE ( + set "properties_file=%IOTDB_HOME%\conf\iotdb-datanode.properties" +) for /f "usebackq tokens=1,* delims==" %%a in ("%properties_file%") do ( if "%%a"=="dn_data_dirs" ( set "dn_data_dirs=%%b" @@ -352,46 +356,36 @@ if defined operation_dirs ( exit /b :local_ports_check -IF EXIST "%IOTDB_CONF%\iotdb-datanode.properties" ( +IF EXIST "%IOTDB_CONF%\iotdb-system.properties" ( + set DATANODE_CONFIG_FILE_PATH="%IOTDB_CONF%\iotdb-system.properties" +) ELSE IF EXIST "%IOTDB_HOME%\conf\iotdb-system.properties" ( + set DATANODE_CONFIG_FILE_PATH="%IOTDB_HOME%\conf\iotdb-system.properties" +) ELSE IF EXIST "%IOTDB_CONF%\iotdb-system.properties" ( + set DATANODE_CONFIG_FILE_PATH="%IOTDB_CONF%\iotdb-datanode.properties" +) ELSE IF EXIST "%IOTDB_HOME%\conf\iotdb-datanode.properties" ( + set DATANODE_CONFIG_FILE_PATH="%IOTDB_HOME%\conf\iotdb-datanode.properties" +) ELSE ( + set DATANODE_CONFIG_FILE_PATH= +) +IF DEFINED DATANODE_CONFIG_FILE_PATH ( for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^dn_rpc_port" - %IOTDB_CONF%\iotdb-datanode.properties') do ( + %DATANODE_CONFIG_FILE_PATH%') do ( set dn_rpc_port=%%i ) for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^dn_internal_port" - %IOTDB_CONF%\iotdb-datanode.properties') do ( + %DATANODE_CONFIG_FILE_PATH%') do ( set dn_internal_port=%%i ) for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^dn_mpp_data_exchange_port" - %IOTDB_CONF%\iotdb-datanode.properties') do ( + %DATANODE_CONFIG_FILE_PATH%') do ( set dn_mpp_data_exchange_port=%%i ) for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^dn_schema_region_consensus_port" - %IOTDB_CONF%\iotdb-datanode.properties') do ( + %DATANODE_CONFIG_FILE_PATH%') do ( set dn_schema_region_consensus_port=%%i ) for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^dn_data_region_consensus_port" - %IOTDB_CONF%\iotdb-datanode.properties') do ( - set dn_data_region_consensus_port=%%i - ) -) ELSE IF EXIST "%IOTDB_HOME%\conf\iotdb-datanode.properties" ( - for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^dn_rpc_port" - %IOTDB_HOME%\conf\iotdb-datanode.properties') do ( - set dn_rpc_port=%%i - ) - for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^dn_internal_port" - %IOTDB_HOME%\conf\iotdb-datanode.properties') do ( - set dn_internal_port=%%i - ) - for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^dn_mpp_data_exchange_port" - %IOTDB_HOME%\conf\iotdb-datanode.properties') do ( - set dn_mpp_data_exchange_port=%%i - ) - for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^dn_schema_region_consensus_port" - %IOTDB_HOME%\conf\iotdb-datanode.properties') do ( - set dn_schema_region_consensus_port=%%i - ) - for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^dn_data_region_consensus_port" - %IOTDB_HOME%\conf\iotdb-datanode.properties') do ( + %DATANODE_CONFIG_FILE_PATH%') do ( set dn_data_region_consensus_port=%%i ) ) ELSE ( @@ -402,24 +396,26 @@ IF EXIST "%IOTDB_CONF%\iotdb-datanode.properties" ( set dn_data_region_consensus_port=10760 ) -IF EXIST "%IOTDB_CONF%\iotdb-confignode.properties" ( +IF EXIST "%IOTDB_CONF%\iotdb-system.properties" ( + set CONFIGNODE_CONFIG_FILE_PATH="%IOTDB_CONF%\iotdb-system.properties" +) ELSE IF EXIST "%IOTDB_HOME%\conf\iotdb-system.properties" ( + set CONFIGNODE_CONFIG_FILE_PATH="%IOTDB_HOME%\conf\iotdb-system.properties" +) ELSE IF EXIST "%IOTDB_CONF%\iotdb-system.properties" ( + set CONFIGNODE_CONFIG_FILE_PATH="%IOTDB_CONF%\iotdb-confignode.properties" +) ELSE IF EXIST "%IOTDB_HOME%\conf\iotdb-confignode.properties" ( + set CONFIGNODE_CONFIG_FILE_PATH="%IOTDB_HOME%\conf\iotdb-confignode.properties" +) ELSE ( + set CONFIGNODE_CONFIG_FILE_PATH= +) +IF DEFINED CONFIGNODE_CONFIG_FILE_PATH ( for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^cn_internal_port" - %IOTDB_CONF%\iotdb-confignode.properties') do ( + %CONFIGNODE_CONFIG_FILE_PATH%') do ( set cn_internal_port=%%i ) for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^cn_consensus_port" - %IOTDB_CONF%\iotdb-confignode.properties') do ( + %CONFIGNODE_CONFIG_FILE_PATH%') do ( set cn_consensus_port=%%i ) -) ELSE IF EXIST "%IOTDB_HOME%\conf\iotdb-confignode.properties" ( - for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^cn_internal_port" - %IOTDB_HOME%\conf\iotdb-confignode.properties') do ( - set cn_internal_port=%%i - ) - for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^cn_consensus_port" - %IOTDB_HOME%\conf\iotdb-confignode.properties') do ( - set cn_consensus_port=%%i - ) ) ELSE ( set cn_internal_port=10710 set cn_consensus_port=10720 diff --git a/iotdb-core/node-commons/src/assembly/resources/sbin/health_check.sh b/iotdb-core/node-commons/src/assembly/resources/sbin/health_check.sh index 19739024ab1b..5ec862a61fc8 100644 --- a/iotdb-core/node-commons/src/assembly/resources/sbin/health_check.sh +++ b/iotdb-core/node-commons/src/assembly/resources/sbin/health_check.sh @@ -170,7 +170,12 @@ get_properties_value() { local file_name=$1 local property_name=$2 local default_value=$3 - local property_value=$(sed "/^${property_name}=/!d;s/.*=//" "${IOTDB_HOME}/conf/${file_name}.properties") + if [ -f "${IOTDB_HOME}/conf/iotdb-system.properties" ]; then + local file_path="${IOTDB_HOME}/conf/iotdb-system.properties" + else + local file_path="${IOTDB_HOME}/conf/${file_name}.properties" + fi + local property_value=$(sed "/^${property_name}=/!d;s/.*=//" "${file_path}") if [ -z "$property_value" ]; then property_value="$default_value" fi diff --git a/iotdb-core/node-commons/src/assembly/resources/sbin/iotdb-common.sh b/iotdb-core/node-commons/src/assembly/resources/sbin/iotdb-common.sh index 7539ec883489..753d1bccb051 100755 --- a/iotdb-core/node-commons/src/assembly/resources/sbin/iotdb-common.sh +++ b/iotdb-core/node-commons/src/assembly/resources/sbin/iotdb-common.sh @@ -156,7 +156,19 @@ checkDataNodePortUsages () { echo "Warning: If you do not use sudo, the checking may not detect all the occupied ports." fi occupied=false - if [ -f "$IOTDB_CONF/iotdb-datanode.properties" ]; then + if [ -f "$IOTDB_CONF/iotdb-system.properties" ]; then + dn_rpc_port=$(sed '/^dn_rpc_port=/!d;s/.*=//' "${IOTDB_CONF}"/iotdb-system.properties) + dn_internal_port=$(sed '/^dn_internal_port=/!d;s/.*=//' "${IOTDB_CONF}"/iotdb-system.properties) + dn_mpp_data_exchange_port=$(sed '/^dn_mpp_data_exchange_port=/!d;s/.*=//' "${IOTDB_CONF}"/iotdb-system.properties) + dn_schema_region_consensus_port=$(sed '/^dn_schema_region_consensus_port=/!d;s/.*=//' "${IOTDB_CONF}"/iotdb-system.properties) + dn_data_region_consensus_port=$(sed '/^dn_data_region_consensus_port=/!d;s/.*=//' "${IOTDB_CONF}"/iotdb-system.properties) + elif [ -f "$IOTDB_HOME/conf/iotdb-system.properties" ]; then + dn_rpc_port=$(sed '/^dn_rpc_port=/!d;s/.*=//' "${IOTDB_HOME}"/conf/iotdb-system.properties) + dn_internal_port=$(sed '/^dn_internal_port=/!d;s/.*=//' "${IOTDB_HOME}"/conf/iotdb-system.properties) + dn_mpp_data_exchange_port=$(sed '/^dn_mpp_data_exchange_port=/!d;s/.*=//' "${IOTDB_HOME}"/conf/iotdb-system.properties) + dn_schema_region_consensus_port=$(sed '/^dn_schema_region_consensus_port=/!d;s/.*=//' "${IOTDB_HOME}"/conf/iotdb-system.properties) + dn_data_region_consensus_port=$(sed '/^dn_data_region_consensus_port=/!d;s/.*=//' "${IOTDB_HOME}"/conf/iotdb-system.properties) + elif [ -f "$IOTDB_CONF/iotdb-datanode.properties" ]; then dn_rpc_port=$(sed '/^dn_rpc_port=/!d;s/.*=//' "${IOTDB_CONF}"/iotdb-datanode.properties) dn_internal_port=$(sed '/^dn_internal_port=/!d;s/.*=//' "${IOTDB_CONF}"/iotdb-datanode.properties) dn_mpp_data_exchange_port=$(sed '/^dn_mpp_data_exchange_port=/!d;s/.*=//' "${IOTDB_CONF}"/iotdb-datanode.properties) @@ -169,7 +181,7 @@ checkDataNodePortUsages () { dn_schema_region_consensus_port=$(sed '/^dn_schema_region_consensus_port=/!d;s/.*=//' "${IOTDB_CONF}"/iotdb-datanode.properties) dn_data_region_consensus_port=$(sed '/^dn_data_region_consensus_port=/!d;s/.*=//' "${IOTDB_CONF}"/iotdb-datanode.properties) else - echo "Warning: cannot find iotdb-datanode.properties, check the default configuration" + echo "Warning: cannot find iotdb-system.properties or iotdb-datanode.properties, check the default configuration" fi dn_rpc_port=${dn_rpc_port:-6667} dn_internal_port=${dn_internal_port:-10730} @@ -244,14 +256,20 @@ checkConfigNodePortUsages () { echo "Warning: If you do not use sudo, the checking may not detect all the occupied ports." fi occupied=false - if [ -f "$CONFIGNODE_CONF/iotdb-confignode.properties" ]; then + if [ -f "$CONFIGNODE_CONF/iotdb-system.properties" ]; then + cn_internal_port=$(sed '/^cn_internal_port=/!d;s/.*=//' "${CONFIGNODE_CONF}"/iotdb-system.properties) + cn_consensus_port=$(sed '/^cn_consensus_port=/!d;s/.*=//' "${CONFIGNODE_CONF}"/iotdb-system.properties) + elif [ -f "$CONFIGNODE_HOME/conf/iotdb-system.properties" ]; then + cn_internal_port=$(sed '/^cn_internal_port=/!d;s/.*=//' "${CONFIGNODE_HOME}"/conf/iotdb-system.properties) + cn_consensus_port=$(sed '/^cn_consensus_port=/!d;s/.*=//' "${CONFIGNODE_HOME}"/conf/iotdb-system.properties) + elif [ -f "$CONFIGNODE_CONF/iotdb-confignode.properties" ]; then cn_internal_port=$(sed '/^cn_internal_port=/!d;s/.*=//' "${CONFIGNODE_CONF}"/iotdb-confignode.properties) cn_consensus_port=$(sed '/^cn_consensus_port=/!d;s/.*=//' "${CONFIGNODE_CONF}"/iotdb-confignode.properties) elif [ -f "$CONFIGNODE_HOME/conf/iotdb-confignode.properties" ]; then cn_internal_port=$(sed '/^cn_internal_port=/!d;s/.*=//' "${CONFIGNODE_HOME}"/conf/iotdb-confignode.properties) cn_consensus_port=$(sed '/^cn_consensus_port=/!d;s/.*=//' "${CONFIGNODE_HOME}"/conf/iotdb-confignode.properties) else - echo "Cannot find iotdb-confignode.properties, check the default configuration" + echo "Cannot find iotdb-system.properties or iotdb-confignode.properties, check the default configuration" fi cn_internal_port=${cn_internal_port:-10710} cn_consensus_port=${cn_consensus_port:-10720} diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java index ee42c0ca32ff..c39c60e069fc 100644 --- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java +++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java @@ -36,9 +36,9 @@ public class CommonConfig { - public static final String CONFIG_NODE_CONFIG_NAME = "iotdb-confignode.properties"; - public static final String DATA_NODE_CONFIG_NAME = "iotdb-datanode.properties"; - public static final String COMMON_CONFIG_NAME = "iotdb-common.properties"; + public static final String OLD_CONFIG_NODE_CONFIG_NAME = "iotdb-confignode.properties"; + public static final String OLD_DATA_NODE_CONFIG_NAME = "iotdb-datanode.properties"; + public static final String OLD_COMMON_CONFIG_NAME = "iotdb-common.properties"; public static final String SYSTEM_CONFIG_NAME = "iotdb-system.properties"; private static final Logger logger = LoggerFactory.getLogger(CommonConfig.class); From 930994bc752dfcbf91c00623c0b56dac0fe7c554 Mon Sep 17 00:00:00 2001 From: shuwenwei Date: Mon, 20 May 2024 16:30:42 +0800 Subject: [PATCH 06/20] modify auto update tool --- .../confignode/src/assembly/confignode.xml | 4 ++-- iotdb-core/datanode/src/assembly/server.xml | 4 ++-- .../conf/ConfigFileAutoUpdateTool.java | 22 +++++++++---------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/iotdb-core/confignode/src/assembly/confignode.xml b/iotdb-core/confignode/src/assembly/confignode.xml index 7e858de63a04..242e3fb810d0 100644 --- a/iotdb-core/confignode/src/assembly/confignode.xml +++ b/iotdb-core/confignode/src/assembly/confignode.xml @@ -44,8 +44,8 @@ - ${maven.multiModuleProjectDirectory}/iotdb-core/node-commons/src/assembly/resources/conf/iotdb-common.properties - conf/iotdb-common.properties + ${maven.multiModuleProjectDirectory}/iotdb-core/node-commons/src/assembly/resources/conf/iotdb-system.properties + conf/iotdb-system.properties ${maven.multiModuleProjectDirectory}/iotdb-core/node-commons/src/assembly/resources/sbin/iotdb-common.sh diff --git a/iotdb-core/datanode/src/assembly/server.xml b/iotdb-core/datanode/src/assembly/server.xml index b1a302597945..96bfdd92748a 100644 --- a/iotdb-core/datanode/src/assembly/server.xml +++ b/iotdb-core/datanode/src/assembly/server.xml @@ -39,8 +39,8 @@ - ${maven.multiModuleProjectDirectory}/iotdb-core/node-commons/src/assembly/resources/conf/iotdb-common.properties - conf/iotdb-common.properties + ${maven.multiModuleProjectDirectory}/iotdb-core/node-commons/src/assembly/resources/conf/iotdb-system.properties + conf/iotdb-system.properties diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/ConfigFileAutoUpdateTool.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/ConfigFileAutoUpdateTool.java index ee93362c457b..e80a3b33089f 100644 --- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/ConfigFileAutoUpdateTool.java +++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/ConfigFileAutoUpdateTool.java @@ -58,22 +58,22 @@ public void checkAndMayUpdate(URL systemUrl, URL configNodeUrl, URL dataNodeUrl, File dataNodeFile = new File(dataNodeUrl.getFile()); File commonFile = new File(commonUrl.getFile()); + if (systemFile.exists()) { + return; + } boolean canUpdate = configNodeFile.exists() && dataNodeFile.exists() && commonFile.exists(); if (!canUpdate) { return; } - if (!systemFile.exists()) { - systemFile.createNewFile(); - } - - acquireTargetFileLock(systemFile); + File lockFile = new File(systemFile.getPath() + lockFileSuffix); + acquireTargetFileLock(lockFile); try { // other progress updated this file - if (systemFile.length() != 0) { + if (systemFile.exists()) { return; } - try (RandomAccessFile raf = new RandomAccessFile(systemFile, "rw")) { + try (RandomAccessFile raf = new RandomAccessFile(lockFile, "rw")) { raf.write(license.getBytes()); String configNodeContent = readConfigLines(configNodeFile); raf.write(configNodeContent.getBytes()); @@ -82,8 +82,9 @@ public void checkAndMayUpdate(URL systemUrl, URL configNodeUrl, URL dataNodeUrl, String commonContent = readConfigLines(commonFile); raf.write(commonContent.getBytes()); } + Files.move(lockFile.toPath(), systemFile.toPath()); } finally { - releaseFileLock(systemFile); + releaseFileLock(lockFile); } } @@ -95,9 +96,8 @@ private String readConfigLines(File file) throws IOException { private void acquireTargetFileLock(File file) throws IOException, InterruptedException { long waitTime = System.currentTimeMillis() + TimeUnit.SECONDS.toMillis(20); - File lockFile = new File(file.getPath() + lockFileSuffix); while (System.currentTimeMillis() < waitTime) { - if (lockFile.createNewFile()) { + if (file.createNewFile()) { return; } Thread.sleep(TimeUnit.MICROSECONDS.toMillis(100)); @@ -105,6 +105,6 @@ private void acquireTargetFileLock(File file) throws IOException, InterruptedExc } private void releaseFileLock(File file) throws IOException { - Files.deleteIfExists(new File(file.getPath() + lockFileSuffix).toPath()); + Files.deleteIfExists(file.toPath()); } } From ae88211bd8b5b05ce92432e2b259e86344dec977 Mon Sep 17 00:00:00 2001 From: shuwenwei Date: Mon, 20 May 2024 17:06:14 +0800 Subject: [PATCH 07/20] fix config update tool --- .../apache/iotdb/commons/conf/ConfigFileAutoUpdateTool.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/ConfigFileAutoUpdateTool.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/ConfigFileAutoUpdateTool.java index e80a3b33089f..e28d6b23c50a 100644 --- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/ConfigFileAutoUpdateTool.java +++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/ConfigFileAutoUpdateTool.java @@ -61,7 +61,7 @@ public void checkAndMayUpdate(URL systemUrl, URL configNodeUrl, URL dataNodeUrl, if (systemFile.exists()) { return; } - boolean canUpdate = configNodeFile.exists() && dataNodeFile.exists() && commonFile.exists(); + boolean canUpdate = (configNodeFile.exists() || dataNodeFile.exists()) && commonFile.exists(); if (!canUpdate) { return; } @@ -89,6 +89,9 @@ public void checkAndMayUpdate(URL systemUrl, URL configNodeUrl, URL dataNodeUrl, } private String readConfigLines(File file) throws IOException { + if (!file.exists()) { + return ""; + } byte[] bytes = Files.readAllBytes(file.toPath()); String content = new String(bytes); return content.replace(license, ""); From de2128d5d32822ed196d14d26257536fbefdfd11 Mon Sep 17 00:00:00 2001 From: shuwenwei Date: Wed, 22 May 2024 10:59:57 +0800 Subject: [PATCH 08/20] fix ut --- .../iotdb/it/env/cluster/ClusterConstant.java | 1 + .../env/cluster/node/ConfigNodeWrapper.java | 7 +- .../it/env/cluster/node/DataNodeWrapper.java | 7 +- .../conf/iotdb-confignode.properties | 147 --- .../resources/sbin/stop-confignode.sh | 2 +- .../iotdb-confignode.properties | 31 - ...mon.properties => iotdb-system.properties} | 13 + .../iotdb-confignode.properties | 31 - ...mon.properties => iotdb-system.properties} | 13 + .../iotdb-confignode.properties | 31 - ...mon.properties => iotdb-system.properties} | 13 + .../resources/conf/iotdb-datanode.properties | 316 ----- .../assembly/resources/sbin/stop-datanode.sh | 2 +- .../datanode1conf/iotdb-common.properties | 22 - ...ode.properties => iotdb-system.properties} | 7 +- .../datanode2conf/iotdb-common.properties | 22 - ...ode.properties => iotdb-system.properties} | 5 + .../datanode3conf/iotdb-common.properties | 22 - ...ode.properties => iotdb-system.properties} | 7 +- .../test/resources/iotdb-system.properties | 76 ++ .../resources/conf/iotdb-common.properties | 1106 ----------------- 21 files changed, 141 insertions(+), 1740 deletions(-) delete mode 100644 iotdb-core/confignode/src/assembly/resources/conf/iotdb-confignode.properties delete mode 100644 iotdb-core/confignode/src/test/resources/confignode1conf/iotdb-confignode.properties rename iotdb-core/confignode/src/test/resources/confignode1conf/{iotdb-common.properties => iotdb-system.properties} (76%) delete mode 100644 iotdb-core/confignode/src/test/resources/confignode2conf/iotdb-confignode.properties rename iotdb-core/confignode/src/test/resources/confignode2conf/{iotdb-common.properties => iotdb-system.properties} (76%) delete mode 100644 iotdb-core/confignode/src/test/resources/confignode3conf/iotdb-confignode.properties rename iotdb-core/confignode/src/test/resources/confignode3conf/{iotdb-common.properties => iotdb-system.properties} (76%) delete mode 100644 iotdb-core/datanode/src/assembly/resources/conf/iotdb-datanode.properties delete mode 100644 iotdb-core/datanode/src/test/resources/datanode1conf/iotdb-common.properties rename iotdb-core/datanode/src/test/resources/datanode1conf/{iotdb-datanode.properties => iotdb-system.properties} (88%) delete mode 100644 iotdb-core/datanode/src/test/resources/datanode2conf/iotdb-common.properties rename iotdb-core/datanode/src/test/resources/datanode2conf/{iotdb-datanode.properties => iotdb-system.properties} (90%) delete mode 100644 iotdb-core/datanode/src/test/resources/datanode3conf/iotdb-common.properties rename iotdb-core/datanode/src/test/resources/datanode3conf/{iotdb-datanode.properties => iotdb-system.properties} (88%) create mode 100644 iotdb-core/datanode/src/test/resources/iotdb-system.properties delete mode 100644 iotdb-core/node-commons/src/assembly/resources/conf/iotdb-common.properties diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/ClusterConstant.java b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/ClusterConstant.java index 6cf9fb71c1cb..e113fb662a55 100644 --- a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/ClusterConstant.java +++ b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/ClusterConstant.java @@ -118,6 +118,7 @@ public class ClusterConstant { public static final String CONFIG_NODE_PROPERTIES_FILE = "iotdb-confignode.properties"; public static final String DATA_NODE_PROPERTIES_FILE = "iotdb-datanode.properties"; public static final String COMMON_PROPERTIES_FILE = "iotdb-common.properties"; + public static final String IOTDB_SYSTEM_PROPERTIES_FILE = "iotdb-system.properties"; public static final String SYSTEM_PROPERTIES_FILE = "system.properties"; public static final String CONFIG_NODE_SYSTEM_PROPERTIES_FILE = "confignode-system.properties"; diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/ConfigNodeWrapper.java b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/ConfigNodeWrapper.java index 91a53b04e0e1..6bd90c9d36cd 100644 --- a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/ConfigNodeWrapper.java +++ b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/ConfigNodeWrapper.java @@ -33,17 +33,16 @@ import static org.apache.iotdb.it.env.cluster.ClusterConstant.CN_CONSENSUS_DIR; import static org.apache.iotdb.it.env.cluster.ClusterConstant.CN_METRIC_IOTDB_REPORTER_HOST; import static org.apache.iotdb.it.env.cluster.ClusterConstant.CN_SYSTEM_DIR; -import static org.apache.iotdb.it.env.cluster.ClusterConstant.COMMON_PROPERTIES_FILE; import static org.apache.iotdb.it.env.cluster.ClusterConstant.CONFIG_NODE_CONSENSUS_PROTOCOL_CLASS; import static org.apache.iotdb.it.env.cluster.ClusterConstant.CONFIG_NODE_INIT_HEAP_SIZE; import static org.apache.iotdb.it.env.cluster.ClusterConstant.CONFIG_NODE_MAX_DIRECT_MEMORY_SIZE; import static org.apache.iotdb.it.env.cluster.ClusterConstant.CONFIG_NODE_MAX_HEAP_SIZE; -import static org.apache.iotdb.it.env.cluster.ClusterConstant.CONFIG_NODE_PROPERTIES_FILE; import static org.apache.iotdb.it.env.cluster.ClusterConstant.CONFIG_NODE_SYSTEM_PROPERTIES_FILE; import static org.apache.iotdb.it.env.cluster.ClusterConstant.DATA_REGION_CONSENSUS_PROTOCOL_CLASS; import static org.apache.iotdb.it.env.cluster.ClusterConstant.DATA_REPLICATION_FACTOR; import static org.apache.iotdb.it.env.cluster.ClusterConstant.DEFAULT_CONFIG_NODE_COMMON_PROPERTIES; import static org.apache.iotdb.it.env.cluster.ClusterConstant.DEFAULT_CONFIG_NODE_PROPERTIES; +import static org.apache.iotdb.it.env.cluster.ClusterConstant.IOTDB_SYSTEM_PROPERTIES_FILE; import static org.apache.iotdb.it.env.cluster.ClusterConstant.SCHEMA_REGION_CONSENSUS_PROTOCOL_CLASS; import static org.apache.iotdb.it.env.cluster.ClusterConstant.SCHEMA_REPLICATION_FACTOR; import static org.apache.iotdb.it.env.cluster.ClusterConstant.TARGET; @@ -91,12 +90,12 @@ public ConfigNodeWrapper( @Override protected String getTargetNodeConfigPath() { - return workDirFilePath("conf", CONFIG_NODE_PROPERTIES_FILE); + return workDirFilePath("conf", IOTDB_SYSTEM_PROPERTIES_FILE); } @Override protected String getTargetCommonConfigPath() { - return workDirFilePath("conf", COMMON_PROPERTIES_FILE); + return workDirFilePath("conf", IOTDB_SYSTEM_PROPERTIES_FILE); } @Override diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/DataNodeWrapper.java b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/DataNodeWrapper.java index e6d16f9860b3..0a12cfae43c3 100644 --- a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/DataNodeWrapper.java +++ b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/DataNodeWrapper.java @@ -29,13 +29,11 @@ import java.util.List; import static org.apache.iotdb.consensus.ConsensusFactory.SIMPLE_CONSENSUS; -import static org.apache.iotdb.it.env.cluster.ClusterConstant.COMMON_PROPERTIES_FILE; import static org.apache.iotdb.it.env.cluster.ClusterConstant.CONFIG_NODE_CONSENSUS_PROTOCOL_CLASS; import static org.apache.iotdb.it.env.cluster.ClusterConstant.DATANODE_INIT_HEAP_SIZE; import static org.apache.iotdb.it.env.cluster.ClusterConstant.DATANODE_MAX_DIRECT_MEMORY_SIZE; import static org.apache.iotdb.it.env.cluster.ClusterConstant.DATANODE_MAX_HEAP_SIZE; import static org.apache.iotdb.it.env.cluster.ClusterConstant.DATA_NODE_NAME; -import static org.apache.iotdb.it.env.cluster.ClusterConstant.DATA_NODE_PROPERTIES_FILE; import static org.apache.iotdb.it.env.cluster.ClusterConstant.DATA_REGION_CONSENSUS_PROTOCOL_CLASS; import static org.apache.iotdb.it.env.cluster.ClusterConstant.DATA_REPLICATION_FACTOR; import static org.apache.iotdb.it.env.cluster.ClusterConstant.DEFAULT_DATA_NODE_COMMON_PROPERTIES; @@ -53,6 +51,7 @@ import static org.apache.iotdb.it.env.cluster.ClusterConstant.DN_SYSTEM_DIR; import static org.apache.iotdb.it.env.cluster.ClusterConstant.DN_TRACING_DIR; import static org.apache.iotdb.it.env.cluster.ClusterConstant.DN_WAL_DIRS; +import static org.apache.iotdb.it.env.cluster.ClusterConstant.IOTDB_SYSTEM_PROPERTIES_FILE; import static org.apache.iotdb.it.env.cluster.ClusterConstant.MAIN_CLASS_NAME; import static org.apache.iotdb.it.env.cluster.ClusterConstant.MAX_TSBLOCK_SIZE_IN_BYTES; import static org.apache.iotdb.it.env.cluster.ClusterConstant.MQTT_HOST; @@ -125,12 +124,12 @@ public DataNodeWrapper( @Override protected String getTargetNodeConfigPath() { - return workDirFilePath("conf", DATA_NODE_PROPERTIES_FILE); + return workDirFilePath("conf", IOTDB_SYSTEM_PROPERTIES_FILE); } @Override protected String getTargetCommonConfigPath() { - return workDirFilePath("conf", COMMON_PROPERTIES_FILE); + return workDirFilePath("conf", IOTDB_SYSTEM_PROPERTIES_FILE); } @Override diff --git a/iotdb-core/confignode/src/assembly/resources/conf/iotdb-confignode.properties b/iotdb-core/confignode/src/assembly/resources/conf/iotdb-confignode.properties deleted file mode 100644 index 8257cc040295..000000000000 --- a/iotdb-core/confignode/src/assembly/resources/conf/iotdb-confignode.properties +++ /dev/null @@ -1,147 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License 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. -# - -#################### -### Config Node RPC Configuration -#################### - -# Used for RPC communication inside cluster. -# Could set 127.0.0.1(for local test) or ipv4 address. -# Datatype: String -cn_internal_address=127.0.0.1 - -# Used for RPC communication inside cluster. -# Datatype: int -cn_internal_port=10710 - -# Used for consensus communication among ConfigNodes inside cluster. -# Datatype: int -cn_consensus_port=10720 - -#################### -### Seed ConfigNode -#################### - -# For the first ConfigNode to start, cn_seed_config_node points to its own cn_internal_address:cn_internal_port. -# For other ConfigNodes that to join the cluster, cn_seed_config_node points to any running ConfigNode's cn_internal_address:cn_internal_port. -# Note: After this ConfigNode successfully joins the cluster for the first time, this parameter is no longer used. -# Each node automatically maintains the list of ConfigNodes and traverses connections when restarting. -# Format: address:port e.g. 127.0.0.1:10710 -# Datatype: String -cn_seed_config_node=127.0.0.1:10710 - -#################### -### Directory configuration -#################### - -# system dir -# If this property is unset, system will save the data in the default relative path directory under the confignode folder(i.e., %CONFIGNODE_HOME%/data/confignode/system). -# If it is absolute, system will save the data in exact location it points to. -# If it is relative, system will save the data in the relative path directory it indicates under the confignode folder. -# For windows platform -# If its prefix is a drive specifier followed by "\\", or if its prefix is "\\\\", then the path is absolute. Otherwise, it is relative. -# cn_system_dir=data\\confignode\\system -# For Linux platform -# If its prefix is "/", then the path is absolute. Otherwise, it is relative. -# cn_system_dir=data/confignode/system - -# consensus dir -# If this property is unset, system will save the data in the default relative path directory under the confignode folder(i.e., %CONFIGNODE_HOME%/data/confignode/consensus). -# If it is absolute, system will save the data in exact location it points to. -# If it is relative, system will save the data in the relative path directory it indicates under the confignode folder. -# Note: If data_dir is assigned an empty string(i.e.,zero-size), it will be handled as a relative path. -# For windows platform -# If its prefix is a drive specifier followed by "\\", or if its prefix is "\\\\", then the path is absolute. Otherwise, it is relative. -# cn_consensus_dir=data\\confignode\\consensus -# For Linux platform -# If its prefix is "/", then the path is absolute. Otherwise, it is relative. -# cn_consensus_dir=data/confignode/consensus - -# pipe_receiver_file_dir -# If this property is unset, system will save the data in the default relative path directory under the IoTDB folder(i.e., %IOTDB_HOME%/${cn_system_dir}/pipe/receiver). -# If it is absolute, system will save the data in the exact location it points to. -# If it is relative, system will save the data in the relative path directory it indicates under the IoTDB folder. -# Note: If pipe_receiver_file_dir is assigned an empty string(i.e.,zero-size), it will be handled as a relative path. -# For windows platform -# If its prefix is a drive specifier followed by "\\", or if its prefix is "\\\\", then the path is absolute. Otherwise, it is relative. -# pipe_receiver_file_dir=data\\confignode\\system\\pipe\\receiver -# For Linux platform -# If its prefix is "/", then the path is absolute. Otherwise, it is relative. -# pipe_receiver_file_dir=data/confignode/system/pipe/receiver - -#################### -### thrift rpc configuration -#################### - -# this feature is under development, set this as false before it is done. -# Datatype: boolean -# cn_rpc_thrift_compression_enable=false - -# if true, a snappy based compression method will be called before sending data by the network -# Datatype: boolean -# this feature is under development, set this as false before it is done. -# cn_rpc_advanced_compression_enable=false - -# Datatype: int -# cn_rpc_max_concurrent_client_num=65535 - -# thrift max frame size, 512MB by default -# Datatype: int -# cn_thrift_max_frame_size=536870912 - -# thrift init buffer size -# Datatype: int -# cn_thrift_init_buffer_size=1024 - -# Thrift socket and connection timeout between raft nodes, in milliseconds. -# Datatype: int -# cn_connection_timeout_ms=60000 - -# selector thread (TAsyncClientManager) nums for async thread in a clientManager -# Datatype: int -# cn_selector_thread_nums_of_client_manager=1 - -# The maximum number of clients that can be allocated for a node in a clientManager. -# when the number of the client to a single node exceeds this number, the thread for applying for a client will be blocked -# for a while, then ClientManager will throw ClientManagerException if there are no clients after the block time. -# Datatype: int -# cn_max_client_count_for_each_node_in_client_manager=300 - -#################### -### Metric Configuration -#################### - -# The reporters of metric module to report metrics -# If there are more than one reporter, please separate them by commas ",". -# Options: [JMX, PROMETHEUS] -# Datatype: String -# cn_metric_reporter_list= - -# The level of metric module -# Options: [OFF, CORE, IMPORTANT, NORMAL, ALL] -# Datatype: String -# cn_metric_level=CORE - -# The period of async collection of some metrics in second -# Datatype: int -# cn_metric_async_collect_period=5 - -# The port of prometheus reporter of metric module -# Datatype: int -# cn_metric_prometheus_reporter_port=9091 \ No newline at end of file diff --git a/iotdb-core/confignode/src/assembly/resources/sbin/stop-confignode.sh b/iotdb-core/confignode/src/assembly/resources/sbin/stop-confignode.sh index b44d35fb03f8..5604afd3d32f 100644 --- a/iotdb-core/confignode/src/assembly/resources/sbin/stop-confignode.sh +++ b/iotdb-core/confignode/src/assembly/resources/sbin/stop-confignode.sh @@ -20,7 +20,7 @@ CONFIGNODE_CONF="$(dirname "$0")/../conf" -if [ -f "${CONFIG_DIR}/iotdb-system.properties" ]; then +if [ -f "${CONFIGNODE_CONF}/iotdb-system.properties" ]; then cn_internal_port=$(sed '/^cn_internal_port=/!d;s/.*=//' "${CONFIGNODE_CONF}"/iotdb-system.properties) else cn_internal_port=$(sed '/^cn_internal_port=/!d;s/.*=//' "${CONFIGNODE_CONF}"/iotdb-confignode.properties) diff --git a/iotdb-core/confignode/src/test/resources/confignode1conf/iotdb-confignode.properties b/iotdb-core/confignode/src/test/resources/confignode1conf/iotdb-confignode.properties deleted file mode 100644 index ade8959df993..000000000000 --- a/iotdb-core/confignode/src/test/resources/confignode1conf/iotdb-confignode.properties +++ /dev/null @@ -1,31 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License 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. -# - -cn_internal_address=127.0.0.1 -cn_internal_port=10710 -cn_consensus_port=10720 -cn_seed_config_node=127.0.0.1:10710 -cn_system_dir=target/confignode1/system -cn_data_dirs=target/confignode1/data -cn_consensus_dir=target/confignode1/consensus - -cn_metric_reporter_list=PROMETHEUS -cn_metric_level=IMPORTANT -cn_metric_async_collect_period=5 -cn_metric_prometheus_reporter_port=9091 \ No newline at end of file diff --git a/iotdb-core/confignode/src/test/resources/confignode1conf/iotdb-common.properties b/iotdb-core/confignode/src/test/resources/confignode1conf/iotdb-system.properties similarity index 76% rename from iotdb-core/confignode/src/test/resources/confignode1conf/iotdb-common.properties rename to iotdb-core/confignode/src/test/resources/confignode1conf/iotdb-system.properties index 8981b21285bb..b396e373f869 100644 --- a/iotdb-core/confignode/src/test/resources/confignode1conf/iotdb-common.properties +++ b/iotdb-core/confignode/src/test/resources/confignode1conf/iotdb-system.properties @@ -17,6 +17,19 @@ # under the License. # +cn_internal_address=127.0.0.1 +cn_internal_port=10710 +cn_consensus_port=10720 +cn_seed_config_node=127.0.0.1:10710 +cn_system_dir=target/confignode1/system +cn_data_dirs=target/confignode1/data +cn_consensus_dir=target/confignode1/consensus + +cn_metric_reporter_list=PROMETHEUS +cn_metric_level=IMPORTANT +cn_metric_async_collect_period=5 +cn_metric_prometheus_reporter_port=9091 + timestamp_precision=ms data_region_consensus_protocol_class=org.apache.iotdb.consensus.iot.IoTConsensus schema_region_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus diff --git a/iotdb-core/confignode/src/test/resources/confignode2conf/iotdb-confignode.properties b/iotdb-core/confignode/src/test/resources/confignode2conf/iotdb-confignode.properties deleted file mode 100644 index eabd45e89e91..000000000000 --- a/iotdb-core/confignode/src/test/resources/confignode2conf/iotdb-confignode.properties +++ /dev/null @@ -1,31 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License 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. -# - -cn_internal_address=127.0.0.1 -cn_internal_port=10711 -cn_consensus_port=10721 -cn_seed_config_node=127.0.0.1:10710 -cn_system_dir=target/confignode2/system -cn_data_dirs=target/confignode2/data -cn_consensus_dir=target/confignode2/consensus - -cn_metric_reporter_list=PROMETHEUS -cn_metric_level=IMPORTANT -cn_metric_async_collect_period=5 -cn_metric_prometheus_reporter_port=9093 \ No newline at end of file diff --git a/iotdb-core/confignode/src/test/resources/confignode2conf/iotdb-common.properties b/iotdb-core/confignode/src/test/resources/confignode2conf/iotdb-system.properties similarity index 76% rename from iotdb-core/confignode/src/test/resources/confignode2conf/iotdb-common.properties rename to iotdb-core/confignode/src/test/resources/confignode2conf/iotdb-system.properties index a9789fedabbe..ef3ba921f96c 100644 --- a/iotdb-core/confignode/src/test/resources/confignode2conf/iotdb-common.properties +++ b/iotdb-core/confignode/src/test/resources/confignode2conf/iotdb-system.properties @@ -17,6 +17,19 @@ # under the License. # +cn_internal_address=127.0.0.1 +cn_internal_port=10711 +cn_consensus_port=10721 +cn_seed_config_node=127.0.0.1:10710 +cn_system_dir=target/confignode2/system +cn_data_dirs=target/confignode2/data +cn_consensus_dir=target/confignode2/consensus + +cn_metric_reporter_list=PROMETHEUS +cn_metric_level=IMPORTANT +cn_metric_async_collect_period=5 +cn_metric_prometheus_reporter_port=9093 + timestamp_precision=ms data_region_consensus_protocol_class=org.apache.iotdb.consensus.iot.IoTConsensus schema_region_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus diff --git a/iotdb-core/confignode/src/test/resources/confignode3conf/iotdb-confignode.properties b/iotdb-core/confignode/src/test/resources/confignode3conf/iotdb-confignode.properties deleted file mode 100644 index ad706b698ec5..000000000000 --- a/iotdb-core/confignode/src/test/resources/confignode3conf/iotdb-confignode.properties +++ /dev/null @@ -1,31 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License 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. -# - -cn_internal_address=127.0.0.1 -cn_internal_port=10712 -cn_consensus_port=10722 -cn_seed_config_node=127.0.0.1:10710 -cn_system_dir=target/confignode3/system -cn_data_dirs=target/confignode3/data -cn_consensus_dir=target/confignode3/consensus - -cn_metric_reporter_list=PROMETHEUS -cn_metric_level=IMPORTANT -cn_metric_async_collect_period=5 -cn_metric_prometheus_reporter_port=9095 \ No newline at end of file diff --git a/iotdb-core/confignode/src/test/resources/confignode3conf/iotdb-common.properties b/iotdb-core/confignode/src/test/resources/confignode3conf/iotdb-system.properties similarity index 76% rename from iotdb-core/confignode/src/test/resources/confignode3conf/iotdb-common.properties rename to iotdb-core/confignode/src/test/resources/confignode3conf/iotdb-system.properties index 6a95388bd72c..48f99317a2fd 100644 --- a/iotdb-core/confignode/src/test/resources/confignode3conf/iotdb-common.properties +++ b/iotdb-core/confignode/src/test/resources/confignode3conf/iotdb-system.properties @@ -17,6 +17,19 @@ # under the License. # +cn_internal_address=127.0.0.1 +cn_internal_port=10712 +cn_consensus_port=10722 +cn_seed_config_node=127.0.0.1:10710 +cn_system_dir=target/confignode3/system +cn_data_dirs=target/confignode3/data +cn_consensus_dir=target/confignode3/consensus + +cn_metric_reporter_list=PROMETHEUS +cn_metric_level=IMPORTANT +cn_metric_async_collect_period=5 +cn_metric_prometheus_reporter_port=9095 + timestamp_precision=ms data_region_consensus_protocol_class=org.apache.iotdb.consensus.iot.IoTConsensus schema_region_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus diff --git a/iotdb-core/datanode/src/assembly/resources/conf/iotdb-datanode.properties b/iotdb-core/datanode/src/assembly/resources/conf/iotdb-datanode.properties deleted file mode 100644 index 949e34007500..000000000000 --- a/iotdb-core/datanode/src/assembly/resources/conf/iotdb-datanode.properties +++ /dev/null @@ -1,316 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License 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. -# - -#################### -### Data Node RPC Configuration -#################### - -# Used for connection of IoTDB native clients(Session) -# Could set 127.0.0.1(for local test) or ipv4 address -# Datatype: String -dn_rpc_address=0.0.0.0 - -# Used for connection of IoTDB native clients(Session) -# Bind with dn_rpc_address -# Datatype: int -dn_rpc_port=6667 - -# Used for communication inside cluster. -# could set 127.0.0.1(for local test) or ipv4 address. -# Datatype: String -dn_internal_address=127.0.0.1 - -# Used for communication inside cluster. -# Bind with dn_internal_address -# Datatype: int -dn_internal_port=10730 - -# Port for data exchange among DataNodes inside cluster -# Bind with dn_internal_address -# Datatype: int -dn_mpp_data_exchange_port=10740 - -# port for consensus's communication for schema region inside cluster. -# Bind with dn_internal_address -# Datatype: int -dn_schema_region_consensus_port=10750 - -# port for consensus's communication for data region inside cluster. -# Bind with dn_internal_address -# Datatype: int -dn_data_region_consensus_port=10760 - -# Datatype: long -# The time of data node waiting for the next retry to join into the cluster. -# dn_join_cluster_retry_interval_ms=5000 - -#################### -### SSL Configuration -#################### - -# Does dn_rpc_port enable SSL -# enable_thrift_ssl=false - -# Rest Service enabled SSL -# enable_https=false - -# SSL key store path -# linux e.g. /home/iotdb/server.keystore (absolute path) or server.keystore (relative path) -# windows e.g. C:\\iotdb\\server.keystore (absolute path) or server.keystore (relative path) -# key_store_path= - -# SSL key store password -# key_store_pwd= - -#################### -### Seed ConfigNode -#################### - -# dn_seed_config_node points to any running ConfigNode's cn_internal_address:cn_internal_port. -# Note: After this DataNode successfully joins the cluster for the first time, this parameter is no longer used. -# Each node automatically maintains the list of ConfigNodes and traverses connections when restarting. -# Format: address:port e.g. 127.0.0.1:10710 -# Datatype: String -dn_seed_config_node=127.0.0.1:10710 - -#################### -### Connection Configuration -#################### - -# The maximum session idle time. unit: ms -# Idle sessions are the ones that performs neither query or non-query operations for a period of time -# Set to 0 to disable session timeout -# Datatype: int -# dn_session_timeout_threshold=0 - -# Datatype: boolean -# dn_rpc_thrift_compression_enable=false - -# if true, a snappy based compression method will be called before sending data by the network -# Datatype: boolean -# this feature is under development, set this as false before it is done. -# dn_rpc_advanced_compression_enable=false - -# Datatype: int -# dn_rpc_selector_thread_count=1 - -# Datatype: int -# dn_rpc_min_concurrent_client_num=1 - -# Datatype: int -# dn_rpc_max_concurrent_client_num=65535 - -# thrift max frame size, 512MB by default -# Datatype: int -# dn_thrift_max_frame_size=536870912 - -# thrift init buffer size -# Datatype: int -# dn_thrift_init_buffer_size=1024 - -# Thrift socket and connection timeout between raft nodes, in milliseconds. -# Datatype: int -# dn_connection_timeout_ms=60000 - -# selector thread (TAsyncClientManager) nums for async thread in a clientManager -# Datatype: int -# dn_selector_thread_count_of_client_manager=1 - -# The maximum number of clients that can be allocated for a node in a clientManager. -# When the number of the client to a single node exceeds this number, the thread for applying for a client will be blocked -# for a while, then ClientManager will throw ClientManagerException if there are no clients after the block time. -# Datatype: int -# dn_max_client_count_for_each_node_in_client_manager=300 - -#################### -### Directory Configuration -#################### - -# system dir -# If this property is unset, system will save the data in the default relative path directory under the IoTDB folder(i.e., %IOTDB_HOME%/data/datanode/system). -# If it is absolute, system will save the data in exact location it points to. -# If it is relative, system will save the data in the relative path directory it indicates under the IoTDB folder. -# For windows platform -# If its prefix is a drive specifier followed by "\\", or if its prefix is "\\\\", then the path is absolute. Otherwise, it is relative. -# dn_system_dir=data\\datanode\\system -# For Linux platform -# If its prefix is "/", then the path is absolute. Otherwise, it is relative. -# dn_system_dir=data/datanode/system - - -# data dirs -# If this property is unset, system will save the data in the default relative path directory under the IoTDB folder(i.e., %IOTDB_HOME%/data/datanode/data). -# If it is absolute, system will save the data in exact location it points to. -# If it is relative, system will save the data in the relative path directory it indicates under the IoTDB folder. -# If there are more than one directory, please separate them by commas ",". -# Note: If data_dirs is assigned an empty string(i.e.,zero-size), it will be handled as a relative path. -# For windows platform -# If its prefix is a drive specifier followed by "\\", or if its prefix is "\\\\", then the path is absolute. Otherwise, it is relative. -# dn_data_dirs=data\\datanode\\data -# For Linux platform -# If its prefix is "/", then the path is absolute. Otherwise, it is relative. -# dn_data_dirs=data/datanode/data - - -# multi_dir_strategy -# The strategy is used to choose a directory from data_dirs for the system to store a new tsfile. -# System provides two strategies to choose from, or user can create his own strategy by extending org.apache.iotdb.db.conf.directories.strategy.DirectoryStrategy. -# The info of the two strategies are as follows: -# 1. SequenceStrategy: the system will choose the directory in sequence. -# 2. MaxDiskUsableSpaceFirstStrategy: the system will choose the directory whose disk has the maximum space. -# Set SequenceStrategy or MaxDiskUsableSpaceFirstStrategy to apply the corresponding strategy. -# If this property is unset, system will use SequenceStrategy as default strategy. -# For this property, fully-qualified class name (include package name) and simple class name are both acceptable. -# dn_multi_dir_strategy=SequenceStrategy - -# consensus dir -# If this property is unset, system will save the data in the default relative path directory under the IoTDB folder(i.e., %IOTDB_HOME%/data/datanode). -# If it is absolute, system will save the data in the exact location it points to. -# If it is relative, system will save the data in the relative path directory it indicates under the IoTDB folder. -# Note: If consensus_dir is assigned an empty string(i.e.,zero-size), it will be handled as a relative path. -# For windows platform -# If its prefix is a drive specifier followed by "\\", or if its prefix is "\\\\", then the path is absolute. Otherwise, it is relative. -# dn_consensus_dir=data\\datanode\\consensus -# For Linux platform -# If its prefix is "/", then the path is absolute. Otherwise, it is relative. -# dn_consensus_dir=data/datanode/consensus - -# wal dirs -# If this property is unset, system will save the data in the default relative path directory under the IoTDB folder(i.e., %IOTDB_HOME%/data/datanode). -# If it is absolute, system will save the data in the exact location it points to. -# If it is relative, system will save the data in the relative path directory it indicates under the IoTDB folder. -# If there are more than one directory, please separate them by commas ",". -# Note: If wal_dirs is assigned an empty string(i.e.,zero-size), it will be handled as a relative path. -# For windows platform -# If its prefix is a drive specifier followed by "\\", or if its prefix is "\\\\", then the path is absolute. Otherwise, it is relative. -# dn_wal_dirs=data\\datanode\\wal -# For Linux platform -# If its prefix is "/", then the path is absolute. Otherwise, it is relative. -# dn_wal_dirs=data/datanode/wal - -# tracing dir -# Uncomment following fields to configure the tracing root directory. -# For Windows platform, the index is as follows: -# dn_tracing_dir=datanode\\tracing -# For Linux platform -# If its prefix is "/", then the path is absolute. Otherwise, it is relative. -# dn_tracing_dir=datanode/tracing - -# sync dir -# If this property is unset, system will save the data in the default relative path directory under the IoTDB folder(i.e., %IOTDB_HOME%/data/datanode). -# If it is absolute, system will save the data in the exact location it points to. -# If it is relative, system will save the data in the relative path directory it indicates under the IoTDB folder. -# Note: If sync_dir is assigned an empty string(i.e.,zero-size), it will be handled as a relative path. -# For windows platform -# If its prefix is a drive specifier followed by "\\", or if its prefix is "\\\\", then the path is absolute. Otherwise, it is relative. -# dn_sync_dir=data\\datanode\\sync -# For Linux platform -# If its prefix is "/", then the path is absolute. Otherwise, it is relative. -# dn_sync_dir=data/datanode/sync - -# sort_tmp_dir -# This property is used to configure the temporary directory for sorting operation. -# If this property is unset, system will save the data in the default relative path directory under the IoTDB folder(i.e., %IOTDB_HOME%/data/datanode). -# If it is absolute, system will save the data in the exact location it points to. -# If it is relative, system will save the data in the relative path directory it indicates under the IoTDB folder. -# Note: If sort_tmp_dir is assigned an empty string(i.e.,zero-size), it will be handled as a relative path. -# For windows platform -# If its prefix is a drive specifier followed by "\\", or if its prefix is "\\\\", then the path is absolute. Otherwise, it is relative. -# sort_tmp_dir=data\\datanode\\tmp -# For Linux platform -# If its prefix is "/", then the path is absolute. Otherwise, it is relative. -# sort_tmp_dir=data/datanode/tmp - -# pipe_receiver_file_dirs -# If this property is unset, system will save the data in the default relative path directory under the IoTDB folder(i.e., %IOTDB_HOME%/${dn_system_dir}/pipe/receiver). -# If it is absolute, system will save the data in the exact location it points to. -# If it is relative, system will save the data in the relative path directory it indicates under the IoTDB folder. -# If there are more than one directory, please separate them by commas ",". -# Note: If pipe_receiver_file_dirs is assigned an empty string(i.e.,zero-size), it will be handled as a relative path. -# For windows platform -# If its prefix is a drive specifier followed by "\\", or if its prefix is "\\\\", then the path is absolute. Otherwise, it is relative. -# pipe_receiver_file_dirs=data\\datanode\\system\\pipe\\receiver -# For Linux platform -# If its prefix is "/", then the path is absolute. Otherwise, it is relative. -# pipe_receiver_file_dirs=data/datanode/system/pipe/receiver - -#################### -### Metric Configuration -#################### - -# The reporters of metric module to report metrics -# If there are more than one reporter, please separate them by commas ",". -# Options: [JMX, PROMETHEUS] -# Datatype: String -# dn_metric_reporter_list= - -# The level of metric module -# Options: [OFF, CORE, IMPORTANT, NORMAL, ALL] -# Datatype: String -# dn_metric_level=CORE - -# The period of async collection of some metrics in second -# Datatype: int -# dn_metric_async_collect_period=5 - -# The port of prometheus reporter of metric module -# Datatype: int -dn_metric_prometheus_reporter_port=9092 - -# The type of internal reporter in metric module, used for checking flushed point number -# Options: [MEMORY, IOTDB] -# Datatype: String -# dn_metric_internal_reporter_type=MEMORY - -#################### -### REST Service Configuration -#################### - -# Is the REST service enabled -# enable_rest_service=false - -# the binding port of the REST service -# rest_service_port=18080 - -# Whether to display rest service interface information through swagger. eg: http://ip:port/swagger.json -# enable_swagger=false - -# the default row limit to a REST query response when the rowSize parameter is not given in request -# rest_query_default_row_size_limit=10000 - -# the expiration time of the user login information cache (in seconds) -# cache_expire_in_seconds=28800 - -# maximum number of users can be stored in the user login cache. -# cache_max_num=100 - -# init capacity of users can be stored in the user login cache. -# cache_init_num=10 - -# Is client authentication required -# client_auth=false - -# SSL trust store path -# trust_store_path="" - -# SSL trust store password. -# trust_store_pwd="" - -# SSL timeout (in seconds) -# idle_timeout_in_seconds=50000 diff --git a/iotdb-core/datanode/src/assembly/resources/sbin/stop-datanode.sh b/iotdb-core/datanode/src/assembly/resources/sbin/stop-datanode.sh index 92d18ebd668b..71bdcef0a82b 100644 --- a/iotdb-core/datanode/src/assembly/resources/sbin/stop-datanode.sh +++ b/iotdb-core/datanode/src/assembly/resources/sbin/stop-datanode.sh @@ -20,7 +20,7 @@ DATANODE_CONF="`dirname "$0"`/../conf" -if [ -f "${CONFIG_DIR}/iotdb-system.properties" ]; then +if [ -f "${DATANODE_CONF}/iotdb-system.properties" ]; then dn_rpc_port=`sed '/^dn_rpc_port=/!d;s/.*=//' ${DATANODE_CONF}/iotdb-system.properties` else dn_rpc_port=`sed '/^dn_rpc_port=/!d;s/.*=//' ${DATANODE_CONF}/iotdb-datanode.properties` diff --git a/iotdb-core/datanode/src/test/resources/datanode1conf/iotdb-common.properties b/iotdb-core/datanode/src/test/resources/datanode1conf/iotdb-common.properties deleted file mode 100644 index 143c0e0b7f00..000000000000 --- a/iotdb-core/datanode/src/test/resources/datanode1conf/iotdb-common.properties +++ /dev/null @@ -1,22 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License 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. -# -timestamp_precision=ms -udf_lib_dir=target/datanode1/ext/udf -trigger_lib_dir=target/datanode1/ext/trigger -pipe_lib_dir=target/datanode1/ext/pipe \ No newline at end of file diff --git a/iotdb-core/datanode/src/test/resources/datanode1conf/iotdb-datanode.properties b/iotdb-core/datanode/src/test/resources/datanode1conf/iotdb-system.properties similarity index 88% rename from iotdb-core/datanode/src/test/resources/datanode1conf/iotdb-datanode.properties rename to iotdb-core/datanode/src/test/resources/datanode1conf/iotdb-system.properties index a7ed41f26152..5bccd18242b0 100644 --- a/iotdb-core/datanode/src/test/resources/datanode1conf/iotdb-datanode.properties +++ b/iotdb-core/datanode/src/test/resources/datanode1conf/iotdb-system.properties @@ -39,4 +39,9 @@ sort_tmp_dir=target/datanode1/tmp dn_metric_reporter_list=PROMETHEUS dn_metric_level=IMPORTANT dn_metric_async_collect_period=5 -dn_metric_prometheus_reporter_port=9097 \ No newline at end of file +dn_metric_prometheus_reporter_port=9097 + +timestamp_precision=ms +udf_lib_dir=target/datanode1/ext/udf +trigger_lib_dir=target/datanode1/ext/trigger +pipe_lib_dir=target/datanode1/ext/pipe \ No newline at end of file diff --git a/iotdb-core/datanode/src/test/resources/datanode2conf/iotdb-common.properties b/iotdb-core/datanode/src/test/resources/datanode2conf/iotdb-common.properties deleted file mode 100644 index 9cf060d61fdd..000000000000 --- a/iotdb-core/datanode/src/test/resources/datanode2conf/iotdb-common.properties +++ /dev/null @@ -1,22 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License 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. -# -timestamp_precision=ms -udf_lib_dir=target/datanode2/ext/udf -trigger_lib_dir=target/datanode2/ext/trigger -pipe_lib_dir=target/datanode2/ext/pipe \ No newline at end of file diff --git a/iotdb-core/datanode/src/test/resources/datanode2conf/iotdb-datanode.properties b/iotdb-core/datanode/src/test/resources/datanode2conf/iotdb-system.properties similarity index 90% rename from iotdb-core/datanode/src/test/resources/datanode2conf/iotdb-datanode.properties rename to iotdb-core/datanode/src/test/resources/datanode2conf/iotdb-system.properties index a8508a79678d..26f56c3c03ce 100644 --- a/iotdb-core/datanode/src/test/resources/datanode2conf/iotdb-datanode.properties +++ b/iotdb-core/datanode/src/test/resources/datanode2conf/iotdb-system.properties @@ -40,3 +40,8 @@ dn_metric_reporter_list=PROMETHEUS dn_metric_level=IMPORTANT dn_metric_async_collect_period=5 dn_metric_prometheus_reporter_port=9099 + +timestamp_precision=ms +udf_lib_dir=target/datanode2/ext/udf +trigger_lib_dir=target/datanode2/ext/trigger +pipe_lib_dir=target/datanode2/ext/pipe \ No newline at end of file diff --git a/iotdb-core/datanode/src/test/resources/datanode3conf/iotdb-common.properties b/iotdb-core/datanode/src/test/resources/datanode3conf/iotdb-common.properties deleted file mode 100644 index 1b48e21f3037..000000000000 --- a/iotdb-core/datanode/src/test/resources/datanode3conf/iotdb-common.properties +++ /dev/null @@ -1,22 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License 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. -# -timestamp_precision=ms -udf_lib_dir=target/datanode3/ext/udf -trigger_lib_dir=target/datanode3/ext/trigger -pipe_lib_dir=target/datanode3/ext/pipe \ No newline at end of file diff --git a/iotdb-core/datanode/src/test/resources/datanode3conf/iotdb-datanode.properties b/iotdb-core/datanode/src/test/resources/datanode3conf/iotdb-system.properties similarity index 88% rename from iotdb-core/datanode/src/test/resources/datanode3conf/iotdb-datanode.properties rename to iotdb-core/datanode/src/test/resources/datanode3conf/iotdb-system.properties index d4faf82e09b3..9bde59103778 100644 --- a/iotdb-core/datanode/src/test/resources/datanode3conf/iotdb-datanode.properties +++ b/iotdb-core/datanode/src/test/resources/datanode3conf/iotdb-system.properties @@ -39,4 +39,9 @@ sort_tmp_dir=target/datanode3/tmp dn_metric_reporter_list=PROMETHEUS dn_metric_level=IMPORTANT dn_metric_async_collect_period=5 -dn_metric_prometheus_reporter_port=9101 \ No newline at end of file +dn_metric_prometheus_reporter_port=9101 + +timestamp_precision=ms +udf_lib_dir=target/datanode3/ext/udf +trigger_lib_dir=target/datanode3/ext/trigger +pipe_lib_dir=target/datanode3/ext/pipe \ No newline at end of file diff --git a/iotdb-core/datanode/src/test/resources/iotdb-system.properties b/iotdb-core/datanode/src/test/resources/iotdb-system.properties new file mode 100644 index 000000000000..86943f5ed347 --- /dev/null +++ b/iotdb-core/datanode/src/test/resources/iotdb-system.properties @@ -0,0 +1,76 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License 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. +# + +base_dir=target/tmp +dn_data_dirs=target/data +dn_wal_dirs=target/wal +index_root_dir=target/index +dn_tracing_dir=target/data/tracing +minimum_pbtree_segment_in_bytes=0 +page_cache_in_pbtree=10 +dn_internal_address=0.0.0.0 +dn_sync_dir=target/sync +dn_seed_config_node=127.0.0.1:10710 + + +#################### +### REST Service Configuration +#################### + +# Is the REST service enabled +enable_rest_service=true + +# the binding port of the REST service +# rest_service_port=18080 + +# Whether to display rest service interface information through swagger. eg: http://ip:port/swagger.json +# enable_swagger=false + +# the default row limit to a REST query response when the rowSize parameter is not given in request +# rest_query_default_row_size_limit=10000 + +# the expiration time of the user login information cache (in seconds) +# cache_expire_in_seconds=28800 + +# maximum number of users can be stored in the user login cache. +# cache_max_num=100 + +# init capacity of users can be stored in the user login cache. +# cache_init_num=10 + +# is SSL enabled +# enable_https=false + +# SSL key store path +# key_store_path= + +# SSL key store password +# key_store_pwd= + +# Is client authentication required +# client_auth=false + +# SSL trust store path +# trust_store_path= + +# SSL trust store password. +# trust_store_pwd= + +# SSL timeout (in seconds) +# idle_timeout_in_seconds=50000 diff --git a/iotdb-core/node-commons/src/assembly/resources/conf/iotdb-common.properties b/iotdb-core/node-commons/src/assembly/resources/conf/iotdb-common.properties deleted file mode 100644 index 827eeca2ad7c..000000000000 --- a/iotdb-core/node-commons/src/assembly/resources/conf/iotdb-common.properties +++ /dev/null @@ -1,1106 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License 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. - -#################### -### Cluster Configuration -#################### - -# Used for indicate cluster name and distinguish different cluster. -# Datatype: string -cluster_name=defaultCluster - -#################### -### Replication configuration -#################### - -# ConfigNode consensus protocol type. -# This parameter is unmodifiable after ConfigNode starts for the first time. -# These consensus protocols are currently supported: -# 1. org.apache.iotdb.consensus.ratis.RatisConsensus -# 2. org.apache.iotdb.consensus.simple.SimpleConsensus (Only 1 ConfigNode can be deployed) -# Datatype: string -# config_node_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus - -# Default number of schema replicas -# Can not be changed after the first start -# Datatype: int -schema_replication_factor=1 - -# SchemaRegion consensus protocol type. -# This parameter is unmodifiable after ConfigNode starts for the first time. -# These consensus protocols are currently supported: -# 1. org.apache.iotdb.consensus.ratis.RatisConsensus -# 2. org.apache.iotdb.consensus.simple.SimpleConsensus (The schema_replication_factor can only be set to 1) -# Datatype: string -# schema_region_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus - -# Default number of data replicas -# Can not be changed after the first start -# Datatype: int -data_replication_factor=1 - -# DataRegion consensus protocol type. -# This parameter is unmodifiable after ConfigNode starts for the first time. -# These consensus protocols are currently supported: -# 1. org.apache.iotdb.consensus.simple.SimpleConsensus (The data_replication_factor can only be set to 1) -# 2. org.apache.iotdb.consensus.iot.IoTConsensus -# 3. org.apache.iotdb.consensus.ratis.RatisConsensus -# Datatype: string -# data_region_consensus_protocol_class=org.apache.iotdb.consensus.iot.IoTConsensus - -#################### -### Load balancing configuration -#################### - -# All parameters in Partition configuration is unmodifiable after ConfigNode starts for the first time. -# And these parameters should be consistent within the ConfigNodeGroup. -# Number of SeriesPartitionSlots per Database -# Datatype: Integer -# series_slot_num=1000 - -# SeriesPartitionSlot executor class -# These hashing algorithms are currently supported: -# 1. BKDRHashExecutor(Default) -# 2. APHashExecutor -# 3. JSHashExecutor -# 4. SDBMHashExecutor -# Also, if you want to implement your own SeriesPartition executor, you can inherit the SeriesPartitionExecutor class and -# modify this parameter to correspond to your Java class -# Datatype: String -# series_partition_executor_class=org.apache.iotdb.commons.partition.executor.hash.BKDRHashExecutor - -# The policy of extension SchemaRegionGroup for each Database. -# These policies are currently supported: -# 1. CUSTOM(Each Database will allocate schema_region_group_per_database RegionGroups as soon as created) -# 2. AUTO(Each Database will automatically extend SchemaRegionGroups based on the data it has) -# Datatype: String -# schema_region_group_extension_policy=AUTO - -# When set schema_region_group_extension_policy=CUSTOM, -# this parameter is the default number of SchemaRegionGroups for each Database. -# When set schema_region_group_extension_policy=AUTO, -# this parameter is the default minimal number of SchemaRegionGroups for each Database. -# Datatype: Integer -# default_schema_region_group_num_per_database=1 - -# Only take effect when set schema_region_group_extension_policy=AUTO. -# This parameter is the maximum number of SchemaRegions expected to be managed by each DataNode. -# Notice: Since each Database requires at least one SchemaRegionGroup to manage its schema, -# this parameter doesn't limit the upper bound of cluster SchemaRegions when there are too many Databases. -# Datatype: Double -# schema_region_per_data_node=1.0 - -# The policy of extension DataRegionGroup for each Database. -# These policies are currently supported: -# 1. CUSTOM(Each Database will allocate data_region_group_per_database DataRegionGroups as soon as created) -# 2. AUTO(Each Database will automatically extend DataRegionGroups based on the data it has) -# Datatype: String -# data_region_group_extension_policy=AUTO - -# When set data_region_group_extension_policy=CUSTOM, -# this parameter is the default number of DataRegionGroups for each Database. -# When set data_region_group_extension_policy=AUTO, -# this parameter is the default minimal number of DataRegionGroups for each Database. -# Datatype: Integer -# default_data_region_group_num_per_database=2 - -# Only take effect when set data_region_group_extension_policy=AUTO. -# This parameter is the maximum number of DataRegions expected to be managed by each DataNode. -# Notice: Since each Database requires at least two DataRegionGroups to manage its data, -# this parameter doesn't limit the upper bound of cluster DataRegions when there are too many Databases. -# Datatype: Double -# data_region_per_data_node=5.0 - -# Whether to enable auto leader balance for Ratis consensus protocol. -# The ConfigNode-leader will balance the leader of Ratis-RegionGroups by leader_distribution_policy if set true. -# Notice: Default is false because the Ratis is unstable for this function. -# Datatype: Boolean -# enable_auto_leader_balance_for_ratis_consensus=true - -# Whether to enable auto leader balance for IoTConsensus protocol. -# The ConfigNode-leader will balance the leader of IoTConsensus-RegionGroups by leader_distribution_policy if set true. -# Notice: Default is true because the IoTConsensus depends on this function to distribute leader. -# Datatype: Boolean -# enable_auto_leader_balance_for_iot_consensus=true - -#################### -### Cluster management -#################### - -# Time partition interval in milliseconds, and partitioning data inside each data region, default is equal to one week -# Can not be changed after the first start -# Datatype: long -# time_partition_interval=604800000 - -# The heartbeat interval in milliseconds, default is 1000ms -# Datatype: long -# heartbeat_interval_in_ms=1000 - -# Disk remaining threshold at which DataNode is set to ReadOnly status -# Datatype: double(percentage) -# disk_space_warning_threshold=0.05 - -#################### -### Memory Control Configuration -#################### - -# Memory Allocation Ratio: StorageEngine, QueryEngine, SchemaEngine, Consensus, StreamingEngine and Free Memory. -# The parameter form is a:b:c:d:e:f, where a, b, c, d, e and f are integers. for example: 1:1:1:1:1:1 , 6:2:1:1:1:1 -# If you have high level of writing pressure and low level of reading pressure, please adjust it to for example 6:1:1:1:1:1 -# datanode_memory_proportion=3:3:1:1:1:1 - -# Schema Memory Allocation Ratio: SchemaRegion, SchemaCache, and PartitionCache. -# The parameter form is a:b:c, where a, b and c are integers. for example: 1:1:1 , 6:2:1 -# schema_memory_proportion=5:4:1 - -# Memory allocation ratio in StorageEngine: Write, Compaction -# The parameter form is a:b:c:d, where a, b, c and d are integers. for example: 8:2 , 7:3 -# storage_engine_memory_proportion=8:2 - -# Memory allocation ratio in writing: Memtable, TimePartitionInfo -# Memtable is the total memory size of all memtables -# TimePartitionInfo is the total memory size of last flush time of all data regions -# write_memory_proportion=19:1 - -# primitive array size (length of each array) in array pool -# Datatype: int -# primitive_array_size=64 - -# Ratio of compaction memory for chunk metadata maintains in memory when doing compaction -# Datatype: double -# chunk_metadata_size_proportion=0.1 - -# Ratio of write memory for invoking flush disk, 0.4 by default -# If you have extremely high write load (like batch=1000), it can be set lower than the default value like 0.2 -# Datatype: double -# flush_proportion=0.4 - -# Ratio of write memory allocated for buffered arrays, 0.6 by default -# Datatype: double -# buffered_arrays_memory_proportion=0.6 - -# Ratio of write memory for rejecting insertion, 0.8 by default -# If you have extremely high write load (like batch=1000) and the physical memory size is large enough, -# it can be set higher than the default value like 0.9 -# Datatype: double -# reject_proportion=0.8 - -# Ratio of memory for the DevicePathCache. DevicePathCache is the deviceId cache, keep only one copy of the same deviceId in memory -# Datatype: double -# device_path_cache_proportion=0.05 - -# If memory cost of data region increased more than proportion of allocated memory for write, report to system. The default value is 0.001 -# Datatype: double -# write_memory_variation_report_proportion=0.001 - -# When an inserting is rejected, waiting period (in ms) to check system again, 50 by default. -# If the insertion has been rejected and the read load is low, it can be set larger. -# Datatype: int -# check_period_when_insert_blocked=50 - -# size of ioTaskQueue. The default value is 10 -# Datatype: int -# io_task_queue_size_for_flushing=10 - -# If true, we will estimate each query's possible memory footprint before executing it and deny it if its estimated memory exceeds current free memory -# Datatype: bool -# enable_query_memory_estimation=true - -#################### -### Schema Engine Configuration -#################### - -# The schema management mode of schema engine. Currently support Memory and PBTree. -# This config of all DataNodes in one cluster must keep same. -# Datatype: string -# schema_engine_mode=Memory - -# cache size for partition. -# This cache is used to improve partition fetch from config node. -# Datatype: int -# partition_cache_size=1000 - -# Size of log buffer in each metadata operation plan(in byte). -# If the size of a metadata operation plan is larger than this parameter, then it will be rejected by SchemaRegion -# If it sets a value smaller than 0, use the default value 1024*1024 -# Datatype: int -# mlog_buffer_size=1048576 - -# The cycle when metadata log is periodically forced to be written to disk(in milliseconds) -# If sync_mlog_period_in_ms=0 it means force metadata log to be written to disk after each refreshment -# Set this parameter to 0 may slow down the operation on slow disk. -# sync_mlog_period_in_ms=100 - -# interval num for tag and attribute records when force flushing to disk -# When a certain amount of tag and attribute records is reached, they will be force flushed to disk -# It is possible to lose at most tag_attribute_flush_interval records -# tag_attribute_flush_interval=1000 - -# max size for a storage block for tags and attributes of one time series. If the combined size of tags and -# attributes exceeds the tag_attribute_total_size, a new storage block will be allocated to continue storing -# the excess data. -# the unit is byte -# Datatype: int -# tag_attribute_total_size=700 - -# max measurement num of internal request -# When creating timeseries with Session.createMultiTimeseries, the user input plan, the timeseries num of -# which exceeds this num, will be split to several plans with timeseries no more than this num. -# max_measurement_num_of_internal_request=10000 - -# Policy of DataNodeSchemaCache eviction. -# Support FIFO and LRU policy. FIFO takes low cache update overhead. LRU takes high cache hit rate. -# datanode_schema_cache_eviction_policy=FIFO - -# This configuration parameter sets the maximum number of time series allowed in the cluster. -# The value should be a positive integer representing the desired threshold. -# When the threshold is reached, users will be prohibited from creating new time series. -# -1 means unlimited -# cluster_timeseries_limit_threshold=-1 - -# This configuration parameter sets the maximum number of device allowed in the cluster. -# The value should be a positive integer representing the desired threshold. -# When the threshold is reached, users will be prohibited from creating new time series. -# -1 means unlimited -# cluster_device_limit_threshold=-1 - -# This configuration parameter sets the maximum number of Cluster Databases allowed. -# The value should be a positive integer representing the desired threshold. -# When the threshold is reached, users will be prohibited from creating new databases. -# -1 means unlimited. -# database_limit_threshold = -1 - - - -#################### -### Configurations for creating schema automatically -#################### - -# Whether creating schema automatically is enabled -# If true, then create database and timeseries automatically when not exists in insertion -# Or else, user need to create database and timeseries before insertion. -# Datatype: boolean -# enable_auto_create_schema=true - -# Database level when creating schema automatically is enabled -# e.g. root.sg0.d1.s2 -# we will set root.sg0 as the database if database level is 1 -# Datatype: int -# default_storage_group_level=1 - -# ALL data types: BOOLEAN, INT32, INT64, FLOAT, DOUBLE, TEXT - -# register time series as which type when receiving boolean string "true" or "false" -# Datatype: TSDataType -# Options: BOOLEAN, TEXT -# boolean_string_infer_type=BOOLEAN - -# register time series as which type when receiving an integer string and using float or double may lose precision -# Datatype: TSDataType -# Options: DOUBLE, FLOAT, INT32, INT64, TEXT -# integer_string_infer_type=DOUBLE - -# register time series as which type when receiving a floating number string "6.7" -# Datatype: TSDataType -# Options: DOUBLE, FLOAT, TEXT -# floating_string_infer_type=DOUBLE - -# register time series as which type when receiving the Literal NaN. -# Datatype: TSDataType -# Options: DOUBLE, FLOAT, TEXT -# nan_string_infer_type=DOUBLE - -# BOOLEAN encoding when creating schema automatically is enabled -# Datatype: TSEncoding -# default_boolean_encoding=RLE - -# INT32 encoding when creating schema automatically is enabled -# Datatype: TSEncoding -# default_int32_encoding=TS_2DIFF - -# INT64 encoding when creating schema automatically is enabled -# Datatype: TSEncoding -# default_int64_encoding=TS_2DIFF - -# FLOAT encoding when creating schema automatically is enabled -# Datatype: TSEncoding -# default_float_encoding=GORILLA - -# DOUBLE encoding when creating schema automatically is enabled -# Datatype: TSEncoding -# default_double_encoding=GORILLA - -# TEXT encoding when creating schema automatically is enabled -# Datatype: TSEncoding -# default_text_encoding=PLAIN - -#################### -### Query Configurations -#################### - -# The read consistency level -# These consistency levels are currently supported: -# 1. strong(Default, read from the leader replica) -# 2. weak(Read from a random replica) -# Datatype: string -# read_consistency_level=strong - -# Whether to cache meta data(BloomFilter, ChunkMetadata and TimeSeriesMetadata) or not. -# Datatype: boolean -# meta_data_cache_enable=true - -# Read memory Allocation Ratio: BloomFilterCache : ChunkCache : TimeSeriesMetadataCache : Coordinator : Operators : DataExchange : timeIndex in TsFileResourceList : others. -# The parameter form is a:b:c:d:e:f:g:h, where a, b, c, d, e, f, g and h are integers. for example: 1:1:1:1:1:1:1:1 , 1:100:200:50:200:200:200:50 -# chunk_timeseriesmeta_free_memory_proportion=1:100:200:50:200:200:200:50 - -# Whether to enable LAST cache -# Datatype: boolean -# enable_last_cache=true - -# Core size of ThreadPool of MPP data exchange -# Datatype: int -# mpp_data_exchange_core_pool_size=10 - -# Max size of ThreadPool of MPP data exchange -# Datatype: int -# mpp_data_exchange_max_pool_size=10 - -# Max waiting time for MPP data exchange -# Datatype: int -# mpp_data_exchange_keep_alive_time_in_ms=1000 - -# The max execution time of a DriverTask -# Datatype: int, Unit: ms -# driver_task_execution_time_slice_in_ms=200 - -# The max capacity of a TsBlock -# Datatype: int, Unit: byte -# max_tsblock_size_in_bytes=131072 - -# The max number of lines in a single TsBlock -# Datatype: int -# max_tsblock_line_number=1000 - -# Time cost(ms) threshold for slow query -# Datatype: long -# slow_query_threshold=10000 - -# The max executing time of query. unit: ms -# Datatype: int -# query_timeout_threshold=60000 - -# The maximum allowed concurrently executing queries -# Datatype: int -# max_allowed_concurrent_queries=1000 - -# How many threads can concurrently execute query statement. When <= 0, use CPU core number. -# Datatype: int -# query_thread_count=0 - -# How many pipeline drivers will be created for one fragment instance. When <= 0, use CPU core number / 2. -# Datatype: int -# degree_of_query_parallelism=0 - -# The threshold of count map size when calculating the MODE aggregation function -# Datatype: int -# mode_map_size_threshold=10000 - -# The amount of data iterate each time in server (the number of data strips, that is, the number of different timestamps.) -# Datatype: int -# batch_size=100000 - -# The memory for external sort in sort operator, when the data size is smaller than sort_buffer_size_in_bytes, the sort operator will use in-memory sort. -# Datatype: long -# sort_buffer_size_in_bytes=1048576 - -# The threshold of operator count in the result set of EXPLAIN ANALYZE, if the number of operator in the result set is larger than this threshold, operator will be merged. -# Datatype: int -# merge_threshold_of_explain_analyze=10 - -#################### -### Storage Engine Configuration -#################### - -# Use this value to set timestamp precision as "ms", "us" or "ns". -# Once the precision has been set, it can not be changed. -# Datatype: String -# timestamp_precision=ms - -# When the timestamp precision check is enabled, the timestamps those are over 13 digits for ms precision, or over 16 digits for us precision are not allowed to be inserted. -# Datatype: Boolean -# timestamp_precision_check_enabled=true - -# Default TTL for databases that are not set TTL by statements, If not set (default), the TTL will be unlimited. -# Negative value means the TTL is unlimited. -# Notice: if this property is changed, previous created database which are not set TTL will also be affected. -# Datatype: long -# Unit: ms -# default_ttl_in_ms=-1 - -# When the waiting time (in ms) of an inserting exceeds this, throw an exception. 10000 by default. -# If the insertion has been rejected and the read load is low, it can be set larger -# Datatype: int -# max_waiting_time_when_insert_blocked=10000 - -# Add a switch to enable separate sequence and unsequence data. -# If it is true, then data will be separated into seq and unseq data dir. If it is false, then all data will be written into unseq data dir. -# Datatype: boolean -# enable_separate_data=true - -# What will the system do when unrecoverable error occurs. -# Datatype: String -# Optional strategies are as follows: -# 1. CHANGE_TO_READ_ONLY: set system status to read-only and the system only accepts query operations. -# 2. SHUTDOWN: the system will be shutdown. -# handle_system_error=CHANGE_TO_READ_ONLY - -# Whether to timed flush sequence tsfiles' memtables. -# Datatype: boolean -# enable_timed_flush_seq_memtable=true - -# If a memTable's last update time is older than current time minus this, the memtable will be flushed to disk. -# Only check sequence tsfiles' memtables. -# The default flush interval is 10 * 60 * 1000. (unit: ms) -# Datatype: long -# seq_memtable_flush_interval_in_ms=600000 - -# The interval to check whether sequence memtables need flushing. -# The default flush check interval is 30 * 1000. (unit: ms) -# Datatype: long -# seq_memtable_flush_check_interval_in_ms=30000 - -# Whether to timed flush unsequence tsfiles' memtables. -# Datatype: boolean -# enable_timed_flush_unseq_memtable=true - -# If a memTable's last update time is older than current time minus this, the memtable will be flushed to disk. -# Only check unsequence tsfiles' memtables. -# The default flush interval is 10 * 60 * 1000. (unit: ms) -# Datatype: long -# unseq_memtable_flush_interval_in_ms=600000 - -# The interval to check whether unsequence memtables need flushing. -# The default flush check interval is 30 * 1000. (unit: ms) -# Datatype: long -# unseq_memtable_flush_check_interval_in_ms=30000 - -# The sort algorithms used in the memtable's TVList -# TIM: default tim sort, -# QUICK: quick sort, -# BACKWARD: backward sort -# tvlist_sort_algorithm=TIM - -# When the average point number of timeseries in memtable exceeds this, the memtable is flushed to disk. The default threshold is 100000. -# Datatype: int -# avg_series_point_number_threshold=100000 - -# How many threads can concurrently flush. When <= 0, use CPU core number. -# Datatype: int -# flush_thread_count=0 - -# In one insert (one device, one timestamp, multiple measurements), -# if enable partial insert, one measurement failure will not impact other measurements -# Datatype: boolean -# enable_partial_insert=true - -# the interval to log recover progress of each vsg when starting iotdb -# Datatype: int -# recovery_log_interval_in_ms=5000 - -# If using v0.13 client to insert data, please set this configuration to true. -# Notice: if using v0.13/v1.0 client or setting Client Version to V_0_13 manually, enable this config will disable insert redirection. -# Datatype: boolean -# 0.13_data_insert_adapt=false - -# Verify that TSfiles generated by Flush, Load, and Compaction are correct. The following is verified: -# 1. Check whether the file contains a header and a tail -# 2. Check whether files can be deserialized successfully -# 3. Check whether the file contains data -# 4. Whether there is time range overlap between data, whether it is increased, and whether the metadata index offset of the sequence is correct -# Datatype: boolean -# enable_tsfile_validation=false - -#################### -### Compaction Configurations -#################### -# sequence space compaction: only compact the sequence files -# Datatype: boolean -# enable_seq_space_compaction=true - -# unsequence space compaction: only compact the unsequence files -# Datatype: boolean -# enable_unseq_space_compaction=true - -# cross space compaction: compact the unsequence files into the overlapped sequence files -# Datatype: boolean -# enable_cross_space_compaction=true - -# the selector of cross space compaction task -# Options: rewrite -# cross_selector=rewrite - -# the compaction performer of cross space compaction task -# Options: read_point, fast -# cross_performer=fast - -# the selector of inner sequence space compaction task -# Options: size_tiered -# inner_seq_selector=size_tiered - -# the performer of inner sequence space compaction task -# Options: read_chunk, fast -# inner_seq_performer=read_chunk - -# the selector of inner unsequence space compaction task -# Options: size_tiered -# inner_unseq_selector=size_tiered - -# the performer of inner unsequence space compaction task -# Options: read_point, fast -# inner_unseq_performer=fast - -# The priority of compaction execution -# INNER_CROSS: prioritize inner space compaction, reduce the number of files first -# CROSS_INNER: prioritize cross space compaction, eliminate the unsequence files first -# BALANCE: alternate two compaction types -# compaction_priority=BALANCE - -# The size of candidate compaction task queue. -# Datatype: int -# candidate_compaction_task_queue_size = 200 - -# This parameter is used in two places: -# 1. The target tsfile size of inner space compaction. -# 2. The candidate size of seq tsfile in cross space compaction will be smaller than target_compaction_file_size * 1.5. -# In most cases, the target file size of cross compaction won't exceed this threshold, and if it does, it will not be much larger than it. -# default is 2GB -# Datatype: long, Unit: byte -# target_compaction_file_size=2147483648 - -# The target chunk size in compaction and when memtable reaches this threshold, flush the memtable to disk. -# default is 1MB -# Datatype: long, Unit: byte -# target_chunk_size=1048576 - -# The target point nums in one chunk in compaction -# Datatype: long -# target_chunk_point_num=100000 - -# If the chunk size is lower than this threshold, it will be deserialize into points, default is 128 byte -# Datatype: long, Unit:byte -# chunk_size_lower_bound_in_compaction=128 - -# If the chunk point num is lower than this threshold, it will be deserialize into points -# Datatype: long -# chunk_point_num_lower_bound_in_compaction=100 - -# The max file when selecting inner space compaction candidate files -# Datatype: int -# max_inner_compaction_candidate_file_num=30 - -# The max file when selecting cross space compaction candidate files -# At least one unseq file with it's overlapped seq files will be selected even exceeded this number -# Datatype: int -# max_cross_compaction_candidate_file_num=500 - -# The max total size when selecting cross space compaction candidate files -# At least one unseq file with it's overlapped seq files will be selected even exceeded this number -# Datatype: long, Unit: byte -# max_cross_compaction_candidate_file_size=5368709120 - -# The min inner compaction level of unsequence file which can be selected as candidate -# Datatype: int -# min_cross_compaction_unseq_file_level=1 - -# If one merge file selection runs for more than this time, it will be ended and its current -# selection will be used as final selection. -# When < 0, it means time is unbounded. -# Datatype: long, Unit: ms -# cross_compaction_file_selection_time_budget=30000 - -# How many threads will be set up to perform compaction, 10 by default. -# Set to 1 when less than or equal to 0. -# Datatype: int -# compaction_thread_count=10 - -# The interval of compaction task schedule -# Datatype: long, Unit: ms -# compaction_schedule_interval_in_ms=60000 - -# The interval of compaction task submission -# Datatype: long, Unit: ms -# compaction_submission_interval_in_ms=60000 - -# The limit of write throughput merge can reach per second -# values less than or equal to 0 means no limit -# Datatype: int, Unit: megabyte -# compaction_write_throughput_mb_per_sec=16 - -# The limit of read throughput merge can reach per second -# values less than or equal to 0 means no limit -# Datatype: int, Unit: megabyte -# compaction_read_throughput_mb_per_sec=0 - -# The limit of read operation merge can reach per second -# values less than or equal to 0 means no limit -# Datatype: int -# compaction_read_operation_per_sec=0 - -# The number of sub compaction threads to be set up to perform compaction. -# Currently only works for nonAligned data in cross space compaction and unseq inner space compaction. -# Set to 1 when less than or equal to 0. -# Datatype: int -# sub_compaction_thread_count=4 - -# Redundancy value of disk availability, only use for inner compaction. -# When disk availability is lower than the sum of (disk_space_warning_threshold + inner_compaction_task_selection_disk_redundancy), inner compaction tasks containing mods files are selected first. -# DataType: double -# inner_compaction_task_selection_disk_redundancy=0.05 - -# Mods file size threshold, only use for inner compaction. -# When the size of the mods file corresponding to TsFile exceeds this value, inner compaction tasks containing mods files are selected first. -# DataType: long -# inner_compaction_task_selection_mods_file_threshold=10485760 - -# The number of threads to be set up to select compaction task. -# Datatype: int -# compaction_schedule_thread_num=4 - -#################### -### Write Ahead Log Configuration -#################### - -# Write mode of wal -# The details of these three modes are as follows: -# 1. DISABLE: the system will disable wal. -# 2. SYNC: the system will submit wal synchronously, write request will not return until its wal is fsynced to the disk successfully. -# 3. ASYNC: the system will submit wal asynchronously, write request will return immediately no matter its wal is fsynced to the disk successfully. -# The write performance order is DISABLE > ASYNC > SYNC, but only SYNC mode can ensure data durability. -# wal_mode=ASYNC - -# Max number of wal nodes, each node corresponds to one wal directory -# This parameter is only valid in the standalone mode. IoTConsensus uses one wal per data region and RatisConsensus doesn't use wal. -# The default value 0 means the number is determined by the system, the number is in the range of [data region num / 2, data region num]. -# Notice: this value affects write performance significantly. -# For non-SSD disks, values between one third and half of databases number are recommended. -# Datatype: int -# max_wal_nodes_num=0 - -# Duration a wal flush operation will wait before calling fsync in the async mode -# A duration greater than 0 batches multiple wal fsync calls into one. This is useful when disks are slow or WAL write contention exists. -# Notice: this value affects write performance significantly, values in the range of 10ms-2000ms are recommended. -# Datatype: long -# wal_async_mode_fsync_delay_in_ms=1000 - -# Duration a wal flush operation will wait before calling fsync in the sync mode -# A duration greater than 0 batches multiple wal fsync calls into one. This is useful when disks are slow or WAL write contention exists. -# Notice: this value affects write performance significantly, values in the range of 0ms-10ms are recommended. -# Datatype: long -# wal_sync_mode_fsync_delay_in_ms=3 - -# Buffer size of each wal node -# If it's a value smaller than 0, use the default value 32 * 1024 * 1024 bytes (32MB). -# Datatype: int -# wal_buffer_size_in_byte=33554432 - -# Blocking queue capacity of each wal buffer, restricts maximum number of WALEdits cached in the blocking queue. -# Datatype: int -# wal_buffer_queue_capacity=500 - -# Size threshold of each wal file -# When a wal file's size exceeds this, the wal file will be closed and a new wal file will be created. -# If it's a value smaller than 0, use the default value 30 * 1024 * 1024 (30MB). -# Datatype: long -# wal_file_size_threshold_in_byte=31457280 - -# Minimum ratio of effective information in wal files -# This value should be between 0.0 and 1.0 -# If effective information ratio is below this value, MemTable snapshot or flush will be triggered. -# Increase this value when wal occupies too much disk space. But, if this parameter is too large, the write performance may decline. -# Datatype: double -# wal_min_effective_info_ratio=0.1 - -# MemTable size threshold for triggering MemTable snapshot in wal -# When a memTable's size (in byte) exceeds this, wal can flush this memtable to disk, otherwise wal will snapshot this memtable in wal. -# If it's a value smaller than 0, use the default value 8 * 1024 * 1024 bytes (8MB). -# Datatype: long -# wal_memtable_snapshot_threshold_in_byte=8388608 - -# MemTable's max snapshot number in wal -# If one memTable's snapshot number in wal exceeds this value, it will be flushed to disk. -# Datatype: int -# max_wal_memtable_snapshot_num=1 - -# The period when outdated wal files are periodically deleted -# If this value is too large, outdated wal files may not able to be deleted in time. -# If it's a value smaller than 0, use the default value 20 * 1000 ms (20 seconds). -# Datatype: long -# delete_wal_files_period_in_ms=20000 - -# The minimum size of wal files when throttle down in IoTConsensus -# If this value is not set, it will be carefully chosen according to the available disk space. -# If this value is set smaller than 0, it will default to 50 * 1024 * 1024 * 1024 bytes (50GB). -# Datatype: long -# iot_consensus_throttle_threshold_in_byte=53687091200 - -# Maximum wait time of write cache in IoTConsensus -# If this value is less than or equal to 0, use the default value 10 * 1000 ms (10s) -# Datatype: long -# iot_consensus_cache_window_time_in_ms=-1 - -#################### -### IoTConsensus Configuration -#################### - -# The maximum log entries num in IoTConsensus Batch -# Datatype: int -# data_region_iot_max_log_entries_num_per_batch = 1024 - -# The maximum size in IoTConsensus Batch -# Datatype: int -# data_region_iot_max_size_per_batch = 16777216 - -# The maximum pending batches num in IoTConsensus -# Datatype: int -# data_region_iot_max_pending_batches_num = 5 - -# The maximum memory ratio for queue in IoTConsensus -# Datatype: double -# data_region_iot_max_memory_ratio_for_queue = 0.6 - -# The maximum transit size in byte per second for region migration -# values less than or equal to 0 means no limit -# Datatype: long -# region_migration_speed_limit_bytes_per_second = 33554432 - -#################### -### TsFile Configurations -#################### - -# Datatype: int -# group_size_in_byte=134217728 - -# The memory size for each series writer to pack page, default value is 64KB -# Datatype: int -# page_size_in_byte=65536 - -# The maximum number of data points in a page, default 10000 -# Datatype: int -# max_number_of_points_in_page=10000 - -# The threshold for pattern matching in regex -# Datatype: int -# pattern_matching_threshold=1000000 - -# Floating-point precision -# Datatype: int -# float_precision=2 - -# Encoder of value series. default value is PLAIN. -# For int, long data type, also supports TS_2DIFF and RLE(run-length encoding), GORILLA and ZIGZAG. -# value_encoder=PLAIN - -# Compression configuration -# Data compression method, supports UNCOMPRESSED, SNAPPY, ZSTD, LZMA2 or LZ4. Default value is LZ4 -# And it is also used as the default compressor of time column in aligned timeseries. -# compressor=LZ4 - -#################### -### Authorization Configuration -#################### - -# which class to serve for authorization. By default, it is LocalFileAuthorizer. -# Another choice is org.apache.iotdb.commons.auth.authorizer.OpenIdAuthorizer -# authorizer_provider_class=org.apache.iotdb.commons.auth.authorizer.LocalFileAuthorizer - -# If OpenIdAuthorizer is enabled, then openID_url must be set. -# openID_url= - -# encryption provider class -# iotdb_server_encrypt_decrypt_provider=org.apache.iotdb.commons.security.encrypt.MessageDigestEncrypt - -# encryption provided class parameter -# iotdb_server_encrypt_decrypt_provider_parameter= - -# Cache size of user and role -# Datatype: int -# author_cache_size=1000 - -# Cache expire time of user and role -# Datatype: int -# author_cache_expire_time=30 - -#################### -### UDF Configuration -#################### - -# Used to estimate the memory usage of text fields in a UDF query. -# It is recommended to set this value to be slightly larger than the average length of all text -# records. -# Datatype: int -# udf_initial_byte_array_length_for_memory_control=48 - -# How much memory may be used in ONE UDF query (in MB). -# The upper limit is 20% of allocated memory for read. -# Datatype: float -# udf_memory_budget_in_mb=30.0 - -# UDF memory allocation ratio. -# The parameter form is a:b:c, where a, b, and c are integers. -# udf_reader_transformer_collector_memory_proportion=1:1:1 - -# UDF lib dir -# If this property is unset, system will save the data in the default relative path directory under -# the UDF folder(i.e., %CONFIGNODE_HOME%/ext/udf). -# -# If it is absolute, system will save the data in exact location it points to. -# If it is relative, system will save the data in the relative path directory it indicates under the -# UDF folder. -# Note: If data_dir is assigned an empty string(i.e.,zero-size), it will be handled as a relative -# path. -# -# For Windows platform -# If its prefix is a drive specifier followed by "\\", or if its prefix is "\\\\", then the path is -# absolute. Otherwise, it is relative. -# udf_lib_dir=ext\\udf -# -# For Linux platform -# If its prefix is "/", then the path is absolute. Otherwise, it is relative. -# udf_lib_dir=ext/udf - -#################### -### Trigger Configuration -#################### - -# Uncomment the following field to configure the trigger lib directory. -# For Windows platform -# If its prefix is a drive specifier followed by "\\", or if its prefix is "\\\\", then the path is -# absolute. Otherwise, it is relative. -# trigger_lib_dir=ext\\trigger -# For Linux platform -# If its prefix is "/", then the path is absolute. Otherwise, it is relative. -# trigger_lib_dir=ext/trigger - -# How many times will we retry to found an instance of stateful trigger on DataNodes -# 3 by default. -# Datatype: int -# stateful_trigger_retry_num_when_not_found=3 - - -#################### -### Select-Into Configuration -#################### - -# The maximum memory occupied by the data to be written when executing select-into statements. -# Datatype: long -# into_operation_buffer_size_in_byte=104857600 - -# The maximum number of rows can be processed in insert-tablet-plan when executing select-into statements. -# When <= 0, use 10000. -# Datatype: int -# select_into_insert_tablet_plan_row_limit=10000 - -# The number of threads in the thread pool that execute insert-tablet tasks -# Datatype: int -# into_operation_execution_thread_count=2 - -#################### -### Continuous Query Configuration -#################### - -# The number of threads in the scheduled thread pool that submit continuous query tasks periodically -# Datatype: int -# continuous_query_submit_thread_count=2 - -# The minimum value of the continuous query execution time interval -# Datatype: long(duration) -# continuous_query_min_every_interval_in_ms=1000 - -#################### -### Pipe Configuration -#################### - -# Uncomment the following field to configure the pipe lib directory. -# For Windows platform -# If its prefix is a drive specifier followed by "\\", or if its prefix is "\\\\", then the path is -# absolute. Otherwise, it is relative. -# pipe_lib_dir=ext\\pipe -# For Linux platform -# If its prefix is "/", then the path is absolute. Otherwise, it is relative. -# pipe_lib_dir=ext/pipe - -# The maximum number of threads that can be used to execute the pipe subtasks in PipeSubtaskExecutor. -# The actual value will be min(pipe_subtask_executor_max_thread_num, max(1, CPU core number / 2)). -# pipe_subtask_executor_max_thread_num=5 - -# The connection timeout (in milliseconds) for the thrift client. -# pipe_sink_timeout_ms=900000 - -# The maximum number of selectors that can be used in the sink. -# Recommend to set this value to less than or equal to pipe_sink_max_client_number. -# pipe_sink_selector_number=4 - -# The maximum number of clients that can be used in the sink. -# pipe_sink_max_client_number=16 - -# Whether to enable receiving pipe data through air gap. -# The receiver can only return 0 or 1 in tcp mode to indicate whether the data is received successfully. -# pipe_air_gap_receiver_enabled=false - -# The port for the server to receive pipe data through air gap. -# pipe_air_gap_receiver_port=9780 - -#################### -### RatisConsensus Configuration -#################### - -# max payload size for a single log-sync-RPC from leader to follower(in byte, by default 16MB) -# config_node_ratis_log_appender_buffer_size_max=16777216 -# schema_region_ratis_log_appender_buffer_size_max=16777216 -# data_region_ratis_log_appender_buffer_size_max=16777216 - -# trigger a snapshot when snapshot_trigger_threshold logs are written -# config_node_ratis_snapshot_trigger_threshold=400000 -# schema_region_ratis_snapshot_trigger_threshold=400000 -# data_region_ratis_snapshot_trigger_threshold=400000 - -# allow flushing Raft Log asynchronously -# config_node_ratis_log_unsafe_flush_enable=false -# schema_region_ratis_log_unsafe_flush_enable=false -# data_region_ratis_log_unsafe_flush_enable=false - -# max capacity of a single Log segment file (in byte, by default 24MB) -# config_node_ratis_log_segment_size_max_in_byte=25165824 -# schema_region_ratis_log_segment_size_max_in_byte=25165824 -# data_region_ratis_log_segment_size_max_in_byte=25165824 -# config_node_simple_consensus_log_segment_size_max_in_byte=25165824 - -# flow control window for ratis grpc log appender -# config_node_ratis_grpc_flow_control_window=4194304 -# schema_region_ratis_grpc_flow_control_window=4194304 -# data_region_ratis_grpc_flow_control_window=4194304 -# config_node_ratis_grpc_leader_outstanding_appends_max=128 -# schema_region_ratis_grpc_leader_outstanding_appends_max=128 -# data_region_ratis_grpc_leader_outstanding_appends_max=128 -# config_node_ratis_log_force_sync_num=128 -# schema_region_ratis_log_force_sync_num=128 -# data_region_ratis_log_force_sync_num=128 - -# min election timeout for leader election -# config_node_ratis_rpc_leader_election_timeout_min_ms=2000 -# schema_region_ratis_rpc_leader_election_timeout_min_ms=2000 -# data_region_ratis_rpc_leader_election_timeout_min_ms=2000 - -# max election timeout for leader election -# config_node_ratis_rpc_leader_election_timeout_max_ms=4000 -# schema_region_ratis_rpc_leader_election_timeout_max_ms=4000 -# data_region_ratis_rpc_leader_election_timeout_max_ms=4000 - -# ratis client retry threshold -# config_node_ratis_request_timeout_ms=10000 -# schema_region_ratis_request_timeout_ms=10000 -# data_region_ratis_request_timeout_ms=10000 - -# currently we use exponential back-off retry policy for ratis -# config_node_ratis_max_retry_attempts=10 -# config_node_ratis_initial_sleep_time_ms=100 -# config_node_ratis_max_sleep_time_ms=10000 -# schema_region_ratis_max_retry_attempts=10 -# schema_region_ratis_initial_sleep_time_ms=100 -# schema_region_ratis_max_sleep_time_ms=10000 -# data_region_ratis_max_retry_attempts=10 -# data_region_ratis_initial_sleep_time_ms=100 -# data_region_ratis_max_sleep_time_ms=10000 - -# first election timeout -# ratis_first_election_timeout_min_ms=50 -# ratis_first_election_timeout_max_ms=150 - -# preserve certain logs when take snapshot and purge -# config_node_ratis_preserve_logs_num_when_purge=1000 -# schema_region_ratis_preserve_logs_num_when_purge=1000 -# data_region_ratis_preserve_logs_num_when_purge=1000 - -# Raft Log disk size control -# config_node_ratis_log_max_size = 2147483648 -# schema_region_ratis_log_max_size = 2147483648 -# data_region_ratis_log_max_size = 21474836480 - -# Raft periodic snapshot interval, time unit is second -# config_node_ratis_periodic_snapshot_interval=86400 -# schema_region_ratis_periodic_snapshot_interval=86400 -# data_region_ratis_periodic_snapshot_interval=86400 - -#################### -### Procedure Configuration -#################### - -# Default number of worker thread count -# Datatype: int -# procedure_core_worker_thread_count=4 - -# Default time interval of completed procedure cleaner work in, time unit is second -# Datatype: int -# procedure_completed_clean_interval=30 - -# Default ttl of completed procedure, time unit is second -# Datatype: int -# procedure_completed_evict_ttl=800 - -#################### -### MQTT Broker Configuration -#################### - -# whether to enable the mqtt service. -# Datatype: boolean -# enable_mqtt_service=false - -# the mqtt service binding host. -# Datatype: String -# mqtt_host=127.0.0.1 - -# the mqtt service binding port. -# Datatype: int -# mqtt_port=1883 - -# the handler pool size for handing the mqtt messages. -# Datatype: int -# mqtt_handler_pool_size=1 - -# the mqtt message payload formatter. -# Datatype: String -# mqtt_payload_formatter=json - -# max length of mqtt message in byte -# Datatype: int -# mqtt_max_message_size=1048576 - -#################### -### IoTDB-ML Configuration -#################### - -# The thread count which can be used for model inference operation. -# model_inference_execution_thread_count=5 - -#################### -### Load TsFile Configuration -#################### - -# Load clean up task is used to clean up the unsuccessful loaded tsfile after a certain period of time. -# The parameter is the delay time after an unsuccessful load operation (in seconds). -# load_clean_up_task_execution_delay_time_seconds=1800 From f08b91bece2927c8fa816c24958ae383f3673568 Mon Sep 17 00:00:00 2001 From: shuwenwei Date: Wed, 22 May 2024 11:17:32 +0800 Subject: [PATCH 09/20] fix bug --- .../assembly/resources/sbin/start-confignode.bat | 16 ++++++++-------- .../assembly/resources/sbin/stop-confignode.bat | 4 ++-- .../assembly/resources/sbin/stop-datanode.bat | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/iotdb-core/confignode/src/assembly/resources/sbin/start-confignode.bat b/iotdb-core/confignode/src/assembly/resources/sbin/start-confignode.bat index f73f13d21c00..98399a9990bf 100644 --- a/iotdb-core/confignode/src/assembly/resources/sbin/start-confignode.bat +++ b/iotdb-core/confignode/src/assembly/resources/sbin/start-confignode.bat @@ -84,14 +84,14 @@ IF EXIST "%CONFIGNODE_CONF%\confignode-env.bat" ( @REM CHECK THE PORT USAGES @REM SET CONFIG FILE -IF EXIST "%IOTDB_CONF%\iotdb-system.properties" ( - set CONFIG_FILE="%IOTDB_CONF%\iotdb-system.properties" -) ELSE IF EXIST "%IOTDB_HOME%\conf\iotdb-system.properties" ( - set CONFIG_FILE="%IOTDB_HOME%\conf\iotdb-system.properties" -) ELSE IF EXIST "%IOTDB_CONF%\iotdb-confignode.properties" ( - set CONFIG_FILE="%IOTDB_CONF%\iotdb-confignode.properties" -) ELSE IF EXIST "%IOTDB_HOME%\conf\iotdb-confignode.properties" ( - set CONFIG_FILE="%IOTDB_HOME%\conf\iotdb-confignode.properties" +IF EXIST "%CONFIGNODE_CONF%\iotdb-system.properties" ( + set CONFIG_FILE="%CONFIGNODE_CONF%\iotdb-system.properties" +) ELSE IF EXIST "%CONFIGNODE_HOME%\conf\iotdb-system.properties" ( + set CONFIG_FILE="%CONFIGNODE_HOME%\conf\iotdb-system.properties" +) ELSE IF EXIST "%CONFIGNODE_CONF%\iotdb-confignode.properties" ( + set CONFIG_FILE="%CONFIGNODE_CONF%\iotdb-confignode.properties" +) ELSE IF EXIST "%CONFIGNODE_HOME%\conf\iotdb-confignode.properties" ( + set CONFIG_FILE="%CONFIGNODE_HOME%\conf\iotdb-confignode.properties" ) ELSE ( set CONFIG_FILE= ) diff --git a/iotdb-core/confignode/src/assembly/resources/sbin/stop-confignode.bat b/iotdb-core/confignode/src/assembly/resources/sbin/stop-confignode.bat index f7db1e156d36..e69764266887 100644 --- a/iotdb-core/confignode/src/assembly/resources/sbin/stop-confignode.bat +++ b/iotdb-core/confignode/src/assembly/resources/sbin/stop-confignode.bat @@ -23,9 +23,9 @@ set current_dir=%~dp0 set superior_dir=%current_dir%\..\ IF EXIST "%superior%\conf\iotdb-system.properties" ( - set config_file="%superior_dir%\iotdb-system.properties" + set config_file="%superior_dir%\conf\iotdb-system.properties" ) ELSE ( - set config_file="%superior_dir%\iotdb-confignode.properties" + set config_file="%superior_dir%\conf\iotdb-confignode.properties" ) for /f "eol=; tokens=2,2 delims==" %%i in ('findstr /i "^cn_internal_port" diff --git a/iotdb-core/datanode/src/assembly/resources/sbin/stop-datanode.bat b/iotdb-core/datanode/src/assembly/resources/sbin/stop-datanode.bat index 27d09f156b1d..d249d4275674 100644 --- a/iotdb-core/datanode/src/assembly/resources/sbin/stop-datanode.bat +++ b/iotdb-core/datanode/src/assembly/resources/sbin/stop-datanode.bat @@ -23,9 +23,9 @@ set current_dir=%~dp0 set superior_dir=%current_dir%\..\ IF EXIST "%superior%\conf\iotdb-system.properties" ( - set config_file="%superior_dir%\iotdb-system.properties" + set config_file="%superior_dir%\conf\iotdb-system.properties" ) ELSE ( - set config_file="%superior_dir%\iotdb-datanode.properties" + set config_file="%superior_dir%\conf\iotdb-datanode.properties" ) for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^dn_rpc_port" From ae8e574405ae8edd9d670944f18295a9ce28f624 Mon Sep 17 00:00:00 2001 From: shuwenwei Date: Wed, 22 May 2024 11:41:07 +0800 Subject: [PATCH 10/20] fix cli scripts --- iotdb-client/cli/src/assembly/resources/tools/backup.bat | 7 ++++++- iotdb-client/cli/src/assembly/resources/tools/backup.sh | 7 ++++++- .../cli/src/assembly/resources/tools/collect-info.bat | 6 +++++- .../cli/src/assembly/resources/tools/collect-info.sh | 6 +++++- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/iotdb-client/cli/src/assembly/resources/tools/backup.bat b/iotdb-client/cli/src/assembly/resources/tools/backup.bat index 13178b7f9bb4..01be45f9ca01 100644 --- a/iotdb-client/cli/src/assembly/resources/tools/backup.bat +++ b/iotdb-client/cli/src/assembly/resources/tools/backup.bat @@ -38,7 +38,12 @@ IF EXIST "%IOTDB_CONF%\datanode-env.bat" ( echo Can't find datanode-env.bat ) -IF EXIST "%IOTDB_CONF%\iotdb-datanode.properties" ( +IF EXIST "%IOTDB_CONF%\iotdb-system.properties" ( + for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^dn_rpc_port" + "%IOTDB_CONF%\iotdb-system.properties"') do ( + set dn_rpc_port=%%i + ) +) ELSE IF EXIST "%IOTDB_CONF%\iotdb-datanode.properties" ( for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^dn_rpc_port" "%IOTDB_CONF%\iotdb-datanode.properties"') do ( set dn_rpc_port=%%i diff --git a/iotdb-client/cli/src/assembly/resources/tools/backup.sh b/iotdb-client/cli/src/assembly/resources/tools/backup.sh index a77a0e3c489c..d05bc8638532 100644 --- a/iotdb-client/cli/src/assembly/resources/tools/backup.sh +++ b/iotdb-client/cli/src/assembly/resources/tools/backup.sh @@ -70,7 +70,12 @@ get_properties_value() { local file_name=$1 local property_name=$2 local default_value=$3 - local property_value=$(sed "/^${property_name}=/!d;s/.*=//" "${IOTDB_HOME}/conf/${file_name}.properties") + if [ -f "${IOTDB_HOME}/conf/iotdb-system.properties" ]; then + local file_path="${IOTDB_HOME}/conf/iotdb-system.properties" + else + local file_path="${IOTDB_HOME}/conf/${file_name}.properties" + fi + local property_value=$(sed "/^${property_name}=/!d;s/.*=//" "${file_path}") if [ -z "$property_value" ]; then property_value="$default_value" fi diff --git a/iotdb-client/cli/src/assembly/resources/tools/collect-info.bat b/iotdb-client/cli/src/assembly/resources/tools/collect-info.bat index 0c87d0cba994..246228b9187e 100644 --- a/iotdb-client/cli/src/assembly/resources/tools/collect-info.bat +++ b/iotdb-client/cli/src/assembly/resources/tools/collect-info.bat @@ -46,7 +46,11 @@ set "passwd_param=root" set "host_param=127.0.0.1" set "port_param=6667" -set "properties_file=%IOTDB_HOME%\conf\iotdb-datanode.properties" +if exist "%IOTDB_HOME%\conf\iotdb-system.properties" ( + set "properties_file=%IOTDB_HOME%\conf\iotdb-system.properties" +) else ( + set "properties_file=%IOTDB_HOME%\conf\iotdb-datanode.properties" +) set "key=dn_data_dirs" for /f "usebackq tokens=1,* delims==" %%a in ("%properties_file%") do ( diff --git a/iotdb-client/cli/src/assembly/resources/tools/collect-info.sh b/iotdb-client/cli/src/assembly/resources/tools/collect-info.sh index a01714b289d7..1926309374a8 100644 --- a/iotdb-client/cli/src/assembly/resources/tools/collect-info.sh +++ b/iotdb-client/cli/src/assembly/resources/tools/collect-info.sh @@ -85,7 +85,11 @@ choose_unit() { echo "$unit" } -properties_file="$IOTDB_HOME/conf/iotdb-datanode.properties" +if [ -f "$IOTDB_HOME/conf/iotdb-system.properties" ]; then + properties_file="$IOTDB_HOME/conf/iotdb-system.properties" +else + properties_file="$IOTDB_HOME/conf/iotdb-datanode.properties" +fi data_dir_key="dn_data_dirs" value=$(get_property_value "$properties_file" "$data_dir_key") if [ -n "$value" ]; then From 13cf9ad392632a05fb7135bc86b6fc93ff214292 Mon Sep 17 00:00:00 2001 From: shuwenwei Date: Fri, 24 May 2024 09:36:00 +0800 Subject: [PATCH 11/20] fix it --- .../org/apache/iotdb/it/env/cluster/config/MppBaseConfig.java | 2 +- .../apache/iotdb/it/env/cluster/node/AbstractNodeWrapper.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppBaseConfig.java b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppBaseConfig.java index 04e5dae88724..473d2f1b64c7 100644 --- a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppBaseConfig.java +++ b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppBaseConfig.java @@ -97,7 +97,7 @@ public final void updateProperties(@Nullable String filePath) throws IOException * @throws IOException if properties storage failed. */ public final void persistent(String filePath) throws IOException { - try (FileWriter confOutput = new FileWriter(filePath)) { + try (FileWriter confOutput = new FileWriter(filePath, true)) { properties.store(confOutput, null); } } diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/AbstractNodeWrapper.java b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/AbstractNodeWrapper.java index 45a1188a4ca9..cdbee3d32ab1 100644 --- a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/AbstractNodeWrapper.java +++ b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/AbstractNodeWrapper.java @@ -301,6 +301,7 @@ public final void changeConfig( outputNodeConfig.updateProperties(immutableNodeProperties); // Persistent + Files.deleteIfExists(new File(getTargetNodeConfigPath()).toPath()); outputCommonConfig.persistent(getTargetCommonConfigPath()); outputNodeConfig.persistent(getTargetNodeConfigPath()); } catch (IOException ex) { From 2d086669819d49204a57414aa8111e4c02214fb9 Mon Sep 17 00:00:00 2001 From: Haonan Date: Fri, 24 May 2024 10:52:29 +0800 Subject: [PATCH 12/20] Update client-go.yml --- .github/workflows/client-go.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/client-go.yml b/.github/workflows/client-go.yml index d4743f8434fe..bc85763f966d 100644 --- a/.github/workflows/client-go.yml +++ b/.github/workflows/client-go.yml @@ -53,4 +53,6 @@ jobs: - name: Integration test shell: bash run: | - cd iotdb-client/client-go/ && make e2e_test_for_parent_git_repo e2e_test_clean_for_parent_git_repo + cd iotdb-client/client-go/ + git pull origin main + make e2e_test_for_parent_git_repo e2e_test_clean_for_parent_git_repo From eb3f24aee5ce830334be5e53f735890e3ae10670 Mon Sep 17 00:00:00 2001 From: Haonan Date: Fri, 24 May 2024 10:58:38 +0800 Subject: [PATCH 13/20] Update client-go.yml --- .github/workflows/client-go.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/client-go.yml b/.github/workflows/client-go.yml index bc85763f966d..8e658d7846ab 100644 --- a/.github/workflows/client-go.yml +++ b/.github/workflows/client-go.yml @@ -54,5 +54,6 @@ jobs: shell: bash run: | cd iotdb-client/client-go/ + git config pull.ff only git pull origin main make e2e_test_for_parent_git_repo e2e_test_clean_for_parent_git_repo From c30b8af6ade1795d32ee2f3fa3d5cecfc2f64dbc Mon Sep 17 00:00:00 2001 From: Haonan Date: Fri, 24 May 2024 11:04:56 +0800 Subject: [PATCH 14/20] Update client-go.yml --- .github/workflows/client-go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/client-go.yml b/.github/workflows/client-go.yml index 8e658d7846ab..6bf0bd60661c 100644 --- a/.github/workflows/client-go.yml +++ b/.github/workflows/client-go.yml @@ -54,6 +54,6 @@ jobs: shell: bash run: | cd iotdb-client/client-go/ - git config pull.ff only + git config pull.rebase false git pull origin main make e2e_test_for_parent_git_repo e2e_test_clean_for_parent_git_repo From 989953ef67f8c8b34b1f34d4d906c196ae1f88f4 Mon Sep 17 00:00:00 2001 From: Haonan Date: Fri, 24 May 2024 11:13:52 +0800 Subject: [PATCH 15/20] Update client-go.yml --- .github/workflows/client-go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/client-go.yml b/.github/workflows/client-go.yml index 6bf0bd60661c..a12cd8e5d89f 100644 --- a/.github/workflows/client-go.yml +++ b/.github/workflows/client-go.yml @@ -55,5 +55,5 @@ jobs: run: | cd iotdb-client/client-go/ git config pull.rebase false - git pull origin main + git pull origin main --allow-unrelated-histories make e2e_test_for_parent_git_repo e2e_test_clean_for_parent_git_repo From 7e56c2c3fd764d8649e57a220d8b650249b6a1f1 Mon Sep 17 00:00:00 2001 From: Haonan Date: Fri, 24 May 2024 11:36:41 +0800 Subject: [PATCH 16/20] Update client-go.yml --- .github/workflows/client-go.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/client-go.yml b/.github/workflows/client-go.yml index a12cd8e5d89f..fddd89795a91 100644 --- a/.github/workflows/client-go.yml +++ b/.github/workflows/client-go.yml @@ -53,7 +53,7 @@ jobs: - name: Integration test shell: bash run: | - cd iotdb-client/client-go/ - git config pull.rebase false - git pull origin main --allow-unrelated-histories + cd iotdb-client + git clone https://github.com/apache/iotdb-client-go.git + cd iotdb-client-go make e2e_test_for_parent_git_repo e2e_test_clean_for_parent_git_repo From 907e5d397cfae5f251c708ec072a1ce2103b5936 Mon Sep 17 00:00:00 2001 From: shuwenwei Date: Mon, 27 May 2024 09:54:28 +0800 Subject: [PATCH 17/20] fix it --- .../it/env/cluster/node/AbstractNodeWrapper.java | 9 +++------ .../it/env/cluster/node/ConfigNodeWrapper.java | 7 +------ .../iotdb/it/env/cluster/node/DataNodeWrapper.java | 7 +------ .../org/apache/iotdb/db/conf/IoTDBDescriptor.java | 14 -------------- 4 files changed, 5 insertions(+), 32 deletions(-) diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/AbstractNodeWrapper.java b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/AbstractNodeWrapper.java index cdbee3d32ab1..80b78c4fc2dd 100644 --- a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/AbstractNodeWrapper.java +++ b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/AbstractNodeWrapper.java @@ -301,9 +301,8 @@ public final void changeConfig( outputNodeConfig.updateProperties(immutableNodeProperties); // Persistent - Files.deleteIfExists(new File(getTargetNodeConfigPath()).toPath()); - outputCommonConfig.persistent(getTargetCommonConfigPath()); - outputNodeConfig.persistent(getTargetNodeConfigPath()); + outputCommonConfig.persistent(getSystemConfigPath()); + outputNodeConfig.persistent(getSystemConfigPath()); } catch (IOException ex) { throw new AssertionError("Change the config of node failed. " + ex); } @@ -662,9 +661,7 @@ private String getKillPoints() { protected abstract void renameFile(); - protected abstract String getTargetNodeConfigPath(); - - protected abstract String getTargetCommonConfigPath(); + protected abstract String getSystemConfigPath(); /** Return the node config file path specified through system variable */ protected abstract String getDefaultNodeConfigPath(); diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/ConfigNodeWrapper.java b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/ConfigNodeWrapper.java index 6bd90c9d36cd..a807fb2af202 100644 --- a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/ConfigNodeWrapper.java +++ b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/ConfigNodeWrapper.java @@ -89,12 +89,7 @@ public ConfigNodeWrapper( } @Override - protected String getTargetNodeConfigPath() { - return workDirFilePath("conf", IOTDB_SYSTEM_PROPERTIES_FILE); - } - - @Override - protected String getTargetCommonConfigPath() { + protected String getSystemConfigPath() { return workDirFilePath("conf", IOTDB_SYSTEM_PROPERTIES_FILE); } diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/DataNodeWrapper.java b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/DataNodeWrapper.java index 0a12cfae43c3..1135f5cd055c 100644 --- a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/DataNodeWrapper.java +++ b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/DataNodeWrapper.java @@ -123,12 +123,7 @@ public DataNodeWrapper( } @Override - protected String getTargetNodeConfigPath() { - return workDirFilePath("conf", IOTDB_SYSTEM_PROPERTIES_FILE); - } - - @Override - protected String getTargetCommonConfigPath() { + protected String getSystemConfigPath() { return workDirFilePath("conf", IOTDB_SYSTEM_PROPERTIES_FILE); } diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java index 1ad67a99da5e..d3f502160efa 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java @@ -1752,20 +1752,6 @@ public void loadHotModifiedProps() throws QueryProcessException { } } - private void loadHotModifiedPropertiesFromUrl(Properties commonProperties, URL url) - throws QueryProcessException { - try (InputStream inputStream = url.openStream()) { - LOGGER.info("Start to reload config file {}", url); - Properties properties = new Properties(); - properties.load(new InputStreamReader(inputStream, StandardCharsets.UTF_8)); - commonProperties.putAll(properties); - } catch (Exception e) { - LOGGER.warn("Fail to reload config file {}", url, e); - throw new QueryProcessException( - String.format("Fail to reload config file %s because %s", url, e.getMessage())); - } - } - private void initMemoryAllocate(Properties properties) { String memoryAllocateProportion = properties.getProperty("datanode_memory_proportion", null); if (memoryAllocateProportion == null) { From 573a7b1af02075ebcfe79b1d40b4585baf6f5088 Mon Sep 17 00:00:00 2001 From: shuwenwei Date: Tue, 28 May 2024 12:27:06 +0800 Subject: [PATCH 18/20] fix metric it --- .../confignode/conf/ConfigNodeDescriptor.java | 2 +- .../apache/iotdb/db/conf/IoTDBDescriptor.java | 5 +- .../config/MetricConfigDescriptor.java | 73 +++++++++++++------ .../metrics/config/MetricConfigTest.java | 4 +- 4 files changed, 55 insertions(+), 29 deletions(-) diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeDescriptor.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeDescriptor.java index db777cfa26d7..ce713b2e0e89 100644 --- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeDescriptor.java +++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeDescriptor.java @@ -130,7 +130,7 @@ private void loadProps() { commonDescriptor .getConfig() .updatePath(System.getProperty(ConfigNodeConstant.CONFIGNODE_HOME, null)); - MetricConfigDescriptor.getInstance().loadProps(commonProperties); + MetricConfigDescriptor.getInstance().loadProps(commonProperties, true); MetricConfigDescriptor.getInstance() .getMetricConfig() .updateRpcInstance( diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java index fa804f60ba1a..296030c03f71 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java @@ -211,7 +211,7 @@ private void loadProps() { // update all data seriesPath conf.updatePath(); commonDescriptor.getConfig().updatePath(System.getProperty(IoTDBConstant.IOTDB_HOME, null)); - MetricConfigDescriptor.getInstance().loadProps(commonProperties); + MetricConfigDescriptor.getInstance().loadProps(commonProperties, false); MetricConfigDescriptor.getInstance() .getMetricConfig() .updateRpcInstance( @@ -1791,7 +1791,8 @@ public void loadHotModifiedProps() throws QueryProcessException { throw new QueryProcessException( String.format("Fail to reload config file %s because %s", url, e.getMessage())); } - ReloadLevel reloadLevel = MetricConfigDescriptor.getInstance().loadHotProps(commonProperties); + ReloadLevel reloadLevel = + MetricConfigDescriptor.getInstance().loadHotProps(commonProperties, false); LOGGER.info("Reload metric service in level {}", reloadLevel); if (reloadLevel == ReloadLevel.RESTART_INTERNAL_REPORTER) { IoTDBInternalReporter internalReporter; diff --git a/iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/config/MetricConfigDescriptor.java b/iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/config/MetricConfigDescriptor.java index e053587713da..f1ec288d47ad 100644 --- a/iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/config/MetricConfigDescriptor.java +++ b/iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/config/MetricConfigDescriptor.java @@ -37,8 +37,8 @@ private MetricConfigDescriptor() { } /** Load properties into metric config. */ - public void loadProps(Properties properties) { - MetricConfig loadConfig = generateFromProperties(properties); + public void loadProps(Properties properties, boolean isConfigNode) { + MetricConfig loadConfig = generateFromProperties(properties, isConfigNode); metricConfig.copy(loadConfig); } @@ -47,8 +47,8 @@ public void loadProps(Properties properties) { * * @return reload level of metric service */ - public ReloadLevel loadHotProps(Properties properties) { - MetricConfig newMetricConfig = generateFromProperties(properties); + public ReloadLevel loadHotProps(Properties properties, boolean isConfigNode) { + MetricConfig newMetricConfig = generateFromProperties(properties, isConfigNode); ReloadLevel reloadLevel = ReloadLevel.NOTHING; if (!metricConfig.equals(newMetricConfig)) { if (!metricConfig.getMetricLevel().equals(newMetricConfig.getMetricLevel()) @@ -72,7 +72,7 @@ public ReloadLevel loadHotProps(Properties properties) { } /** Load properties into metric config. */ - private MetricConfig generateFromProperties(Properties properties) { + private MetricConfig generateFromProperties(Properties properties, boolean isConfigNode) { MetricConfig loadConfig = new MetricConfig(); String reporterList = @@ -83,73 +83,98 @@ private MetricConfig generateFromProperties(Properties properties) { loadConfig.getMetricReporterList().stream() .map(ReporterType::toString) .collect(Collectors.toSet())), - properties); + properties, + isConfigNode); loadConfig.setMetricReporterList(reporterList); loadConfig.setMetricLevel( MetricLevel.valueOf( - getProperty("metric_level", String.valueOf(loadConfig.getMetricLevel()), properties))); + getProperty( + "metric_level", + String.valueOf(loadConfig.getMetricLevel()), + properties, + isConfigNode))); loadConfig.setAsyncCollectPeriodInSecond( Integer.parseInt( getProperty( "metric_async_collect_period", String.valueOf(loadConfig.getAsyncCollectPeriodInSecond()), - properties))); + properties, + isConfigNode))); loadConfig.setPrometheusReporterPort( Integer.parseInt( getProperty( "metric_prometheus_reporter_port", String.valueOf(loadConfig.getPrometheusReporterPort()), - properties))); + properties, + isConfigNode))); IoTDBReporterConfig reporterConfig = loadConfig.getIoTDBReporterConfig(); reporterConfig.setHost( - getProperty("metric_iotdb_reporter_host", reporterConfig.getHost(), properties)); + getProperty( + "metric_iotdb_reporter_host", reporterConfig.getHost(), properties, isConfigNode)); reporterConfig.setPort( Integer.valueOf( getProperty( "metric_iotdb_reporter_port", String.valueOf(reporterConfig.getPort()), - properties))); + properties, + isConfigNode))); reporterConfig.setUsername( - getProperty("metric_iotdb_reporter_username", reporterConfig.getUsername(), properties)); + getProperty( + "metric_iotdb_reporter_username", + reporterConfig.getUsername(), + properties, + isConfigNode)); reporterConfig.setPassword( - getProperty("metric_iotdb_reporter_password", reporterConfig.getPassword(), properties)); + getProperty( + "metric_iotdb_reporter_password", + reporterConfig.getPassword(), + properties, + isConfigNode)); reporterConfig.setMaxConnectionNumber( Integer.valueOf( getProperty( "metric_iotdb_reporter_max_connection_number", String.valueOf(reporterConfig.getMaxConnectionNumber()), - properties))); + properties, + isConfigNode))); reporterConfig.setLocation( - getProperty("metric_iotdb_reporter_location", reporterConfig.getLocation(), properties)); + getProperty( + "metric_iotdb_reporter_location", + reporterConfig.getLocation(), + properties, + isConfigNode)); reporterConfig.setPushPeriodInSecond( Integer.valueOf( getProperty( "metric_iotdb_reporter_push_period", String.valueOf(reporterConfig.getPushPeriodInSecond()), - properties))); - loadConfig.setInternalReportType( - InternalReporterType.valueOf( - properties.getProperty( - "dn_metric_internal_reporter_type", - loadConfig.getInternalReportType().toString()))); + properties, + isConfigNode))); + if (!isConfigNode) { + loadConfig.setInternalReportType( + InternalReporterType.valueOf( + properties.getProperty( + "dn_metric_internal_reporter_type", + loadConfig.getInternalReportType().toString()))); + } return loadConfig; } /** Get property from confignode or datanode. */ - private String getProperty(String target, String defaultValue, Properties properties) { - return properties.getProperty( - "dn_" + target, properties.getProperty("cn_" + target, defaultValue)); + private String getProperty( + String target, String defaultValue, Properties properties, boolean isConfigNode) { + return properties.getProperty((isConfigNode ? "cn_" : "dn_") + target, defaultValue); } private static class MetricConfigDescriptorHolder { diff --git a/iotdb-core/metrics/interface/src/test/java/org/apache/iotdb/metrics/config/MetricConfigTest.java b/iotdb-core/metrics/interface/src/test/java/org/apache/iotdb/metrics/config/MetricConfigTest.java index 3ce4b79c6b78..43382d00aedd 100644 --- a/iotdb-core/metrics/interface/src/test/java/org/apache/iotdb/metrics/config/MetricConfigTest.java +++ b/iotdb-core/metrics/interface/src/test/java/org/apache/iotdb/metrics/config/MetricConfigTest.java @@ -47,7 +47,7 @@ public void testConfigNodeMetricConfig() { properties.setProperty("cn_metric_iotdb_reporter_location", "metric"); properties.setProperty("cn_metric_iotdb_reporter_push_period", "5"); - MetricConfigDescriptor.getInstance().loadProps(properties); + MetricConfigDescriptor.getInstance().loadProps(properties, true); MetricConfig metricConfig = MetricConfigDescriptor.getInstance().getMetricConfig(); @@ -84,7 +84,7 @@ public void testDataNodeMetricConfig() { properties.setProperty("dn_metric_iotdb_reporter_push_period", "5"); properties.setProperty("dn_metric_internal_reporter_type", "IOTDB"); - MetricConfigDescriptor.getInstance().loadProps(properties); + MetricConfigDescriptor.getInstance().loadProps(properties, false); MetricConfig metricConfig = MetricConfigDescriptor.getInstance().getMetricConfig(); From 56fbc8e45e129e0478abe0bceebf390f8995620e Mon Sep 17 00:00:00 2001 From: shuwenwei Date: Thu, 30 May 2024 18:31:00 +0800 Subject: [PATCH 19/20] check total wait time and add warn log --- .../commons/conf/ConfigFileAutoUpdateTool.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/ConfigFileAutoUpdateTool.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/ConfigFileAutoUpdateTool.java index e28d6b23c50a..e3c63bd5d54c 100644 --- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/ConfigFileAutoUpdateTool.java +++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/ConfigFileAutoUpdateTool.java @@ -19,6 +19,9 @@ package org.apache.iotdb.commons.conf; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.File; import java.io.IOException; import java.io.RandomAccessFile; @@ -29,6 +32,9 @@ public class ConfigFileAutoUpdateTool { private final String lockFileSuffix = ".lock"; + private final long maxTimeMillsToAcquireLock = TimeUnit.SECONDS.toMillis(20); + private final long waitTimeMillsPerCheck = TimeUnit.MILLISECONDS.toMillis(100); + private Logger logger = LoggerFactory.getLogger(ConfigFileAutoUpdateTool.class); private String license = "#\n" + "# Licensed to the Apache Software Foundation (ASF) under one\n" @@ -98,13 +104,16 @@ private String readConfigLines(File file) throws IOException { } private void acquireTargetFileLock(File file) throws IOException, InterruptedException { - long waitTime = System.currentTimeMillis() + TimeUnit.SECONDS.toMillis(20); - while (System.currentTimeMillis() < waitTime) { + long totalWaitTime = 0; + while (totalWaitTime < maxTimeMillsToAcquireLock) { if (file.createNewFile()) { return; } - Thread.sleep(TimeUnit.MICROSECONDS.toMillis(100)); + totalWaitTime += waitTimeMillsPerCheck; + Thread.sleep(waitTimeMillsPerCheck); } + logger.warn( + "Waiting for {} seconds to acquire configuration file update lock", totalWaitTime / 1000); } private void releaseFileLock(File file) throws IOException { From 50c3032f7da93d62748ea149911e83d90cc0e173 Mon Sep 17 00:00:00 2001 From: shuwenwei Date: Thu, 30 May 2024 18:36:44 +0800 Subject: [PATCH 20/20] modify warn log --- .../apache/iotdb/commons/conf/ConfigFileAutoUpdateTool.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/ConfigFileAutoUpdateTool.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/ConfigFileAutoUpdateTool.java index e3c63bd5d54c..49b44f0bc02f 100644 --- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/ConfigFileAutoUpdateTool.java +++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/ConfigFileAutoUpdateTool.java @@ -113,7 +113,11 @@ private void acquireTargetFileLock(File file) throws IOException, InterruptedExc Thread.sleep(waitTimeMillsPerCheck); } logger.warn( - "Waiting for {} seconds to acquire configuration file update lock", totalWaitTime / 1000); + "Waiting for {} seconds to acquire configuration file update lock." + + " There may have been an unexpected interruption in the last" + + " configuration file update. Ignore temporary file {}", + totalWaitTime / 1000, + file.getName()); } private void releaseFileLock(File file) throws IOException {