Skip to content

Commit 9b2efea

Browse files
shuwenweiHTHou
andauthored
Merge config files to iotdb-system.properties (apache#12570)
Co-authored-by: Haonan <[email protected]>
1 parent a4a7be0 commit 9b2efea

File tree

57 files changed

+1022
-924
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1022
-924
lines changed

.github/workflows/multi-language-client.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@ jobs:
9797
- name: Integration test
9898
shell: bash
9999
run: |
100-
cd iotdb-client/client-go/ && make e2e_test_for_parent_git_repo e2e_test_clean_for_parent_git_repo
100+
cd iotdb-client
101+
git clone https://github.com/apache/iotdb-client-go.git
102+
cd iotdb-client-go
103+
make e2e_test_for_parent_git_repo e2e_test_clean_for_parent_git_repo
101104
102105
python:
103106
runs-on: ubuntu-latest

docker/src/main/DockerCompose/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function on_stop(){
3636
trap 'on_stop' SIGTERM SIGKILL SIGQUIT
3737

3838

39-
replace-conf-from-env.sh ${start_what}
39+
replace-conf-from-env.sh
4040

4141
case "$1" in
4242
datanode)

docker/src/main/DockerCompose/replace-conf-from-env.sh

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#
2020

2121
conf_path=${IOTDB_HOME}/conf
22+
target_files="iotdb-system.properties"
2223

2324
function process_single(){
2425
local key_value="$1"
@@ -48,17 +49,5 @@ function replace_configs(){
4849
done
4950
}
5051

51-
case "$1" in
52-
confignode)
53-
target_files="iotdb-common.properties iotdb-confignode.properties"
54-
;;
55-
datanode)
56-
target_files="iotdb-common.properties iotdb-datanode.properties"
57-
;;
58-
all)
59-
target_files="iotdb-common.properties iotdb-confignode.properties iotdb-datanode.properties"
60-
;;
61-
esac
62-
6352
replace_configs
6453

docker/src/main/Dockerfile-1c1d

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ RUN apt update \
3030
&& rm /apache-iotdb-*-bin.zip \
3131
&& mv /apache-iotdb-* /iotdb \
3232
&& mv /start-1c1d.sh /iotdb/sbin \
33-
&& sed -i 's/dn_internal_address=127.0.0.1/dn_internal_address=0.0.0.0/g' /iotdb/conf/iotdb-datanode.properties \
34-
&& sed -i 's/cn_internal_address=127.0.0.1/cn_internal_address=0.0.0.0/g' /iotdb/conf/iotdb-confignode.properties \
35-
&& 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 \
36-
&& 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 \
37-
&& 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 \
38-
&& 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 \
39-
&& 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 \
33+
&& sed -i 's/dn_internal_address=127.0.0.1/dn_internal_address=0.0.0.0/g' /iotdb/conf/iotdb-system.properties \
34+
&& sed -i 's/cn_internal_address=127.0.0.1/cn_internal_address=0.0.0.0/g' /iotdb/conf/iotdb-system.properties \
35+
&& 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 \
36+
&& 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 \
37+
&& 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 \
38+
&& 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 \
39+
&& 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 \
4040
&& apt remove unzip -y \
4141
&& apt autoremove -y \
4242
&& apt purge --auto-remove -y \

integration-test/src/main/java/org/apache/iotdb/it/env/cluster/ClusterConstant.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ public class ClusterConstant {
118118
public static final String CONFIG_NODE_PROPERTIES_FILE = "iotdb-confignode.properties";
119119
public static final String DATA_NODE_PROPERTIES_FILE = "iotdb-datanode.properties";
120120
public static final String COMMON_PROPERTIES_FILE = "iotdb-common.properties";
121+
public static final String IOTDB_SYSTEM_PROPERTIES_FILE = "iotdb-system.properties";
121122

122123
public static final String SYSTEM_PROPERTIES_FILE = "system.properties";
123124
public static final String CONFIG_NODE_SYSTEM_PROPERTIES_FILE = "confignode-system.properties";

integration-test/src/main/java/org/apache/iotdb/it/env/cluster/config/MppBaseConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public final void updateProperties(@Nullable String filePath) throws IOException
9797
* @throws IOException if properties storage failed.
9898
*/
9999
public final void persistent(String filePath) throws IOException {
100-
try (FileWriter confOutput = new FileWriter(filePath)) {
100+
try (FileWriter confOutput = new FileWriter(filePath, true)) {
101101
properties.store(confOutput, null);
102102
}
103103
}

integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/AbstractNodeWrapper.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ public final void changeConfig(
301301
outputNodeConfig.updateProperties(immutableNodeProperties);
302302

303303
// Persistent
304-
outputCommonConfig.persistent(getTargetCommonConfigPath());
305-
outputNodeConfig.persistent(getTargetNodeConfigPath());
304+
outputCommonConfig.persistent(getSystemConfigPath());
305+
outputNodeConfig.persistent(getSystemConfigPath());
306306
} catch (IOException ex) {
307307
throw new AssertionError("Change the config of node failed. " + ex);
308308
}
@@ -662,9 +662,7 @@ private String getKillPoints() {
662662

663663
protected abstract void renameFile();
664664

665-
protected abstract String getTargetNodeConfigPath();
666-
667-
protected abstract String getTargetCommonConfigPath();
665+
protected abstract String getSystemConfigPath();
668666

669667
/** Return the node config file path specified through system variable */
670668
protected abstract String getDefaultNodeConfigPath();

integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/ConfigNodeWrapper.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,16 @@
3333
import static org.apache.iotdb.it.env.cluster.ClusterConstant.CN_CONSENSUS_DIR;
3434
import static org.apache.iotdb.it.env.cluster.ClusterConstant.CN_METRIC_IOTDB_REPORTER_HOST;
3535
import static org.apache.iotdb.it.env.cluster.ClusterConstant.CN_SYSTEM_DIR;
36-
import static org.apache.iotdb.it.env.cluster.ClusterConstant.COMMON_PROPERTIES_FILE;
3736
import static org.apache.iotdb.it.env.cluster.ClusterConstant.CONFIG_NODE_CONSENSUS_PROTOCOL_CLASS;
3837
import static org.apache.iotdb.it.env.cluster.ClusterConstant.CONFIG_NODE_INIT_HEAP_SIZE;
3938
import static org.apache.iotdb.it.env.cluster.ClusterConstant.CONFIG_NODE_MAX_DIRECT_MEMORY_SIZE;
4039
import static org.apache.iotdb.it.env.cluster.ClusterConstant.CONFIG_NODE_MAX_HEAP_SIZE;
41-
import static org.apache.iotdb.it.env.cluster.ClusterConstant.CONFIG_NODE_PROPERTIES_FILE;
4240
import static org.apache.iotdb.it.env.cluster.ClusterConstant.CONFIG_NODE_SYSTEM_PROPERTIES_FILE;
4341
import static org.apache.iotdb.it.env.cluster.ClusterConstant.DATA_REGION_CONSENSUS_PROTOCOL_CLASS;
4442
import static org.apache.iotdb.it.env.cluster.ClusterConstant.DATA_REPLICATION_FACTOR;
4543
import static org.apache.iotdb.it.env.cluster.ClusterConstant.DEFAULT_CONFIG_NODE_COMMON_PROPERTIES;
4644
import static org.apache.iotdb.it.env.cluster.ClusterConstant.DEFAULT_CONFIG_NODE_PROPERTIES;
45+
import static org.apache.iotdb.it.env.cluster.ClusterConstant.IOTDB_SYSTEM_PROPERTIES_FILE;
4746
import static org.apache.iotdb.it.env.cluster.ClusterConstant.SCHEMA_REGION_CONSENSUS_PROTOCOL_CLASS;
4847
import static org.apache.iotdb.it.env.cluster.ClusterConstant.SCHEMA_REPLICATION_FACTOR;
4948
import static org.apache.iotdb.it.env.cluster.ClusterConstant.TARGET;
@@ -90,13 +89,8 @@ public ConfigNodeWrapper(
9089
}
9190

9291
@Override
93-
protected String getTargetNodeConfigPath() {
94-
return workDirFilePath("conf", CONFIG_NODE_PROPERTIES_FILE);
95-
}
96-
97-
@Override
98-
protected String getTargetCommonConfigPath() {
99-
return workDirFilePath("conf", COMMON_PROPERTIES_FILE);
92+
protected String getSystemConfigPath() {
93+
return workDirFilePath("conf", IOTDB_SYSTEM_PROPERTIES_FILE);
10094
}
10195

10296
@Override

integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/DataNodeWrapper.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,11 @@
2929
import java.util.List;
3030

3131
import static org.apache.iotdb.consensus.ConsensusFactory.SIMPLE_CONSENSUS;
32-
import static org.apache.iotdb.it.env.cluster.ClusterConstant.COMMON_PROPERTIES_FILE;
3332
import static org.apache.iotdb.it.env.cluster.ClusterConstant.CONFIG_NODE_CONSENSUS_PROTOCOL_CLASS;
3433
import static org.apache.iotdb.it.env.cluster.ClusterConstant.DATANODE_INIT_HEAP_SIZE;
3534
import static org.apache.iotdb.it.env.cluster.ClusterConstant.DATANODE_MAX_DIRECT_MEMORY_SIZE;
3635
import static org.apache.iotdb.it.env.cluster.ClusterConstant.DATANODE_MAX_HEAP_SIZE;
3736
import static org.apache.iotdb.it.env.cluster.ClusterConstant.DATA_NODE_NAME;
38-
import static org.apache.iotdb.it.env.cluster.ClusterConstant.DATA_NODE_PROPERTIES_FILE;
3937
import static org.apache.iotdb.it.env.cluster.ClusterConstant.DATA_REGION_CONSENSUS_PROTOCOL_CLASS;
4038
import static org.apache.iotdb.it.env.cluster.ClusterConstant.DATA_REPLICATION_FACTOR;
4139
import static org.apache.iotdb.it.env.cluster.ClusterConstant.DEFAULT_DATA_NODE_COMMON_PROPERTIES;
@@ -53,6 +51,7 @@
5351
import static org.apache.iotdb.it.env.cluster.ClusterConstant.DN_SYSTEM_DIR;
5452
import static org.apache.iotdb.it.env.cluster.ClusterConstant.DN_TRACING_DIR;
5553
import static org.apache.iotdb.it.env.cluster.ClusterConstant.DN_WAL_DIRS;
54+
import static org.apache.iotdb.it.env.cluster.ClusterConstant.IOTDB_SYSTEM_PROPERTIES_FILE;
5655
import static org.apache.iotdb.it.env.cluster.ClusterConstant.MAIN_CLASS_NAME;
5756
import static org.apache.iotdb.it.env.cluster.ClusterConstant.MAX_TSBLOCK_SIZE_IN_BYTES;
5857
import static org.apache.iotdb.it.env.cluster.ClusterConstant.MQTT_HOST;
@@ -124,13 +123,8 @@ public DataNodeWrapper(
124123
}
125124

126125
@Override
127-
protected String getTargetNodeConfigPath() {
128-
return workDirFilePath("conf", DATA_NODE_PROPERTIES_FILE);
129-
}
130-
131-
@Override
132-
protected String getTargetCommonConfigPath() {
133-
return workDirFilePath("conf", COMMON_PROPERTIES_FILE);
126+
protected String getSystemConfigPath() {
127+
return workDirFilePath("conf", IOTDB_SYSTEM_PROPERTIES_FILE);
134128
}
135129

136130
@Override

iotdb-client/cli/src/assembly/resources/tools/backup.bat

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@ IF EXIST "%IOTDB_CONF%\datanode-env.bat" (
3838
echo Can't find datanode-env.bat
3939
)
4040

41-
IF EXIST "%IOTDB_CONF%\iotdb-datanode.properties" (
41+
IF EXIST "%IOTDB_CONF%\iotdb-system.properties" (
42+
for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^dn_rpc_port"
43+
"%IOTDB_CONF%\iotdb-system.properties"') do (
44+
set dn_rpc_port=%%i
45+
)
46+
) ELSE IF EXIST "%IOTDB_CONF%\iotdb-datanode.properties" (
4247
for /f "eol=# tokens=2 delims==" %%i in ('findstr /i "^dn_rpc_port"
4348
"%IOTDB_CONF%\iotdb-datanode.properties"') do (
4449
set dn_rpc_port=%%i

0 commit comments

Comments
 (0)