You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by er...@apache.org on 2022/12/29 14:00:09 UTC

[iotdb] 01/01: [lemming-5303] Refine IT config: part I

This is an automated email from the ASF dual-hosted git repository.

ericpai pushed a commit to branch improve/iotdb-5803
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 63260b8dfea1cecdae50ae53f9ce81f9bdaea946
Author: ericpai <er...@hotmail.com>
AuthorDate: Wed Dec 28 17:51:34 2022 +0800

    [lemming-5303] Refine IT config: part I
---
 .gitignore                                         |   1 +
 integration-test/checkstyle.xml                    |   2 +-
 integration-test/pom.xml                           |   3 +
 .../java/org/apache/iotdb/it/env/EnvFactory.java   |   3 +
 .../java/org/apache/iotdb/it/env/MppConfig.java    | 398 ------------------
 .../iotdb/it/env/{ => cluster}/AbstractEnv.java    | 139 ++++---
 .../it/env/{ => cluster}/AbstractNodeWrapper.java  | 142 +++++--
 .../iotdb/it/env/{ => cluster}/Cluster1Env.java    |  20 +-
 .../it/env/{ => cluster}/ConfigNodeWrapper.java    |  60 ++-
 .../it/env/{ => cluster}/DataNodeWrapper.java      |  79 ++--
 .../iotdb/it/env/{ => cluster}/EnvUtils.java       |  20 +-
 .../apache/iotdb/it/env/cluster/MppBaseConfig.java | 112 ++++++
 .../iotdb/it/env/cluster/MppClusterConfig.java     |  60 +++
 .../iotdb/it/env/cluster/MppCommonConfig.java      | 322 +++++++++++++++
 .../iotdb/it/env/cluster/MppConfigNodeConfig.java  |  56 +++
 .../MppDataNodeConfig.java}                        |  33 +-
 .../iotdb/it/env/{ => cluster}/SimpleEnv.java      |  19 +-
 .../iotdb/it/env/remote/RemoteServerConfig.java    |  57 +++
 .../iotdb/it/env/{ => remote}/RemoteServerEnv.java |  43 +-
 .../org/apache/iotdb/itbase/env/BaseConfig.java    | 447 ---------------------
 .../java/org/apache/iotdb/itbase/env/BaseEnv.java  |  55 ++-
 .../apache/iotdb/itbase/env/BaseNodeWrapper.java   |   4 -
 .../{BaseNodeWrapper.java => ClusterConfig.java}   |  54 +--
 .../org/apache/iotdb/itbase/env/CommonConfig.java  | 363 +++++++++++++++++
 .../env/ConfigNodeConfig.java}                     |  30 +-
 .../env/DataNodeConfig.java}                       |   7 +-
 .../apache/iotdb/cli/it/StartClientScriptIT.java   |   4 +-
 .../confignode/it/IoTDBClusterAuthorityIT.java     |   2 +-
 .../confignode/it/IoTDBConfigNodeSnapshotIT.java   |  33 +-
 .../confignode/it/IoTDBSnapshotTransferIT.java     |  18 +-
 .../iotdb/confignode/it/IoTDBStorageGroupIT.java   |   2 +-
 .../it/cluster/IoTDBClusterNodeErrorStartUpIT.java |  32 +-
 .../it/cluster/IoTDBClusterNodeGetterIT.java       |  70 ++--
 .../it/cluster/IoTDBClusterRestartIT.java          |  71 ++--
 .../load/IoTDBClusterRegionLeaderBalancingIT.java  |  81 ++--
 .../it/load/IoTDBConfigNodeSwitchLeaderIT.java     |  57 +--
 .../partition/IoTDBAutoRegionGroupExtensionIT.java |  63 ++-
 .../IoTDBCustomRegionGroupExtensionIT.java         |  78 ++--
 .../it/partition/IoTDBPartitionDurableIT.java      |  62 +--
 .../it/partition/IoTDBPartitionGetterIT.java       |  86 ++--
 .../partition/IoTDBPartitionInheritPolicyIT.java   |  59 +--
 .../confignode/it/utils/ConfigNodeTestUtils.java   |  41 +-
 .../org/apache/iotdb/db/it/IOTDBLoadTsFileIT.java  |  18 +-
 .../java/org/apache/iotdb/db/it/IoTDBAuthIT.java   |   4 +-
 .../apache/iotdb/db/it/IoTDBDatetimeFormatIT.java  |   4 +-
 .../org/apache/iotdb/db/it/IoTDBDeletionIT.java    |  24 +-
 .../org/apache/iotdb/db/it/IoTDBEncodingIT.java    |   4 +-
 .../org/apache/iotdb/db/it/IoTDBExampleIT.java     |   4 +-
 .../apache/iotdb/db/it/IoTDBExecuteBatchIT.java    |   4 +-
 .../apache/iotdb/db/it/IoTDBFilterBetweenIT.java   |   4 +-
 .../java/org/apache/iotdb/db/it/IoTDBFilterIT.java |  37 +-
 .../org/apache/iotdb/db/it/IoTDBFilterNullIT.java  |   4 +-
 .../apache/iotdb/db/it/IoTDBFloatPrecisionIT.java  |   4 +-
 .../apache/iotdb/db/it/IoTDBFlushQueryMergeIT.java |   4 +-
 .../apache/iotdb/db/it/IoTDBInsertMultiRowIT.java  |   4 +-
 .../org/apache/iotdb/db/it/IoTDBInsertNaNIT.java   |   4 +-
 .../org/apache/iotdb/db/it/IoTDBInsertNullIT.java  |   4 +-
 .../apache/iotdb/db/it/IoTDBInsertWithQueryIT.java |   4 +-
 .../iotdb/db/it/IoTDBInsertWithoutTimeIT.java      |   4 +-
 .../org/apache/iotdb/db/it/IoTDBMultiDeviceIT.java |  56 +--
 .../org/apache/iotdb/db/it/IoTDBNestedQueryIT.java |  41 +-
 .../iotdb/db/it/IoTDBPartialInsertionIT.java       |   9 +-
 .../db/it/IoTDBQueryWithRecreatedTimeseriesIT.java |   4 +-
 .../org/apache/iotdb/db/it/IoTDBQuotedPathIT.java  |   4 +-
 .../org/apache/iotdb/db/it/IoTDBRecoverIT.java     |   4 +-
 .../apache/iotdb/db/it/IoTDBRecoverUnclosedIT.java |   4 +-
 .../org/apache/iotdb/db/it/IoTDBRestartIT.java     |   4 +-
 .../it/IoTDBSameMeasurementsDifferentTypesIT.java  |  37 +-
 .../java/org/apache/iotdb/db/it/IoTDBSettleIT.java |   4 +-
 .../org/apache/iotdb/db/it/IoTDBSimpleQueryIT.java |   4 +-
 .../db/it/IoTDBSyntaxConventionIdentifierIT.java   |   4 +-
 .../it/IoTDBSyntaxConventionStringLiteralIT.java   |   4 +-
 .../org/apache/iotdb/db/it/IoTDBTimeZoneIT.java    |   4 +-
 .../java/org/apache/iotdb/db/it/IoTDBTtlIT.java    |   4 +-
 .../it/aggregation/IoTDBAggregationByLevelIT.java  |   4 +-
 .../it/aggregation/IoTDBAggregationDeleteIT.java   |  11 +-
 .../db/it/aggregation/IoTDBAggregationIT.java      |   6 +-
 .../aggregation/IoTDBAggregationLargeDataIT.java   |   9 +-
 .../it/aggregation/IoTDBAggregationOptimizeIT.java |   4 +-
 .../aggregation/IoTDBAggregationScanOrderIT.java   |  30 +-
 .../aggregation/IoTDBAggregationSmallDataIT.java   |   4 +-
 .../db/it/aggregation/IoTDBTagAggregationIT.java   |   4 +-
 .../db/it/alignbydevice/IoTDBAlignByDeviceIT.java  |   4 +-
 .../IoTDBOrderByWithAlignByDeviceIT.java           |   4 +-
 .../aligned/IoTDBAggregationWithDeletion2IT.java   |  39 +-
 .../it/aligned/IoTDBAggregationWithDeletionIT.java |  35 +-
 .../db/it/aligned/IoTDBAlignedDataDeletionIT.java  |  26 +-
 .../db/it/aligned/IoTDBAlignedLastQuery2IT.java    |  39 +-
 .../db/it/aligned/IoTDBAlignedLastQuery3IT.java    |  39 +-
 .../db/it/aligned/IoTDBAlignedLastQueryIT.java     |  36 +-
 .../db/it/aligned/IoTDBAlignedSeriesQuery2IT.java  |  39 +-
 .../db/it/aligned/IoTDBAlignedSeriesQuery3IT.java  |  38 +-
 .../db/it/aligned/IoTDBAlignedSeriesQueryIT.java   |  35 +-
 .../IoTDBAlignedSeriesQueryWithDeletionIT.java     |  36 +-
 .../IoTDBCountMultiTimesWithDeletionIT.java        |  36 +-
 .../db/it/aligned/IoTDBGroupByLevelQueryIT.java    |  37 +-
 ...GroupByQueryWithValueFilterWithDeletion2IT.java |  38 +-
 ...BGroupByQueryWithValueFilterWithDeletionIT.java |  38 +-
 ...upByQueryWithoutValueFilterWithDeletion2IT.java |  39 +-
 ...oupByQueryWithoutValueFilterWithDeletionIT.java |  38 +-
 .../db/it/aligned/IoTDBInsertAlignedValues2IT.java |  23 +-
 .../db/it/aligned/IoTDBInsertAlignedValues3IT.java |  23 +-
 .../db/it/aligned/IoTDBInsertAlignedValues4IT.java |  23 +-
 .../db/it/aligned/IoTDBInsertAlignedValuesIT.java  |  11 +-
 .../it/aligned/IoTDBLastQueryWithDeletion2IT.java  |  34 +-
 .../it/aligned/IoTDBLastQueryWithDeletionIT.java   |  30 +-
 .../aligned/IoTDBLastQueryWithoutLastCache2IT.java |  38 +-
 .../aligned/IoTDBLastQueryWithoutLastCacheIT.java  |  36 +-
 ...DBLastQueryWithoutLastCacheWithDeletion2IT.java |  38 +-
 ...TDBLastQueryWithoutLastCacheWithDeletionIT.java |  36 +-
 ...BRawQueryWithoutValueFilterWithDeletion2IT.java |  34 +-
 ...DBRawQueryWithoutValueFilterWithDeletionIT.java |  30 +-
 .../org/apache/iotdb/db/it/cq/IoTDBCQExecIT.java   |   4 +-
 .../java/org/apache/iotdb/db/it/cq/IoTDBCQIT.java  |   4 +-
 .../org/apache/iotdb/db/it/env/StandaloneEnv.java  | 275 -------------
 .../iotdb/db/it/env/StandaloneEnvConfig.java       | 354 ----------------
 .../apache/iotdb/db/it/groupby/IOTDBGroupByIT.java |  12 +-
 .../db/it/groupby/IoTDBGroupByNaturalMonthIT.java  |   4 +-
 .../iotdb/db/it/groupby/IoTDBGroupByUnseqIT.java   |  34 +-
 .../apache/iotdb/db/it/groupby/IoTDBHavingIT.java  |  12 +-
 .../iotdb/db/it/groupby/IoTDBLeftORightCIT.java    |   4 +-
 .../iotdb/db/it/last/IoTDBLastWithTTLIT.java       |   4 +-
 .../apache/iotdb/db/it/mqtt/IoTDBMQTTSinkIT.java   |  13 +-
 .../org/apache/iotdb/db/it/query/IoTDBAliasIT.java |   4 +-
 .../iotdb/db/it/query/IoTDBArithmeticIT.java       |   4 +-
 .../iotdb/db/it/query/IoTDBFuzzyQueryIT.java       |   4 +-
 .../org/apache/iotdb/db/it/query/IoTDBInIT.java    |   4 +-
 .../iotdb/db/it/query/IoTDBNullOperandIT.java      |  12 +-
 .../iotdb/db/it/query/IoTDBNullValueFillIT.java    |   4 +-
 .../iotdb/db/it/query/IoTDBPaginationIT.java       |  12 +-
 .../apache/iotdb/db/it/query/IoTDBQueryDemoIT.java |   4 +-
 .../query/IoTDBQueryWithComplexValueFilterIT.java  |   4 +-
 .../apache/iotdb/db/it/query/IoTDBResultSetIT.java |   4 +-
 .../it/query/IoTDBSelectCompareExpressionIT.java   |   4 +-
 .../iotdb/db/it/query/IoTDBSelectSchemaIT.java     |   4 +-
 .../db/it/schema/IoTDBAutoCreateSchemaIT.java      |   4 +-
 .../it/schema/IoTDBCreateAlignedTimeseriesIT.java  |   4 +-
 .../db/it/schema/IoTDBCreateStorageGroupIT.java    |   4 +-
 .../db/it/schema/IoTDBCreateTimeseriesIT.java      |   4 +-
 .../db/it/schema/IoTDBDeactivateTemplateIT.java    |   4 +-
 .../it/schema/IoTDBDeleteAlignedTimeseriesIT.java  |  13 +-
 .../db/it/schema/IoTDBDeleteStorageGroupIT.java    |   4 +-
 .../db/it/schema/IoTDBDeleteTimeseriesIT.java      |  12 +-
 .../schema/IoTDBDeleteTimeseriesSchemaFileIT.java  |   9 +-
 .../iotdb/db/it/schema/IoTDBMetadataFetchIT.java   |   4 +-
 .../it/schema/IoTDBMetadataFetchSchemaFileIT.java  |   9 +-
 .../iotdb/db/it/schema/IoTDBSchemaTemplateIT.java  |   4 +-
 .../db/it/schema/IoTDBSortedShowTimeseriesIT.java  |   4 +-
 .../apache/iotdb/db/it/schema/IoTDBTagAlterIT.java |   4 +-
 .../org/apache/iotdb/db/it/schema/IoTDBTagIT.java  |   4 +-
 .../iotdb/db/it/selectinto/IoTDBSelectInto2IT.java |  28 +-
 .../iotdb/db/it/selectinto/IoTDBSelectInto3IT.java |  23 +-
 .../iotdb/db/it/selectinto/IoTDBSelectIntoIT.java  |  14 +-
 .../org/apache/iotdb/db/it/sync/IoTDBPipeIT.java   |   4 +-
 .../apache/iotdb/db/it/sync/IoTDBPipeSinkIT.java   |   4 +-
 .../db/it/trigger/IoTDBTriggerExecutionIT.java     |   4 +-
 .../db/it/trigger/IoTDBTriggerManagementIT.java    |   4 +-
 .../org/apache/iotdb/db/it/udf/IoTDBUDFM4IT.java   |  15 +-
 .../iotdb/db/it/udf/IoTDBUDFManagementIT.java      |   4 +-
 .../db/it/udf/IoTDBUDFOtherWindowQueryIT.java      |  40 +-
 .../iotdb/db/it/udf/IoTDBUDFWindowQueryIT.java     |  40 +-
 .../db/it/udf/IoTDBUDTFAlignByTimeQueryIT.java     |  25 +-
 .../db/it/udf/IoTDBUDTFBuiltinFunctionIT.java      |   4 +-
 .../iotdb/db/it/udf/IoTDBUDTFHybridQueryIT.java    |   4 +-
 .../iotdb/db/it/udf/IoTDBUDTFNonAlignQueryIT.java  |  15 +-
 .../iotdb/db/it/watermark/IoTDBWatermarkIT.java    |  44 +-
 .../db/it/withoutNull/IoTDBWithoutAllNullIT.java   |   4 +-
 .../db/it/withoutNull/IoTDBWithoutAnyNullIT.java   |   4 +-
 .../withoutNull/IoTDBWithoutNullAllFilterIT.java   |  10 +-
 .../withoutNull/IoTDBWithoutNullAnyFilterIT.java   |   4 +-
 .../apache/iotdb/libudf/it/anomaly/AnomalyIT.java  |  11 +-
 .../apache/iotdb/libudf/it/dmatch/DMatchIT.java    |  11 +-
 .../iotdb/libudf/it/dprofile/DProfileIT.java       |  11 +-
 .../iotdb/libudf/it/dquality/DQualityIT.java       |  11 +-
 .../apache/iotdb/libudf/it/drepair/DRepairIT.java  |  11 +-
 .../iotdb/libudf/it/frequency/FrequencyIT.java     |  11 +-
 .../apache/iotdb/libudf/it/series/SeriesIT.java    |  11 +-
 .../apache/iotdb/libudf/it/string/StringIT.java    |  11 +-
 .../iotdb/session/it/IoTDBConnectionInfoIT.java    |   4 +-
 .../session/it/IoTDBSessionAlignedInsertIT.java    |  12 +-
 .../iotdb/session/it/IoTDBSessionComplexIT.java    |   6 +-
 .../it/IoTDBSessionDisableMemControlIT.java        |  12 +-
 .../iotdb/session/it/IoTDBSessionInsertNullIT.java |   4 +-
 .../IoTDBSessionInsertWithTriggerExecutionIT.java  |   4 +-
 .../session/it/IoTDBSessionSchemaTemplateIT.java   |   4 +-
 .../iotdb/session/it/IoTDBSessionSimpleIT.java     |   4 +-
 .../session/it/IoTDBSessionSyntaxConventionIT.java |   4 +-
 .../org/apache/iotdb/session/it/SessionIT.java     |   4 +-
 .../iotdb/session/it/pool/SessionPoolIT.java       |   4 +-
 .../org/apache/iotdb/tools/ExportCsvTestIT.java    |   4 +-
 .../org/apache/iotdb/tools/ExportTsFileTestIT.java |   4 +-
 .../iotdb/zeppelin/it/IoTDBInterpreterIT.java      |   4 +-
 .../src/test/resources/default-cluster.properties  |  37 ++
 .../resources/conf/iotdb-common.properties         |   2 +-
 194 files changed, 2646 insertions(+), 3354 deletions(-)

diff --git a/.gitignore b/.gitignore
index bb3192215b..51c6db6549 100644
--- a/.gitignore
+++ b/.gitignore
@@ -98,6 +98,7 @@ node_identifier
 
 ### temporary file of the distributed version ###
 remote/
+!integration-test/src/main/java/org/apache/iotdb/it/env/remote/
 
 # gitpod
 .theia/
diff --git a/integration-test/checkstyle.xml b/integration-test/checkstyle.xml
index aacd96124d..3cfc3662e4 100644
--- a/integration-test/checkstyle.xml
+++ b/integration-test/checkstyle.xml
@@ -25,7 +25,7 @@
     <property name="severity" value="error"/>
     <property name="fileExtensions" value="java"/>
     <module name="BeforeExecutionExclusionFileFilter">
-        <property name="fileNamePattern" value="^.*([\\/]src[\\/]main|[\\/]src[\\/]test[\\/]java[\\/]org[\\/]apache[\\/]iotdb[\\/](db|confignode)[\\/]it[\\/](env|utils))[\\/].*$"/>
+        <property name="fileNamePattern" value="^.*([\\/]src[\\/]main|[\\/]src[\\/]test[\\/]java[\\/]org[\\/]apache[\\/]iotdb[\\/](db|confignode)[\\/]it[\\/]utils)[\\/].*$"/>
     </module>
     <module name="TreeWalker">
         <module name="ImportControl">
diff --git a/integration-test/pom.xml b/integration-test/pom.xml
index 4e47113295..f29e866e00 100644
--- a/integration-test/pom.xml
+++ b/integration-test/pom.xml
@@ -220,6 +220,9 @@
                                 <TestEnv>${integrationTest.testEnv}</TestEnv>
                                 <RandomSelectWriteNode>${integrationTest.randomSelectWriteNode}</RandomSelectWriteNode>
                                 <ReadAndVerifyWithMultiNode>${integrationTest.readAndVerifyWithMultiNode}</ReadAndVerifyWithMultiNode>
+                                <DefaultClusterProperties/>
+                                <DefaultConfigNodeNum/>
+                                <DefaultDataNodeNum/>
                             </systemPropertyVariables>
                             <summaryFile>target/failsafe-reports/failsafe-summary-IT.xml</summaryFile>
                         </configuration>
diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/EnvFactory.java b/integration-test/src/main/java/org/apache/iotdb/it/env/EnvFactory.java
index f6cde01716..fd4e7dcd15 100644
--- a/integration-test/src/main/java/org/apache/iotdb/it/env/EnvFactory.java
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/EnvFactory.java
@@ -18,6 +18,9 @@
  */
 package org.apache.iotdb.it.env;
 
+import org.apache.iotdb.it.env.cluster.Cluster1Env;
+import org.apache.iotdb.it.env.cluster.SimpleEnv;
+import org.apache.iotdb.it.env.remote.RemoteServerEnv;
 import org.apache.iotdb.it.framework.IoTDBTestLogger;
 import org.apache.iotdb.itbase.env.BaseEnv;
 import org.apache.iotdb.jdbc.Config;
diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/MppConfig.java b/integration-test/src/main/java/org/apache/iotdb/it/env/MppConfig.java
deleted file mode 100644
index 098d70faa4..0000000000
--- a/integration-test/src/main/java/org/apache/iotdb/it/env/MppConfig.java
+++ /dev/null
@@ -1,398 +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.
- */
-package org.apache.iotdb.it.env;
-
-import org.apache.iotdb.itbase.env.BaseConfig;
-
-import java.util.Properties;
-
-public class MppConfig implements BaseConfig {
-  private final Properties engineProperties;
-  private final Properties confignodeProperties;
-
-  public MppConfig() {
-    engineProperties = new Properties();
-    confignodeProperties = new Properties();
-  }
-
-  @Override
-  public void clearAllProperties() {
-    engineProperties.clear();
-    confignodeProperties.clear();
-  }
-
-  @Override
-  public Properties getEngineProperties() {
-    return this.engineProperties;
-  }
-
-  @Override
-  public Properties getConfignodeProperties() {
-    return this.confignodeProperties;
-  }
-
-  @Override
-  public BaseConfig setMaxNumberOfPointsInPage(int maxNumberOfPointsInPage) {
-    engineProperties.setProperty(
-        "max_number_of_points_in_page", String.valueOf(maxNumberOfPointsInPage));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setPageSizeInByte(int pageSizeInByte) {
-    engineProperties.setProperty("page_size_in_byte", String.valueOf(pageSizeInByte));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setGroupSizeInByte(int groupSizeInByte) {
-    engineProperties.setProperty("group_size_in_byte", String.valueOf(groupSizeInByte));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setMemtableSizeThreshold(long memtableSizeThreshold) {
-    engineProperties.setProperty("memtable_size_threshold", String.valueOf(memtableSizeThreshold));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setDataRegionNum(int dataRegionNum) {
-    engineProperties.setProperty("data_region_num", String.valueOf(dataRegionNum));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setPartitionInterval(long partitionInterval) {
-    engineProperties.setProperty("time_partition_interval", String.valueOf(partitionInterval));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setCompressor(String compressor) {
-    engineProperties.setProperty("compressor", compressor);
-    return this;
-  }
-
-  @Override
-  public BaseConfig setMaxQueryDeduplicatedPathNum(int maxQueryDeduplicatedPathNum) {
-    engineProperties.setProperty(
-        "max_deduplicated_path_num", String.valueOf(maxQueryDeduplicatedPathNum));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setRpcThriftCompressionEnable(boolean rpcThriftCompressionEnable) {
-    engineProperties.setProperty(
-        "dn_rpc_thrift_compression_enable", String.valueOf(rpcThriftCompressionEnable));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setRpcAdvancedCompressionEnable(boolean rpcAdvancedCompressionEnable) {
-    engineProperties.setProperty(
-        "dn_rpc_advanced_compression_enable", String.valueOf(rpcAdvancedCompressionEnable));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setUdfCollectorMemoryBudgetInMB(float udfCollectorMemoryBudgetInMB) {
-    // udf_memory_budget_in_mb
-    // udf_reader_transformer_collector_memory_proportion
-    engineProperties.setProperty(
-        "udf_memory_budget_in_mb", String.valueOf(udfCollectorMemoryBudgetInMB * 3));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setUdfTransformerMemoryBudgetInMB(float udfTransformerMemoryBudgetInMB) {
-    engineProperties.setProperty(
-        "udf_memory_budget_in_mb", String.valueOf(udfTransformerMemoryBudgetInMB * 3));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setUdfReaderMemoryBudgetInMB(float udfReaderMemoryBudgetInMB) {
-    engineProperties.setProperty(
-        "udf_memory_budget_in_mb", String.valueOf(udfReaderMemoryBudgetInMB * 3));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setEnableSeqSpaceCompaction(boolean enableSeqSpaceCompaction) {
-    engineProperties.setProperty(
-        "enable_seq_space_compaction", String.valueOf(enableSeqSpaceCompaction));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setEnableUnseqSpaceCompaction(boolean enableUnseqSpaceCompaction) {
-    engineProperties.setProperty(
-        "enable_unseq_space_compaction", String.valueOf(enableUnseqSpaceCompaction));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setEnableCrossSpaceCompaction(boolean enableCrossSpaceCompaction) {
-    engineProperties.setProperty(
-        "enable_cross_space_compaction", String.valueOf(enableCrossSpaceCompaction));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setEnableIDTable(boolean isEnableIDTable) {
-    engineProperties.setProperty("enable_id_table", String.valueOf(isEnableIDTable));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setDeviceIDTransformationMethod(String deviceIDTransformationMethod) {
-    engineProperties.setProperty("device_id_transformation_method", deviceIDTransformationMethod);
-    return this;
-  }
-
-  @Override
-  public BaseConfig setAutoCreateSchemaEnabled(boolean enableAutoCreateSchema) {
-    engineProperties.setProperty(
-        "enable_auto_create_schema", String.valueOf(enableAutoCreateSchema));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setEnableLastCache(boolean lastCacheEnable) {
-    engineProperties.setProperty("enable_last_cache", String.valueOf(lastCacheEnable));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setPrimitiveArraySize(int primitiveArraySize) {
-    engineProperties.setProperty("primitive_array_size", String.valueOf(primitiveArraySize));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setAvgSeriesPointNumberThreshold(int avgSeriesPointNumberThreshold) {
-    engineProperties.setProperty(
-        "avg_series_point_number_threshold", String.valueOf(avgSeriesPointNumberThreshold));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setMaxTsBlockLineNumber(int maxTsBlockLineNumber) {
-    engineProperties.setProperty("max_tsblock_line_number", String.valueOf(maxTsBlockLineNumber));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setConfigNodeConsesusProtocolClass(String configNodeConsesusProtocolClass) {
-    confignodeProperties.setProperty(
-        "config_node_consensus_protocol_class", configNodeConsesusProtocolClass);
-    return this;
-  }
-
-  @Override
-  public BaseConfig setSchemaRegionConsensusProtocolClass(
-      String schemaRegionConsensusProtocolClass) {
-    confignodeProperties.setProperty(
-        "schema_region_consensus_protocol_class", schemaRegionConsensusProtocolClass);
-    return this;
-  }
-
-  @Override
-  public BaseConfig setDataRegionConsensusProtocolClass(String dataRegionConsensusProtocolClass) {
-    confignodeProperties.setProperty(
-        "data_region_consensus_protocol_class", dataRegionConsensusProtocolClass);
-    return this;
-  }
-
-  @Override
-  public BaseConfig setSchemaRegionGroupExtensionPolicy(String schemaRegionGroupExtensionPolicy) {
-    confignodeProperties.setProperty(
-        "schema_region_group_extension_policy", schemaRegionGroupExtensionPolicy);
-    return this;
-  }
-
-  @Override
-  public BaseConfig setSchemaRegionGroupPerDatabase(int schemaRegionGroupPerDatabase) {
-    confignodeProperties.setProperty(
-        "schema_region_group_per_database", String.valueOf(schemaRegionGroupPerDatabase));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setDataRegionGroupExtensionPolicy(String dataRegionGroupExtensionPolicy) {
-    confignodeProperties.setProperty(
-        "data_region_group_extension_policy", dataRegionGroupExtensionPolicy);
-    return this;
-  }
-
-  @Override
-  public BaseConfig setDataRegionGroupPerDatabase(int dataRegionGroupPerDatabase) {
-    confignodeProperties.setProperty(
-        "data_region_group_per_database", String.valueOf(dataRegionGroupPerDatabase));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setSchemaReplicationFactor(int schemaReplicationFactor) {
-    confignodeProperties.setProperty(
-        "schema_replication_factor", String.valueOf(schemaReplicationFactor));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setEnableDataPartitionInheritPolicy(boolean enableDataPartitionInheritPolicy) {
-    confignodeProperties.setProperty(
-        "enable_data_partition_inherit_policy", String.valueOf(enableDataPartitionInheritPolicy));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setDataReplicationFactor(int dataReplicationFactor) {
-    confignodeProperties.setProperty(
-        "data_replication_factor", String.valueOf(dataReplicationFactor));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setSeriesPartitionSlotNum(int seriesPartitionSlotNum) {
-    confignodeProperties.setProperty(
-        "series_partition_slot_num", String.valueOf(seriesPartitionSlotNum));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setTimePartitionInterval(long timePartitionInterval) {
-    confignodeProperties.setProperty(
-        "time_partition_interval", String.valueOf(timePartitionInterval));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setEnableMemControl(boolean enableMemControl) {
-    confignodeProperties.setProperty("enable_mem_control", String.valueOf(enableMemControl));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setConfigNodeRatisSnapshotTriggerThreshold(int ratisSnapshotTriggerThreshold) {
-    confignodeProperties.setProperty(
-        "config_node_ratis_snapshot_trigger_threshold",
-        String.valueOf(ratisSnapshotTriggerThreshold));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setCompactionThreadCount(int concurrentCompactionThread) {
-    confignodeProperties.setProperty(
-        "compaction_thread_count", String.valueOf(concurrentCompactionThread));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setMaxDegreeOfIndexNode(int maxDegreeOfIndexNode) {
-    engineProperties.setProperty("max_degree_of_index_node", String.valueOf(maxDegreeOfIndexNode));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setEnableWatermark(boolean enableWatermark) {
-    engineProperties.setProperty("watermark_module_opened", String.valueOf(enableWatermark));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setWatermarkSecretKey(String watermarkSecretKey) {
-    engineProperties.setProperty("watermark_secret_key", watermarkSecretKey);
-    return this;
-  }
-
-  @Override
-  public BaseConfig setWatermarkBitString(String watermarkBitString) {
-    engineProperties.setProperty("watermark_bit_string", watermarkBitString);
-    return this;
-  }
-
-  @Override
-  public BaseConfig setWatermarkMethod(String watermarkMethod) {
-    engineProperties.setProperty("watermark_method", watermarkMethod);
-    return this;
-  }
-
-  @Override
-  public BaseConfig setEnableMQTTService(boolean enableMQTTService) {
-    engineProperties.setProperty("enable_mqtt_service", String.valueOf(enableMQTTService));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setSchemaEngineMode(String schemaEngineMode) {
-    engineProperties.setProperty("schema_engine_mode", schemaEngineMode);
-    return this;
-  }
-
-  @Override
-  public BaseConfig setSelectIntoInsertTabletPlanRowLimit(int selectIntoInsertTabletPlanRowLimit) {
-    engineProperties.setProperty(
-        "select_into_insert_tablet_plan_row_limit",
-        String.valueOf(selectIntoInsertTabletPlanRowLimit));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setEnableAutoLeaderBalanceForRatisConsensus(
-      boolean enableAutoLeaderBalanceForRatisConsensus) {
-    confignodeProperties.setProperty(
-        "enable_auto_leader_balance_for_ratis_consensus",
-        String.valueOf(enableAutoLeaderBalanceForRatisConsensus));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setEnableAutoLeaderBalanceForIoTConsensus(
-      boolean enableAutoLeaderBalanceForIoTConsensus) {
-    confignodeProperties.setProperty(
-        "enable_auto_leader_balance_for_iot_consensus",
-        String.valueOf(enableAutoLeaderBalanceForIoTConsensus));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setLeastDataRegionGroupNum(int leastDataRegionGroupNum) {
-    confignodeProperties.setProperty(
-        "least_data_region_group_num", String.valueOf(leastDataRegionGroupNum));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setQueryThreadCount(int queryThreadCount) {
-    if (queryThreadCount <= 0) {
-      queryThreadCount = Runtime.getRuntime().availableProcessors();
-    }
-    confignodeProperties.setProperty("query_thread_count", String.valueOf(queryThreadCount));
-    return this;
-  }
-
-  @Override
-  public BaseConfig setDataRatisTriggerSnapshotThreshold(long threshold) {
-    confignodeProperties.setProperty(
-        "data_region_ratis_snapshot_trigger_threshold", String.valueOf(threshold));
-    return this;
-  }
-}
diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/AbstractEnv.java b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/AbstractEnv.java
similarity index 88%
rename from integration-test/src/main/java/org/apache/iotdb/it/env/AbstractEnv.java
rename to integration-test/src/main/java/org/apache/iotdb/it/env/cluster/AbstractEnv.java
index 98ae650290..854305f2bd 100644
--- a/integration-test/src/main/java/org/apache/iotdb/it/env/AbstractEnv.java
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/AbstractEnv.java
@@ -16,11 +16,10 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.iotdb.it.env;
+package org.apache.iotdb.it.env.cluster;
 
 import org.apache.iotdb.common.rpc.thrift.TEndPoint;
 import org.apache.iotdb.commons.client.IClientManager;
-import org.apache.iotdb.commons.client.exception.ClientManagerException;
 import org.apache.iotdb.commons.client.sync.SyncConfigNodeIServiceClient;
 import org.apache.iotdb.commons.cluster.NodeStatus;
 import org.apache.iotdb.confignode.rpc.thrift.IConfigNodeRPCService;
@@ -30,6 +29,7 @@ import org.apache.iotdb.isession.ISession;
 import org.apache.iotdb.isession.SessionConfig;
 import org.apache.iotdb.it.framework.IoTDBTestLogger;
 import org.apache.iotdb.itbase.env.BaseEnv;
+import org.apache.iotdb.itbase.env.ClusterConfig;
 import org.apache.iotdb.itbase.runtime.ClusterTestConnection;
 import org.apache.iotdb.itbase.runtime.NodeConnection;
 import org.apache.iotdb.itbase.runtime.ParallelRequestDelegate;
@@ -43,7 +43,6 @@ import org.apache.iotdb.rpc.TSStatusCode;
 import org.apache.iotdb.session.Session;
 import org.apache.iotdb.session.pool.SessionPool;
 
-import org.apache.thrift.TException;
 import org.slf4j.Logger;
 
 import java.io.File;
@@ -60,7 +59,7 @@ import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
-import static org.apache.iotdb.it.env.AbstractNodeWrapper.templateNodeLibPath;
+import static org.apache.iotdb.it.env.cluster.AbstractNodeWrapper.templateNodeLibPath;
 import static org.apache.iotdb.jdbc.Config.VERSION;
 import static org.junit.Assert.fail;
 
@@ -78,6 +77,21 @@ public abstract class AbstractEnv implements BaseEnv {
 
   private IClientManager<TEndPoint, SyncConfigNodeIServiceClient> clientManager;
 
+  /**
+   * This config object stores the properties set by developers during the test. It will be cleared
+   * after each call of cleanupEnvironment.
+   */
+  private MppClusterConfig clusterConfig;
+
+  public AbstractEnv() {
+    clusterConfig = new MppClusterConfig();
+  }
+
+  @Override
+  public ClusterConfig getConfig() {
+    return clusterConfig;
+  }
+
   protected void initEnvironment(int configNodesNum, int dataNodesNum) {
     this.configNodeWrapperList = new ArrayList<>();
     this.dataNodeWrapperList = new ArrayList<>();
@@ -94,7 +108,9 @@ public abstract class AbstractEnv implements BaseEnv {
         new ConfigNodeWrapper(
             true, "", testClassName, testMethodName, EnvUtils.searchAvailablePorts());
     seedConfigNodeWrapper.createDir();
-    seedConfigNodeWrapper.changeConfig(ConfigFactory.getConfig().getConfignodeProperties());
+    seedConfigNodeWrapper.changeConfig(
+        (MppConfigNodeConfig) clusterConfig.getConfigNodeConfig(),
+        (MppCommonConfig) clusterConfig.getConfigNodeCommonConfig());
     seedConfigNodeWrapper.start();
     String targetConfigNode = seedConfigNodeWrapper.getIpAndPortString();
     this.configNodeWrapperList.add(seedConfigNodeWrapper);
@@ -121,7 +137,9 @@ public abstract class AbstractEnv implements BaseEnv {
       this.configNodeWrapperList.add(configNodeWrapper);
       configNodeEndpoints.add(configNodeWrapper.getIpAndPortString());
       configNodeWrapper.createDir();
-      configNodeWrapper.changeConfig(ConfigFactory.getConfig().getConfignodeProperties());
+      configNodeWrapper.changeConfig(
+          (MppConfigNodeConfig) clusterConfig.getConfigNodeConfig(),
+          (MppCommonConfig) clusterConfig.getConfigNodeCommonConfig());
       configNodesDelegate.addRequest(
           () -> {
             configNodeWrapper.start();
@@ -145,7 +163,9 @@ public abstract class AbstractEnv implements BaseEnv {
       this.dataNodeWrapperList.add(dataNodeWrapper);
       dataNodeEndpoints.add(dataNodeWrapper.getIpAndPortString());
       dataNodeWrapper.createDir();
-      dataNodeWrapper.changeConfig(ConfigFactory.getConfig().getEngineProperties());
+      dataNodeWrapper.changeConfig(
+          (MppDataNodeConfig) clusterConfig.getDataNodeConfig(),
+          (MppCommonConfig) clusterConfig.getDataNodeCommonConfig());
       dataNodesDelegate.addRequest(
           () -> {
             dataNodeWrapper.start();
@@ -163,22 +183,6 @@ public abstract class AbstractEnv implements BaseEnv {
     testWorking();
   }
 
-  private void cleanupEnvironment() {
-    for (AbstractNodeWrapper nodeWrapper :
-        Stream.concat(this.dataNodeWrapperList.stream(), this.configNodeWrapperList.stream())
-            .collect(Collectors.toList())) {
-      nodeWrapper.stop();
-      nodeWrapper.waitingToShutDown();
-      nodeWrapper.destroyDir();
-      String lockPath = EnvUtils.getLockFilePath(nodeWrapper.getPort());
-      if (!new File(lockPath).delete()) {
-        logger.error("Delete lock file {} failed", lockPath);
-      }
-    }
-    clientManager.close();
-    testMethodName = null;
-  }
-
   public String getTestClassName() {
     StackTraceElement[] stack = Thread.currentThread().getStackTrace();
     for (StackTraceElement stackTraceElement : stack) {
@@ -277,13 +281,21 @@ public abstract class AbstractEnv implements BaseEnv {
   }
 
   @Override
-  public void cleanAfterClass() {
-    cleanupEnvironment();
-  }
-
-  @Override
-  public void cleanAfterTest() {
-    cleanupEnvironment();
+  public void cleanClusterEnvironment() {
+    for (AbstractNodeWrapper nodeWrapper :
+        Stream.concat(this.dataNodeWrapperList.stream(), this.configNodeWrapperList.stream())
+            .collect(Collectors.toList())) {
+      nodeWrapper.stop();
+      nodeWrapper.waitingToShutDown();
+      nodeWrapper.destroyDir();
+      String lockPath = EnvUtils.getLockFilePath(nodeWrapper.getPort());
+      if (!new File(lockPath).delete()) {
+        logger.error("Delete lock file {} failed", lockPath);
+      }
+    }
+    clientManager.close();
+    testMethodName = null;
+    clusterConfig = new MppClusterConfig();
   }
 
   @Override
@@ -418,21 +430,11 @@ public abstract class AbstractEnv implements BaseEnv {
     return configNodeWrapperList;
   }
 
-  @Override
-  public void setConfigNodeWrapperList(List<ConfigNodeWrapper> configNodeWrapperList) {
-    this.configNodeWrapperList = configNodeWrapperList;
-  }
-
   @Override
   public List<DataNodeWrapper> getDataNodeWrapperList() {
     return dataNodeWrapperList;
   }
 
-  @Override
-  public void setDataNodeWrapperList(List<DataNodeWrapper> dataNodeWrapperList) {
-    this.dataNodeWrapperList = dataNodeWrapperList;
-  }
-
   /**
    * Get connection to ConfigNode-Leader in ClusterIT environment
    *
@@ -444,10 +446,12 @@ public abstract class AbstractEnv implements BaseEnv {
   @Override
   public IConfigNodeRPCService.Iface getLeaderConfigNodeConnection()
       throws IOException, InterruptedException {
-
+    Exception lastException = null;
+    ConfigNodeWrapper lastErrorNode = null;
     for (int i = 0; i < 30; i++) {
       for (ConfigNodeWrapper configNodeWrapper : configNodeWrapperList) {
         try {
+          lastErrorNode = configNodeWrapper;
           SyncConfigNodeIServiceClient client =
               clientManager.borrowClient(
                   new TEndPoint(configNodeWrapper.getIp(), configNodeWrapper.getPort()));
@@ -463,27 +467,38 @@ public abstract class AbstractEnv implements BaseEnv {
           } else {
             // Return client otherwise
             client.close();
+            throw new Exception(
+                "Bad status: "
+                    + resp.getStatus().getCode()
+                    + " message: "
+                    + resp.getStatus().getMessage());
           }
         } catch (Exception e) {
-          logger.error(
-              String.format(
-                  "Borrow ConfigNodeClient from ConfigNode: %s failed, retrying...",
-                  configNodeWrapper.getIpAndPortString()),
-              e);
+          lastException = e;
         }
 
         // Sleep 1s before next retry
         TimeUnit.SECONDS.sleep(1);
       }
     }
-    throw new IOException("Failed to get connection to ConfigNode-Leader");
+    if (lastErrorNode != null) {
+      throw new IOException(
+          "Failed to get connection to ConfigNode-Leader. Last error configNode: "
+              + lastErrorNode.getIpAndPortString(),
+          lastException);
+    } else {
+      throw new IOException("Empty configNode set");
+    }
   }
 
   @Override
   public int getLeaderConfigNodeIndex() throws IOException, InterruptedException {
+    Exception lastException = null;
+    ConfigNodeWrapper lastErrorNode = null;
     for (int retry = 0; retry < 30; retry++) {
       for (int configNodeId = 0; configNodeId < configNodeWrapperList.size(); configNodeId++) {
         ConfigNodeWrapper configNodeWrapper = configNodeWrapperList.get(configNodeId);
+        lastErrorNode = configNodeWrapper;
         try (SyncConfigNodeIServiceClient client =
             clientManager.borrowClient(
                 new TEndPoint(configNodeWrapper.getIp(), configNodeWrapper.getPort()))) {
@@ -492,12 +507,15 @@ public abstract class AbstractEnv implements BaseEnv {
           // will respond the SUCCESS_STATUS
           if (resp.getStatus().getCode() == TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
             return configNodeId;
+          } else {
+            throw new Exception(
+                "Bad status: "
+                    + resp.getStatus().getCode()
+                    + " message: "
+                    + resp.getStatus().getMessage());
           }
-        } catch (ClientManagerException | TException e) {
-          logger.error(
-              "Borrow ConfigNodeClient from ConfigNode: {} failed because: {}, retrying...",
-              configNodeWrapper.getIp(),
-              e);
+        } catch (Exception e) {
+          lastException = e;
         }
 
         // Sleep 1s before next retry
@@ -505,7 +523,14 @@ public abstract class AbstractEnv implements BaseEnv {
       }
     }
 
-    throw new IOException("Failed to get the index of ConfigNode-Leader");
+    if (lastErrorNode != null) {
+      throw new IOException(
+          "Failed to get the index of ConfigNode-Leader. Last error configNode: "
+              + lastErrorNode.getIpAndPortString(),
+          lastException);
+    } else {
+      throw new IOException("Empty configNode set");
+    }
   }
 
   @Override
@@ -539,7 +564,9 @@ public abstract class AbstractEnv implements BaseEnv {
             EnvUtils.searchAvailablePorts());
     configNodeWrapperList.add(newConfigNodeWrapper);
     newConfigNodeWrapper.createDir();
-    newConfigNodeWrapper.changeConfig(ConfigFactory.getConfig().getConfignodeProperties());
+    newConfigNodeWrapper.changeConfig(
+        (MppConfigNodeConfig) clusterConfig.getConfigNodeConfig(),
+        (MppCommonConfig) clusterConfig.getConfigNodeCommonConfig());
     return newConfigNodeWrapper;
   }
 
@@ -553,7 +580,9 @@ public abstract class AbstractEnv implements BaseEnv {
             EnvUtils.searchAvailablePorts());
     dataNodeWrapperList.add(newDataNodeWrapper);
     newDataNodeWrapper.createDir();
-    newDataNodeWrapper.changeConfig(ConfigFactory.getConfig().getEngineProperties());
+    newDataNodeWrapper.changeConfig(
+        (MppDataNodeConfig) clusterConfig.getDataNodeConfig(),
+        (MppCommonConfig) clusterConfig.getDataNodeCommonConfig());
     return newDataNodeWrapper;
   }
 
diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/AbstractNodeWrapper.java b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/AbstractNodeWrapper.java
similarity index 74%
rename from integration-test/src/main/java/org/apache/iotdb/it/env/AbstractNodeWrapper.java
rename to integration-test/src/main/java/org/apache/iotdb/it/env/cluster/AbstractNodeWrapper.java
index 9db38c0e40..46a5d8509c 100644
--- a/integration-test/src/main/java/org/apache/iotdb/it/env/AbstractNodeWrapper.java
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/AbstractNodeWrapper.java
@@ -16,8 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.iotdb.it.env;
+package org.apache.iotdb.it.env.cluster;
 
+import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestLogger;
 import org.apache.iotdb.itbase.env.BaseNodeWrapper;
 
@@ -32,9 +33,7 @@ import javax.management.remote.JMXConnectorFactory;
 import javax.management.remote.JMXServiceURL;
 
 import java.io.File;
-import java.io.FileWriter;
 import java.io.IOException;
-import java.io.InputStream;
 import java.io.PrintWriter;
 import java.lang.management.ManagementFactory;
 import java.lang.management.MonitorInfo;
@@ -80,6 +79,25 @@ public abstract class AbstractNodeWrapper implements BaseNodeWrapper {
           + "lib"
           + File.separator
           + "*";
+
+  protected static final String propertyKeyConfigNodeConsensusProtocolClass =
+      "config_node_consensus_protocol_class";
+  protected static final String propertyKeySchemaRegionConsensusProtocolClass =
+      "schema_region_consensus_protocol_class";
+  protected static final String propertyKeyDataRegionConsensusProtocolClass =
+      "data_region_consensus_protocol_class";
+  protected static final String propertyKeySchemaReplicationFactor = "schema_replication_factor";
+  protected static final String propertyKeyDataReplicationFactor = "data_replication_factor";
+
+  private static final String defaultPropertiesPath =
+      System.getProperty("user.dir")
+          + File.separator
+          + "test"
+          + File.separator
+          + "resources"
+          + File.separator
+          + "default-cluster.properties";
+
   protected final String testClassName;
   protected final String testMethodName;
   protected final int[] portList;
@@ -89,6 +107,22 @@ public abstract class AbstractNodeWrapper implements BaseNodeWrapper {
   private String node_address;
   private int node_port;
 
+  /**
+   * Mutable properties are always hardcoded default values to make the cluster be set up
+   * successfully. Their lifecycles are the same with the whole test runner.
+   */
+  protected final Properties mutableNodeProperties = new Properties();
+
+  protected final Properties mutableCommonProperties = new Properties();
+
+  /**
+   * Immutable values are connection configurations, such as ip, ports which are generated randomly
+   * during cluster initialization. Their lifecycles are the same with this node wrapper instance.
+   */
+  protected final Properties immutableNodeProperties = new Properties();
+
+  protected final Properties immutableCommonProperties = new Properties();
+
   public AbstractNodeWrapper(String testClassName, String testMethodName, int[] portList) {
     this.testClassName = testClassName;
     this.testMethodName = testMethodName;
@@ -155,6 +189,54 @@ public abstract class AbstractNodeWrapper implements BaseNodeWrapper {
     fail("Delete node dir failed.");
   }
 
+  /**
+   * Change the config of this node. Here's the order of applied config source. The latter one will
+   * override the former one if a key is duplicated.
+   *
+   * <ul>
+   *   <li>1. Reading directly from assembled property files of other modules.
+   *   <li>2. Default values which are hardcoded in mutable properties fields.
+   *   <li>3. Values read from the path specified by system variables.
+   *   <li>4. Values mutated by developers through {@link EnvFactory}.
+   *   <li>5. Make sure immutable properties are not changed.
+   * </ul>
+   *
+   * @param nodeConfig the values mutated through {@link EnvFactory}
+   * @param commonConfig the values mutated through {@link EnvFactory}.
+   */
+  public final void changeConfig(MppBaseConfig nodeConfig, MppCommonConfig commonConfig) {
+    try {
+      // 1. Read directly from assembled property files
+      // In a config-node, the files should be iotdb-confignode.properties and
+      // iotdb-common.properties.
+      MppBaseConfig outputCommonConfig = commonConfig.emptyClone();
+      MppBaseConfig outputNodeConfig = nodeConfig.emptyClone();
+
+      // 2. Override by values which are hardcoded in mutable properties fields.
+      outputCommonConfig.updateProperties(mutableCommonProperties);
+      outputNodeConfig.updateProperties(mutableNodeProperties);
+
+      // 3. Override by values read from the path specified by system variables. The path is a
+      // relative one to integration-test module dir.
+      outputCommonConfig.updateProperties(getDefaultCommonConfigPath());
+      outputNodeConfig.updateProperties(getDefaultNodeConfigPath());
+
+      // 4. Override by values mutated by developers
+      outputCommonConfig.updateProperties(commonConfig);
+      outputNodeConfig.updateProperties(nodeConfig);
+
+      // 5. Restore immutable properties
+      outputCommonConfig.updateProperties(immutableCommonProperties);
+      outputNodeConfig.updateProperties(immutableNodeProperties);
+
+      // Persistent
+      outputCommonConfig.persistent(getTargetCommonConfigPath());
+      outputNodeConfig.persistent(getTargetNodeConfigPath());
+    } catch (IOException ex) {
+      fail("Change the config of node failed. " + ex);
+    }
+  }
+
   @Override
   public void start() {
     try {
@@ -217,41 +299,11 @@ public abstract class AbstractNodeWrapper implements BaseNodeWrapper {
     }
   }
 
-  @Override
-  public void changeConfig(Properties properties) {
-    try {
-      String commonConfigPath = getCommonConfigPath();
-      Properties commonConfigProperties = new Properties();
-      try (InputStream confInput = Files.newInputStream(Paths.get(commonConfigPath))) {
-        commonConfigProperties.load(confInput);
-      }
-      String configPath = getConfigPath();
-      Properties configProperties = new Properties();
-      try (InputStream confInput = Files.newInputStream(Paths.get(configPath))) {
-        configProperties.load(confInput);
-      }
-      commonConfigProperties.putAll(configProperties);
-      updateConfig(commonConfigProperties);
-      if (properties != null && !properties.isEmpty()) {
-        commonConfigProperties.putAll(properties);
-      }
-      try (FileWriter confOutput = new FileWriter(configPath)) {
-        commonConfigProperties.store(confOutput, null);
-      }
-    } catch (IOException ex) {
-      fail("Change the config of data node failed. " + ex);
-    }
-  }
-
   @Override
   public final String getIp() {
     return this.node_address;
   }
 
-  public void setIp(String ip) {
-    this.node_address = ip;
-  }
-
   @Override
   public final int getPort() {
     return this.node_port;
@@ -270,16 +322,6 @@ public abstract class AbstractNodeWrapper implements BaseNodeWrapper {
     return getNodePath() + File.separator + dirName + File.separator + fileName;
   }
 
-  protected abstract String getConfigPath();
-
-  protected abstract String getCommonConfigPath();
-
-  public abstract String getSystemPropertiesPath();
-
-  protected abstract void updateConfig(Properties properties);
-
-  protected abstract void addStartCmdParams(List<String> params);
-
   private String getLogPath() {
     return getLogDirPath() + File.separator + getId() + ".log";
   }
@@ -382,4 +424,18 @@ public abstract class AbstractNodeWrapper implements BaseNodeWrapper {
   }
 
   protected abstract void renameFile();
+
+  protected abstract String getTargetNodeConfigPath();
+
+  protected abstract String getTargetCommonConfigPath();
+
+  /** Return the node config file path specified through system variable */
+  protected abstract String getDefaultNodeConfigPath();
+
+  /** Return the common config file path specified through system variable */
+  protected abstract String getDefaultCommonConfigPath();
+
+  protected abstract void addStartCmdParams(List<String> params);
+
+  public abstract String getSystemPropertiesPath();
 }
diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/Cluster1Env.java b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/Cluster1Env.java
similarity index 65%
rename from integration-test/src/main/java/org/apache/iotdb/it/env/Cluster1Env.java
rename to integration-test/src/main/java/org/apache/iotdb/it/env/cluster/Cluster1Env.java
index 978581cbe0..97a5cb49de 100644
--- a/integration-test/src/main/java/org/apache/iotdb/it/env/Cluster1Env.java
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/Cluster1Env.java
@@ -16,30 +16,20 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.iotdb.it.env;
+package org.apache.iotdb.it.env.cluster;
 
-import org.apache.iotdb.it.framework.IoTDBTestLogger;
-
-import org.slf4j.Logger;
+import org.apache.iotdb.tsfile.utils.Pair;
 
 public class Cluster1Env extends AbstractEnv {
-  private static final Logger logger = IoTDBTestLogger.logger;
 
   @Override
-  public void initBeforeClass() throws InterruptedException {
-    logger.debug("=======start init class=======");
-    super.initEnvironment(1, 3);
+  public void initClusterEnvironment() {
+    Pair<Integer, Integer> nodeNum = EnvUtils.getNodeNum();
+    super.initEnvironment(nodeNum.getLeft(), nodeNum.getRight());
   }
 
   @Override
   public void initClusterEnvironment(int configNodesNum, int dataNodesNum) {
-    logger.debug("=======start init cluster environment=======");
     super.initEnvironment(configNodesNum, dataNodesNum);
   }
-
-  @Override
-  public void initBeforeTest() throws InterruptedException {
-    logger.debug("=======start init test=======");
-    super.initEnvironment(1, 3);
-  }
 }
diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/ConfigNodeWrapper.java b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/ConfigNodeWrapper.java
similarity index 67%
rename from integration-test/src/main/java/org/apache/iotdb/it/env/ConfigNodeWrapper.java
rename to integration-test/src/main/java/org/apache/iotdb/it/env/cluster/ConfigNodeWrapper.java
index 0347f30fb2..70d6ad8a48 100644
--- a/integration-test/src/main/java/org/apache/iotdb/it/env/ConfigNodeWrapper.java
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/ConfigNodeWrapper.java
@@ -16,20 +16,27 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.iotdb.it.env;
+package org.apache.iotdb.it.env.cluster;
 
 import org.apache.iotdb.commons.conf.IoTDBConstant;
 
 import java.io.File;
 import java.util.Arrays;
 import java.util.List;
-import java.util.Properties;
 
 public class ConfigNodeWrapper extends AbstractNodeWrapper {
 
   private int consensusPort;
   private final String targetConfigNodes;
   private final boolean isSeed;
+  private final String defaultNodePropertiesFile =
+      System.getProperty("user.dir")
+          + File.separator
+          + System.getProperty("DefaultConfigNodeProperties");
+  private final String defaultCommonPropertiesFile =
+      System.getProperty("user.dir")
+          + File.separator
+          + System.getProperty("DefaultConfigNodeCommonProperties");
 
   public ConfigNodeWrapper(
       boolean isSeed,
@@ -45,38 +52,51 @@ public class ConfigNodeWrapper extends AbstractNodeWrapper {
     } else {
       this.targetConfigNodes = targetConfigNodes;
     }
-  }
 
-  @Override
-  protected void updateConfig(Properties properties) {
-    properties.setProperty(IoTDBConstant.CN_INTERNAL_ADDRESS, super.getIp());
-    properties.setProperty(IoTDBConstant.CN_INTERNAL_PORT, String.valueOf(getPort()));
-    properties.setProperty(IoTDBConstant.CN_CONSENSUS_PORT, String.valueOf(this.consensusPort));
-    properties.setProperty(IoTDBConstant.CN_TARGET_CONFIG_NODE_LIST, this.targetConfigNodes);
-    properties.setProperty(
-        "config_node_consensus_protocol_class",
+    // initialize mutable properties
+    mutableCommonProperties.setProperty(
+        propertyKeyConfigNodeConsensusProtocolClass,
         "org.apache.iotdb.consensus.simple.SimpleConsensus");
-    properties.setProperty(
-        "schema_region_consensus_protocol_class",
+    mutableCommonProperties.setProperty(
+        propertyKeySchemaRegionConsensusProtocolClass,
         "org.apache.iotdb.consensus.simple.SimpleConsensus");
-    properties.setProperty(
-        "data_region_consensus_protocol_class",
+    mutableCommonProperties.setProperty(
+        propertyKeyDataRegionConsensusProtocolClass,
         "org.apache.iotdb.consensus.simple.SimpleConsensus");
-    properties.setProperty("schema_replication_factor", "1");
-    properties.setProperty("data_replication_factor", "1");
-    properties.setProperty("cn_connection_timeout_ms", "30000");
+    mutableCommonProperties.setProperty(propertyKeySchemaReplicationFactor, "1");
+    mutableCommonProperties.setProperty(propertyKeyDataReplicationFactor, "1");
+
+    mutableNodeProperties.put("cn_connection_timeout_ms", "30000");
+
+    // initialize immutable properties
+    immutableNodeProperties.setProperty(IoTDBConstant.CN_INTERNAL_ADDRESS, super.getIp());
+    immutableNodeProperties.setProperty(IoTDBConstant.CN_INTERNAL_PORT, String.valueOf(getPort()));
+    immutableNodeProperties.setProperty(
+        IoTDBConstant.CN_CONSENSUS_PORT, String.valueOf(this.consensusPort));
+    immutableNodeProperties.setProperty(
+        IoTDBConstant.CN_TARGET_CONFIG_NODE_LIST, this.targetConfigNodes);
   }
 
   @Override
-  protected String getConfigPath() {
+  protected String getTargetNodeConfigPath() {
     return workDirFilePath("conf", "iotdb-confignode.properties");
   }
 
   @Override
-  protected String getCommonConfigPath() {
+  protected String getTargetCommonConfigPath() {
     return workDirFilePath("conf", "iotdb-common.properties");
   }
 
+  @Override
+  protected String getDefaultNodeConfigPath() {
+    return defaultNodePropertiesFile;
+  }
+
+  @Override
+  protected String getDefaultCommonConfigPath() {
+    return defaultCommonPropertiesFile;
+  }
+
   @Override
   public String getSystemPropertiesPath() {
     return workDirFilePath("data/confignode/system", "confignode-system.properties");
diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/DataNodeWrapper.java b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/DataNodeWrapper.java
similarity index 62%
rename from integration-test/src/main/java/org/apache/iotdb/it/env/DataNodeWrapper.java
rename to integration-test/src/main/java/org/apache/iotdb/it/env/cluster/DataNodeWrapper.java
index 22551ab16f..d8353babef 100644
--- a/integration-test/src/main/java/org/apache/iotdb/it/env/DataNodeWrapper.java
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/DataNodeWrapper.java
@@ -16,18 +16,15 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.iotdb.it.env;
+package org.apache.iotdb.it.env.cluster;
 
 import org.apache.iotdb.commons.conf.IoTDBConstant;
 
 import java.io.File;
 import java.util.Arrays;
 import java.util.List;
-import java.util.Properties;
 
 public class DataNodeWrapper extends AbstractNodeWrapper {
-
-  private final String targetConfigNode;
   private int mppDataExchangePort;
   private int internalPort;
   private final String internalAddress;
@@ -35,50 +32,80 @@ public class DataNodeWrapper extends AbstractNodeWrapper {
   private final int schemaRegionConsensusPort;
   private final int mqttPort;
 
+  private final String defaultNodePropertiesFile =
+      System.getProperty("user.dir")
+          + File.separator
+          + System.getProperty("DefaultDataNodeProperties");
+  private final String defaultCommonPropertiesFile =
+      System.getProperty("user.dir")
+          + File.separator
+          + System.getProperty("DefaultDataNodeCommonProperties");
+
   public DataNodeWrapper(
       String targetConfigNode, String testClassName, String testMethodName, int[] portList) {
     super(testClassName, testMethodName, portList);
-    this.targetConfigNode = targetConfigNode;
     this.internalAddress = super.getIp();
     this.mppDataExchangePort = portList[1];
     this.internalPort = portList[2];
     this.dataRegionConsensusPort = portList[3];
     this.schemaRegionConsensusPort = portList[4];
     this.mqttPort = portList[5];
-  }
 
-  @Override
-  protected void updateConfig(Properties properties) {
-    properties.setProperty(IoTDBConstant.DN_RPC_ADDRESS, super.getIp());
-    properties.setProperty(IoTDBConstant.DN_RPC_PORT, String.valueOf(super.getPort()));
-    properties.setProperty(IoTDBConstant.DN_INTERNAL_ADDRESS, this.internalAddress);
-    properties.setProperty(IoTDBConstant.DN_INTERNAL_PORT, String.valueOf(this.internalPort));
-    properties.setProperty("dn_mpp_data_exchange_port", String.valueOf(this.mppDataExchangePort));
-    properties.setProperty(
+    // initialize mutable properties
+    mutableCommonProperties.setProperty(
+        propertyKeyConfigNodeConsensusProtocolClass,
+        "org.apache.iotdb.consensus.simple.SimpleConsensus");
+    mutableCommonProperties.setProperty(
+        propertyKeySchemaRegionConsensusProtocolClass,
+        "org.apache.iotdb.consensus.simple.SimpleConsensus");
+    mutableCommonProperties.setProperty(
+        propertyKeyDataRegionConsensusProtocolClass,
+        "org.apache.iotdb.consensus.simple.SimpleConsensus");
+    mutableCommonProperties.setProperty(propertyKeySchemaReplicationFactor, "1");
+    mutableCommonProperties.setProperty(propertyKeyDataReplicationFactor, "1");
+    mutableCommonProperties.put("max_tsblock_size_in_bytes", "1024");
+    mutableCommonProperties.put("page_size_in_byte", "1024");
+
+    mutableNodeProperties.put("dn_join_cluster_retry_interval_ms", "1000");
+    mutableNodeProperties.put("dn_connection_timeout_ms", "30000");
+
+    // initialize immutable properties
+    immutableNodeProperties.setProperty(IoTDBConstant.DN_RPC_ADDRESS, super.getIp());
+    immutableNodeProperties.setProperty(IoTDBConstant.DN_RPC_PORT, String.valueOf(super.getPort()));
+    immutableNodeProperties.setProperty(IoTDBConstant.DN_INTERNAL_ADDRESS, this.internalAddress);
+    immutableNodeProperties.setProperty(
+        IoTDBConstant.DN_INTERNAL_PORT, String.valueOf(this.internalPort));
+    immutableNodeProperties.setProperty(
+        "dn_mpp_data_exchange_port", String.valueOf(this.mppDataExchangePort));
+    immutableNodeProperties.setProperty(
         "dn_data_region_consensus_port", String.valueOf(this.dataRegionConsensusPort));
-    properties.setProperty(
+    immutableNodeProperties.setProperty(
         "dn_schema_region_consensus_port", String.valueOf(this.schemaRegionConsensusPort));
-    properties.setProperty("dn_join_cluster_retry_interval_ms", "1000");
-    properties.setProperty("mqtt_host", super.getIp());
-    properties.setProperty("mqtt_port", String.valueOf(this.mqttPort));
-    properties.setProperty("dn_connection_timeout_ms", "30000");
-    if (this.targetConfigNode != null) {
-      properties.setProperty(IoTDBConstant.DN_TARGET_CONFIG_NODE_LIST, this.targetConfigNode);
-    }
-    properties.setProperty("max_tsblock_size_in_bytes", "1024");
-    properties.setProperty("page_size_in_byte", "1024");
+    immutableNodeProperties.setProperty(IoTDBConstant.DN_TARGET_CONFIG_NODE_LIST, targetConfigNode);
+    immutableCommonProperties.setProperty("mqtt_host", super.getIp());
+    immutableCommonProperties.setProperty("mqtt_port", String.valueOf(this.mqttPort));
   }
 
   @Override
-  protected String getConfigPath() {
+  protected String getTargetNodeConfigPath() {
     return workDirFilePath("conf", "iotdb-datanode.properties");
   }
 
   @Override
-  protected String getCommonConfigPath() {
+  protected String getTargetCommonConfigPath() {
     return workDirFilePath("conf", "iotdb-common.properties");
   }
 
+  @Override
+  protected String getDefaultNodeConfigPath() {
+    return defaultNodePropertiesFile;
+  }
+
+  @Override
+  protected String getDefaultCommonConfigPath() {
+    return defaultCommonPropertiesFile;
+  }
+
   @Override
   public String getSystemPropertiesPath() {
     return workDirFilePath("data/datanode/system/schema", "system.properties");
diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/EnvUtils.java b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/EnvUtils.java
similarity index 81%
rename from integration-test/src/main/java/org/apache/iotdb/it/env/EnvUtils.java
rename to integration-test/src/main/java/org/apache/iotdb/it/env/cluster/EnvUtils.java
index 381c5cdbe7..66119347a8 100644
--- a/integration-test/src/main/java/org/apache/iotdb/it/env/EnvUtils.java
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/EnvUtils.java
@@ -16,7 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.iotdb.it.env;
+package org.apache.iotdb.it.env.cluster;
+
+import org.apache.iotdb.tsfile.utils.Pair;
 
 import org.apache.commons.lang3.SystemUtils;
 
@@ -87,4 +89,20 @@ public class EnvUtils {
   public static String getLockFilePath(int port) {
     return lockFilePath + port;
   }
+
+  public static Pair<Integer, Integer> getNodeNum() {
+    int configNodeNum = 0;
+    int dataNodeNum = 0;
+    try {
+      configNodeNum = Integer.parseInt(System.getProperty("DefaultConfigNodeNum", "1"));
+    } catch (NumberFormatException e) {
+      throw new RuntimeException("Invalid config node number: " + configNodeNum);
+    }
+    try {
+      dataNodeNum = Integer.parseInt(System.getProperty("DefaultConfigNodeNum", "3"));
+    } catch (NumberFormatException e) {
+      throw new RuntimeException("Invalid data node number: " + configNodeNum);
+    }
+    return new Pair<>(configNodeNum, dataNodeNum);
+  }
 }
diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/MppBaseConfig.java b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/MppBaseConfig.java
new file mode 100644
index 0000000000..f9fc53a626
--- /dev/null
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/MppBaseConfig.java
@@ -0,0 +1,112 @@
+/*
+ * 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.it.env.cluster;
+
+import javax.annotation.Nullable;
+import javax.validation.constraints.NotNull;
+
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.Properties;
+
+/** this class stands for a config object of one single property file */
+public abstract class MppBaseConfig {
+
+  private final Properties properties;
+
+  /** Create an empty MppPersistentConfig. */
+  public MppBaseConfig() {
+    this.properties = new Properties();
+  }
+
+  /**
+   * Create a MppPersistentConfig from the property file.
+   *
+   * @param filePath the property file path.
+   */
+  public MppBaseConfig(String filePath) throws IOException {
+    this();
+    updateProperties(filePath);
+  }
+
+  /**
+   * Put all the key-value pairs of input properties to the current instance one. If the key is
+   * existed in both, the value will be overridden.
+   *
+   * @param properties the properties to update with.
+   */
+  public final void updateProperties(@NotNull Properties properties) {
+    this.properties.putAll(properties);
+  }
+
+  /**
+   * Put all the properties of the input persistent config to the current instance. If the key is
+   * existed in both, the value will be overridden.
+   *
+   * @param persistentConfig the config instance to update with.
+   */
+  public void updateProperties(@NotNull MppBaseConfig persistentConfig) {
+    updateProperties(persistentConfig.properties);
+  }
+
+  /**
+   * Put all the properties of the input file to the current instance. If the key is existed in
+   * both, the value will be overridden.
+   *
+   * @param filePath the path of the properties file to update with. If it's null, then nothing will
+   *     happen.
+   * @throws IOException there's some errors during processing the file.
+   */
+  public final void updateProperties(@Nullable String filePath) throws IOException {
+    if (filePath == null) {
+      return;
+    }
+    try (InputStream confInput = Files.newInputStream(Paths.get(filePath))) {
+      properties.load(confInput);
+    }
+  }
+
+  /**
+   * Persistent the properties to the file.
+   *
+   * @param filePath the file path.
+   */
+  public final void persistent(String filePath) throws IOException {
+    try (FileWriter confOutput = new FileWriter(filePath)) {
+      properties.store(confOutput, null);
+    }
+  }
+
+  /**
+   * Set a property with the input key and value. If the key is existed, the value will be
+   * overridden.
+   *
+   * @param key the key.
+   * @param value the value.
+   */
+  protected void setProperty(String key, String value) {
+    properties.setProperty(key, value);
+  }
+
+  /** Create an instance but with empty properties. */
+  public abstract MppBaseConfig emptyClone();
+}
diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/MppClusterConfig.java b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/MppClusterConfig.java
new file mode 100644
index 0000000000..a9bc0e1b88
--- /dev/null
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/MppClusterConfig.java
@@ -0,0 +1,60 @@
+/*
+ * 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.it.env.cluster;
+
+import org.apache.iotdb.itbase.env.ClusterConfig;
+import org.apache.iotdb.itbase.env.CommonConfig;
+import org.apache.iotdb.itbase.env.ConfigNodeConfig;
+import org.apache.iotdb.itbase.env.DataNodeConfig;
+
+/** MppClusterConfig stores a whole cluster config items. */
+public class MppClusterConfig implements ClusterConfig {
+
+  private final MppConfigNodeConfig configNodeConfig;
+  private final MppDataNodeConfig dataNodeConfig;
+  private final MppCommonConfig configNodeCommonConfig;
+  private final MppCommonConfig dataNodeCommonConfig;
+
+  public MppClusterConfig() {
+    this.configNodeConfig = new MppConfigNodeConfig();
+    this.dataNodeConfig = new MppDataNodeConfig();
+    this.configNodeCommonConfig = new MppCommonConfig();
+    this.dataNodeCommonConfig = new MppCommonConfig();
+  }
+
+  @Override
+  public DataNodeConfig getDataNodeConfig() {
+    return dataNodeConfig;
+  }
+
+  @Override
+  public CommonConfig getDataNodeCommonConfig() {
+    return dataNodeCommonConfig;
+  }
+
+  @Override
+  public ConfigNodeConfig getConfigNodeConfig() {
+    return configNodeConfig;
+  }
+
+  @Override
+  public CommonConfig getConfigNodeCommonConfig() {
+    return configNodeCommonConfig;
+  }
+}
diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/MppCommonConfig.java b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/MppCommonConfig.java
new file mode 100644
index 0000000000..1c1442ede5
--- /dev/null
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/MppCommonConfig.java
@@ -0,0 +1,322 @@
+/*
+ * 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.it.env.cluster;
+
+import org.apache.iotdb.itbase.env.CommonConfig;
+
+import java.io.IOException;
+
+public class MppCommonConfig extends MppBaseConfig implements CommonConfig {
+
+  public MppCommonConfig() {
+    super();
+  }
+
+  public MppCommonConfig(String filePath) throws IOException {
+    super(filePath);
+  }
+
+  @Override
+  public void updateProperties(MppBaseConfig persistentConfig) {
+    if (persistentConfig instanceof MppCommonConfig) {
+      super.updateProperties(persistentConfig);
+    } else {
+      throw new UnsupportedOperationException(
+          "MppCommonConfig can't be override by an instance of "
+              + persistentConfig.getClass().getCanonicalName());
+    }
+  }
+
+  @Override
+  public MppBaseConfig emptyClone() {
+    return new MppCommonConfig();
+  }
+
+  @Override
+  public CommonConfig setMaxNumberOfPointsInPage(int maxNumberOfPointsInPage) {
+    setProperty("max_number_of_points_in_page", String.valueOf(maxNumberOfPointsInPage));
+    return this;
+  }
+
+  @Override
+  public CommonConfig setPageSizeInByte(int pageSizeInByte) {
+    setProperty("page_size_in_byte", String.valueOf(pageSizeInByte));
+    return this;
+  }
+
+  @Override
+  public CommonConfig setGroupSizeInByte(int groupSizeInByte) {
+    setProperty("group_size_in_byte", String.valueOf(groupSizeInByte));
+    return this;
+  }
+
+  @Override
+  public CommonConfig setMemtableSizeThreshold(long memtableSizeThreshold) {
+    setProperty("memtable_size_threshold", String.valueOf(memtableSizeThreshold));
+    return this;
+  }
+
+  @Override
+  public CommonConfig setPartitionInterval(long partitionInterval) {
+    setProperty("time_partition_interval", String.valueOf(partitionInterval));
+    return this;
+  }
+
+  @Override
+  public CommonConfig setCompressor(String compressor) {
+    setProperty("compressor", compressor);
+    return this;
+  }
+
+  @Override
+  public CommonConfig setMaxQueryDeduplicatedPathNum(int maxQueryDeduplicatedPathNum) {
+    setProperty("max_deduplicated_path_num", String.valueOf(maxQueryDeduplicatedPathNum));
+    return this;
+  }
+
+  @Override
+  public CommonConfig setUdfMemoryBudgetInMB(float udfCollectorMemoryBudgetInMB) {
+    // udf_memory_budget_in_mb
+    // udf_reader_transformer_collector_memory_proportion
+    setProperty("udf_memory_budget_in_mb", String.valueOf(udfCollectorMemoryBudgetInMB * 3));
+    return this;
+  }
+
+  @Override
+  public CommonConfig setEnableSeqSpaceCompaction(boolean enableSeqSpaceCompaction) {
+    setProperty("enable_seq_space_compaction", String.valueOf(enableSeqSpaceCompaction));
+    return this;
+  }
+
+  @Override
+  public CommonConfig setEnableUnseqSpaceCompaction(boolean enableUnseqSpaceCompaction) {
+    setProperty("enable_unseq_space_compaction", String.valueOf(enableUnseqSpaceCompaction));
+    return this;
+  }
+
+  @Override
+  public CommonConfig setEnableCrossSpaceCompaction(boolean enableCrossSpaceCompaction) {
+    setProperty("enable_cross_space_compaction", String.valueOf(enableCrossSpaceCompaction));
+    return this;
+  }
+
+  @Override
+  public CommonConfig setAutoCreateSchemaEnabled(boolean enableAutoCreateSchema) {
+    setProperty("enable_auto_create_schema", String.valueOf(enableAutoCreateSchema));
+    return this;
+  }
+
+  @Override
+  public CommonConfig setEnableLastCache(boolean lastCacheEnable) {
+    setProperty("enable_last_cache", String.valueOf(lastCacheEnable));
+    return this;
+  }
+
+  @Override
+  public CommonConfig setPrimitiveArraySize(int primitiveArraySize) {
+    setProperty("primitive_array_size", String.valueOf(primitiveArraySize));
+    return this;
+  }
+
+  @Override
+  public CommonConfig setAvgSeriesPointNumberThreshold(int avgSeriesPointNumberThreshold) {
+    setProperty("avg_series_point_number_threshold", String.valueOf(avgSeriesPointNumberThreshold));
+    return this;
+  }
+
+  @Override
+  public CommonConfig setMaxTsBlockLineNumber(int maxTsBlockLineNumber) {
+    setProperty("max_tsblock_line_number", String.valueOf(maxTsBlockLineNumber));
+    return this;
+  }
+
+  @Override
+  public CommonConfig setConfigNodeConsesusProtocolClass(String configNodeConsesusProtocolClass) {
+    setProperty("config_node_consensus_protocol_class", configNodeConsesusProtocolClass);
+    return this;
+  }
+
+  @Override
+  public CommonConfig setSchemaRegionConsensusProtocolClass(
+      String schemaRegionConsensusProtocolClass) {
+    setProperty("schema_region_consensus_protocol_class", schemaRegionConsensusProtocolClass);
+    return this;
+  }
+
+  @Override
+  public CommonConfig setDataRegionConsensusProtocolClass(String dataRegionConsensusProtocolClass) {
+    setProperty("data_region_consensus_protocol_class", dataRegionConsensusProtocolClass);
+    return this;
+  }
+
+  @Override
+  public CommonConfig setSchemaRegionGroupExtensionPolicy(String schemaRegionGroupExtensionPolicy) {
+    setProperty("schema_region_group_extension_policy", schemaRegionGroupExtensionPolicy);
+    return this;
+  }
+
+  @Override
+  public CommonConfig setSchemaRegionGroupPerDatabase(int schemaRegionGroupPerDatabase) {
+    setProperty("schema_region_group_per_database", String.valueOf(schemaRegionGroupPerDatabase));
+    return this;
+  }
+
+  @Override
+  public CommonConfig setDataRegionGroupExtensionPolicy(String dataRegionGroupExtensionPolicy) {
+    setProperty("data_region_group_extension_policy", dataRegionGroupExtensionPolicy);
+    return this;
+  }
+
+  @Override
+  public CommonConfig setDataRegionGroupPerDatabase(int dataRegionGroupPerDatabase) {
+    setProperty("data_region_group_per_database", String.valueOf(dataRegionGroupPerDatabase));
+    return this;
+  }
+
+  @Override
+  public CommonConfig setSchemaReplicationFactor(int schemaReplicationFactor) {
+    setProperty("schema_replication_factor", String.valueOf(schemaReplicationFactor));
+    return this;
+  }
+
+  @Override
+  public CommonConfig setEnableDataPartitionInheritPolicy(
+      boolean enableDataPartitionInheritPolicy) {
+    setProperty(
+        "enable_data_partition_inherit_policy", String.valueOf(enableDataPartitionInheritPolicy));
+    return this;
+  }
+
+  @Override
+  public CommonConfig setDataReplicationFactor(int dataReplicationFactor) {
+    setProperty("data_replication_factor", String.valueOf(dataReplicationFactor));
+    return this;
+  }
+
+  @Override
+  public CommonConfig setTimePartitionInterval(long timePartitionInterval) {
+    setProperty("time_partition_interval", String.valueOf(timePartitionInterval));
+    return this;
+  }
+
+  @Override
+  public CommonConfig setEnableMemControl(boolean enableMemControl) {
+    setProperty("enable_mem_control", String.valueOf(enableMemControl));
+    return this;
+  }
+
+  @Override
+  public CommonConfig setConfigNodeRatisSnapshotTriggerThreshold(
+      int ratisSnapshotTriggerThreshold) {
+    setProperty(
+        "config_node_ratis_snapshot_trigger_threshold",
+        String.valueOf(ratisSnapshotTriggerThreshold));
+    return this;
+  }
+
+  @Override
+  public CommonConfig setMaxDegreeOfIndexNode(int maxDegreeOfIndexNode) {
+    setProperty("max_degree_of_index_node", String.valueOf(maxDegreeOfIndexNode));
+    return this;
+  }
+
+  @Override
+  public CommonConfig setEnableWatermark(boolean enableWatermark) {
+    setProperty("watermark_module_opened", String.valueOf(enableWatermark));
+    return this;
+  }
+
+  @Override
+  public CommonConfig setWatermarkSecretKey(String watermarkSecretKey) {
+    setProperty("watermark_secret_key", watermarkSecretKey);
+    return this;
+  }
+
+  @Override
+  public CommonConfig setWatermarkBitString(String watermarkBitString) {
+    setProperty("watermark_bit_string", watermarkBitString);
+    return this;
+  }
+
+  @Override
+  public CommonConfig setWatermarkMethod(String watermarkMethod) {
+    setProperty("watermark_method", watermarkMethod);
+    return this;
+  }
+
+  @Override
+  public CommonConfig setEnableMQTTService(boolean enableMQTTService) {
+    setProperty("enable_mqtt_service", String.valueOf(enableMQTTService));
+    return this;
+  }
+
+  @Override
+  public CommonConfig setSchemaEngineMode(String schemaEngineMode) {
+    setProperty("schema_engine_mode", schemaEngineMode);
+    return this;
+  }
+
+  @Override
+  public CommonConfig setSelectIntoInsertTabletPlanRowLimit(
+      int selectIntoInsertTabletPlanRowLimit) {
+    setProperty(
+        "select_into_insert_tablet_plan_row_limit",
+        String.valueOf(selectIntoInsertTabletPlanRowLimit));
+    return this;
+  }
+
+  @Override
+  public CommonConfig setEnableAutoLeaderBalanceForRatisConsensus(
+      boolean enableAutoLeaderBalanceForRatisConsensus) {
+    setProperty(
+        "enable_auto_leader_balance_for_ratis_consensus",
+        String.valueOf(enableAutoLeaderBalanceForRatisConsensus));
+    return this;
+  }
+
+  @Override
+  public CommonConfig setEnableAutoLeaderBalanceForIoTConsensus(
+      boolean enableAutoLeaderBalanceForIoTConsensus) {
+    setProperty(
+        "enable_auto_leader_balance_for_iot_consensus",
+        String.valueOf(enableAutoLeaderBalanceForIoTConsensus));
+    return this;
+  }
+
+  @Override
+  public CommonConfig setLeastDataRegionGroupNum(int leastDataRegionGroupNum) {
+    setProperty("least_data_region_group_num", String.valueOf(leastDataRegionGroupNum));
+    return this;
+  }
+
+  @Override
+  public CommonConfig setQueryThreadCount(int queryThreadCount) {
+    if (queryThreadCount <= 0) {
+      queryThreadCount = Runtime.getRuntime().availableProcessors();
+    }
+    setProperty("query_thread_count", String.valueOf(queryThreadCount));
+    return this;
+  }
+
+  @Override
+  public CommonConfig setDataRatisTriggerSnapshotThreshold(long threshold) {
+    setProperty("data_region_ratis_snapshot_trigger_threshold", String.valueOf(threshold));
+    return this;
+  }
+}
diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/MppConfigNodeConfig.java b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/MppConfigNodeConfig.java
new file mode 100644
index 0000000000..aa8270f49a
--- /dev/null
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/MppConfigNodeConfig.java
@@ -0,0 +1,56 @@
+/*
+ * 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.it.env.cluster;
+
+import org.apache.iotdb.itbase.env.ConfigNodeConfig;
+
+import java.io.IOException;
+
+public class MppConfigNodeConfig extends MppBaseConfig implements ConfigNodeConfig {
+
+  public MppConfigNodeConfig() {
+    super();
+  }
+
+  public MppConfigNodeConfig(String filePath) throws IOException {
+    super(filePath);
+  }
+
+  @Override
+  public MppBaseConfig emptyClone() {
+    return new MppConfigNodeConfig();
+  }
+
+  @Override
+  public ConfigNodeConfig setSeriesPartitionSlotNum(int seriesPartitionSlotNum) {
+    setProperty("series_partition_slot_num", String.valueOf(seriesPartitionSlotNum));
+    return this;
+  }
+
+  @Override
+  public void updateProperties(MppBaseConfig persistentConfig) {
+    if (persistentConfig instanceof MppConfigNodeConfig) {
+      super.updateProperties(persistentConfig);
+    } else {
+      throw new UnsupportedOperationException(
+          "MppConfigNodeConfig can't be override by an instance of "
+              + persistentConfig.getClass().getCanonicalName());
+    }
+  }
+}
diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/SimpleEnv.java b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/MppDataNodeConfig.java
similarity index 52%
copy from integration-test/src/main/java/org/apache/iotdb/it/env/SimpleEnv.java
copy to integration-test/src/main/java/org/apache/iotdb/it/env/cluster/MppDataNodeConfig.java
index df64a56a52..3489db62af 100644
--- a/integration-test/src/main/java/org/apache/iotdb/it/env/SimpleEnv.java
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/MppDataNodeConfig.java
@@ -16,30 +16,35 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.iotdb.it.env;
+package org.apache.iotdb.it.env.cluster;
 
-import org.apache.iotdb.it.framework.IoTDBTestLogger;
+import org.apache.iotdb.itbase.env.DataNodeConfig;
 
-import org.slf4j.Logger;
+import java.io.IOException;
 
-public class SimpleEnv extends AbstractEnv {
+public class MppDataNodeConfig extends MppBaseConfig implements DataNodeConfig {
 
-  private static final Logger logger = IoTDBTestLogger.logger;
+  public MppDataNodeConfig() {
+    super();
+  }
 
-  @Override
-  public void initBeforeClass() throws InterruptedException {
-    logger.debug("=======start init class=======");
-    super.initEnvironment(1, 1);
+  public MppDataNodeConfig(String filePath) throws IOException {
+    super(filePath);
   }
 
   @Override
-  public void initClusterEnvironment(int configNodesNum, int dataNodesNum) {
-    // Do nothing
+  public MppBaseConfig emptyClone() {
+    return new MppDataNodeConfig();
   }
 
   @Override
-  public void initBeforeTest() {
-    logger.debug("=======start init test=======");
-    initEnvironment(1, 1);
+  public void updateProperties(MppBaseConfig persistentConfig) {
+    if (persistentConfig instanceof MppDataNodeConfig) {
+      super.updateProperties(persistentConfig);
+    } else {
+      throw new UnsupportedOperationException(
+          "MppDataNodeConfig can't be override by an instance of "
+              + persistentConfig.getClass().getCanonicalName());
+    }
   }
 }
diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/SimpleEnv.java b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/SimpleEnv.java
similarity index 69%
rename from integration-test/src/main/java/org/apache/iotdb/it/env/SimpleEnv.java
rename to integration-test/src/main/java/org/apache/iotdb/it/env/cluster/SimpleEnv.java
index df64a56a52..a4ef565d9b 100644
--- a/integration-test/src/main/java/org/apache/iotdb/it/env/SimpleEnv.java
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/SimpleEnv.java
@@ -16,30 +16,17 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.iotdb.it.env;
-
-import org.apache.iotdb.it.framework.IoTDBTestLogger;
-
-import org.slf4j.Logger;
+package org.apache.iotdb.it.env.cluster;
 
 public class SimpleEnv extends AbstractEnv {
 
-  private static final Logger logger = IoTDBTestLogger.logger;
-
   @Override
-  public void initBeforeClass() throws InterruptedException {
-    logger.debug("=======start init class=======");
+  public void initClusterEnvironment() {
     super.initEnvironment(1, 1);
   }
 
   @Override
   public void initClusterEnvironment(int configNodesNum, int dataNodesNum) {
-    // Do nothing
-  }
-
-  @Override
-  public void initBeforeTest() {
-    logger.debug("=======start init test=======");
-    initEnvironment(1, 1);
+    throw new UnsupportedOperationException("Different node numbers in SimpleEnv is not supported");
   }
 }
diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/remote/RemoteServerConfig.java b/integration-test/src/main/java/org/apache/iotdb/it/env/remote/RemoteServerConfig.java
new file mode 100644
index 0000000000..d62c0387a2
--- /dev/null
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/remote/RemoteServerConfig.java
@@ -0,0 +1,57 @@
+/*
+ * 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.it.env.remote;
+
+import org.apache.iotdb.itbase.env.ClusterConfig;
+import org.apache.iotdb.itbase.env.CommonConfig;
+import org.apache.iotdb.itbase.env.ConfigNodeConfig;
+import org.apache.iotdb.itbase.env.DataNodeConfig;
+
+public class RemoteServerConfig implements ClusterConfig {
+
+  private final CommonConfig commonConfig = new RemoteCommonConfig();
+  private final ConfigNodeConfig configNodeConfig = new RemoteConfigNodeConfig();
+  private final DataNodeConfig dataNodeConfig = new RemoteDataNodeConfig();
+
+  @Override
+  public DataNodeConfig getDataNodeConfig() {
+    return dataNodeConfig;
+  }
+
+  @Override
+  public CommonConfig getDataNodeCommonConfig() {
+    return commonConfig;
+  }
+
+  @Override
+  public ConfigNodeConfig getConfigNodeConfig() {
+    return configNodeConfig;
+  }
+
+  @Override
+  public CommonConfig getConfigNodeCommonConfig() {
+    return commonConfig;
+  }
+
+  private static class RemoteDataNodeConfig implements DataNodeConfig {}
+
+  private static class RemoteConfigNodeConfig implements ConfigNodeConfig {}
+
+  private static class RemoteCommonConfig implements CommonConfig {}
+}
diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/RemoteServerEnv.java b/integration-test/src/main/java/org/apache/iotdb/it/env/remote/RemoteServerEnv.java
similarity index 88%
rename from integration-test/src/main/java/org/apache/iotdb/it/env/RemoteServerEnv.java
rename to integration-test/src/main/java/org/apache/iotdb/it/env/remote/RemoteServerEnv.java
index 9cf6344f9e..a5a5063f97 100644
--- a/integration-test/src/main/java/org/apache/iotdb/it/env/RemoteServerEnv.java
+++ b/integration-test/src/main/java/org/apache/iotdb/it/env/remote/RemoteServerEnv.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.iotdb.it.env;
+package org.apache.iotdb.it.env.remote;
 
 import org.apache.iotdb.common.rpc.thrift.TEndPoint;
 import org.apache.iotdb.commons.client.IClientManager;
@@ -25,13 +25,16 @@ import org.apache.iotdb.commons.client.sync.SyncConfigNodeIServiceClient;
 import org.apache.iotdb.confignode.rpc.thrift.IConfigNodeRPCService;
 import org.apache.iotdb.db.client.DataNodeClientPoolFactory;
 import org.apache.iotdb.isession.ISession;
+import org.apache.iotdb.it.env.EnvFactory;
+import org.apache.iotdb.it.env.cluster.ConfigNodeWrapper;
+import org.apache.iotdb.it.env.cluster.DataNodeWrapper;
 import org.apache.iotdb.itbase.env.BaseEnv;
+import org.apache.iotdb.itbase.env.ClusterConfig;
 import org.apache.iotdb.jdbc.Config;
 import org.apache.iotdb.jdbc.Constant;
 import org.apache.iotdb.rpc.IoTDBConnectionException;
 import org.apache.iotdb.session.Session;
 
-import java.io.IOException;
 import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.SQLException;
@@ -48,9 +51,10 @@ public class RemoteServerEnv implements BaseEnv {
   private final String user = System.getProperty("RemoteUser", "root");
   private final String password = System.getProperty("RemotePassword", "root");
   private IClientManager<TEndPoint, SyncConfigNodeIServiceClient> clientManager;
+  private RemoteServerConfig clusterConfig = new RemoteServerConfig();
 
   @Override
-  public void initBeforeClass() {
+  public void initClusterEnvironment() {
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
       statement.execute("CREATE DATABASE root.init;");
@@ -67,29 +71,18 @@ public class RemoteServerEnv implements BaseEnv {
 
   @Override
   public void initClusterEnvironment(int configNodesNum, int dataNodesNum) {
-    // Do nothing
+    throw new UnsupportedOperationException("Different node numbers in RemoteEnv is not supported");
   }
 
   @Override
-  public void cleanAfterClass() {
+  public void cleanClusterEnvironment() {
     clientManager.close();
+    clusterConfig = new RemoteServerConfig();
   }
 
   @Override
-  public void initBeforeTest() {
-    try (Connection connection = EnvFactory.getEnv().getConnection();
-        Statement statement = connection.createStatement()) {
-      statement.execute("CREATE DATABASE root.init;");
-      statement.execute("DELETE DATABASE root;");
-    } catch (Exception e) {
-      e.printStackTrace();
-      fail(e.getMessage());
-    }
-  }
-
-  @Override
-  public void cleanAfterTest() {
-    clientManager.close();
+  public ClusterConfig getConfig() {
+    return clusterConfig;
   }
 
   @Override
@@ -146,21 +139,11 @@ public class RemoteServerEnv implements BaseEnv {
     return null;
   }
 
-  @Override
-  public void setConfigNodeWrapperList(List<ConfigNodeWrapper> configNodeWrapperList) {
-    // Do nothing
-  }
-
   @Override
   public List<DataNodeWrapper> getDataNodeWrapperList() {
     return null;
   }
 
-  @Override
-  public void setDataNodeWrapperList(List<DataNodeWrapper> dataNodeWrapperList) {
-    // Do nothing
-  }
-
   @Override
   public IConfigNodeRPCService.Iface getLeaderConfigNodeConnection() throws ClientManagerException {
     return clientManager.borrowClient(new TEndPoint(ip_addr, 10710));
@@ -174,7 +157,7 @@ public class RemoteServerEnv implements BaseEnv {
   }
 
   @Override
-  public int getLeaderConfigNodeIndex() throws IOException {
+  public int getLeaderConfigNodeIndex() {
     return -1;
   }
 
diff --git a/integration-test/src/main/java/org/apache/iotdb/itbase/env/BaseConfig.java b/integration-test/src/main/java/org/apache/iotdb/itbase/env/BaseConfig.java
deleted file mode 100644
index 2a1a7eead5..0000000000
--- a/integration-test/src/main/java/org/apache/iotdb/itbase/env/BaseConfig.java
+++ /dev/null
@@ -1,447 +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.
- */
-package org.apache.iotdb.itbase.env;
-
-import java.util.Properties;
-
-public interface BaseConfig {
-
-  default void clearAllProperties() throws UnsupportedOperationException {
-    throw new UnsupportedOperationException("Method clearAllProperties not implement");
-  }
-
-  default Properties getEngineProperties() throws UnsupportedOperationException {
-    throw new UnsupportedOperationException("Method getEngineProperties not implement");
-  }
-
-  default Properties getConfignodeProperties() throws UnsupportedOperationException {
-    throw new UnsupportedOperationException("Method getConfignodeProperties not implement");
-  }
-
-  default BaseConfig setMaxNumberOfPointsInPage(int maxNumberOfPointsInPage) {
-    return this;
-  }
-
-  default int getPageSizeInByte() {
-    return 64 * 1024;
-  }
-
-  default BaseConfig setPageSizeInByte(int pageSizeInByte) {
-    return this;
-  }
-
-  default int getGroupSizeInByte() {
-    return 128 * 1024 * 1024;
-  }
-
-  default BaseConfig setGroupSizeInByte(int groupSizeInByte) {
-    return this;
-  }
-
-  default long getMemtableSizeThreshold() {
-    return 1024 * 1024 * 1024L;
-  }
-
-  default BaseConfig setMemtableSizeThreshold(long memtableSizeThreshold) {
-    return this;
-  }
-
-  default int getDataRegionNum() {
-    return 1;
-  }
-
-  default BaseConfig setDataRegionNum(int dataRegionNum) {
-    return this;
-  }
-
-  default BaseConfig setPartitionInterval(long partitionInterval) {
-    return this;
-  }
-
-  default long getPartitionInterval() {
-    return 604800;
-  }
-
-  default BaseConfig setCompressor(String compressor) {
-    return this;
-  }
-
-  default BaseConfig setMaxQueryDeduplicatedPathNum(int maxQueryDeduplicatedPathNum) {
-    return this;
-  }
-
-  default BaseConfig setRpcThriftCompressionEnable(boolean rpcThriftCompressionEnable) {
-    return this;
-  }
-
-  default BaseConfig setRpcAdvancedCompressionEnable(boolean rpcAdvancedCompressionEnable) {
-    return this;
-  }
-
-  default BaseConfig setUdfCollectorMemoryBudgetInMB(float udfCollectorMemoryBudgetInMB) {
-    return this;
-  }
-
-  default BaseConfig setUdfTransformerMemoryBudgetInMB(float udfTransformerMemoryBudgetInMB) {
-    return this;
-  }
-
-  default BaseConfig setUdfReaderMemoryBudgetInMB(float udfReaderMemoryBudgetInMB) {
-    return this;
-  }
-
-  default BaseConfig setEnableSeqSpaceCompaction(boolean enableSeqSpaceCompaction) {
-    return this;
-  }
-
-  default boolean isEnableSeqSpaceCompaction() {
-    return true;
-  }
-
-  default BaseConfig setEnableUnseqSpaceCompaction(boolean enableUnseqSpaceCompaction) {
-    return this;
-  }
-
-  default boolean isEnableMemControl() {
-    return true;
-  }
-
-  default BaseConfig setEnableMemControl(boolean enableMemControl) {
-    return this;
-  }
-
-  default boolean isEnableUnseqSpaceCompaction() {
-    return true;
-  }
-
-  default BaseConfig setEnableCrossSpaceCompaction(boolean enableCrossSpaceCompaction) {
-    return this;
-  }
-
-  default boolean isEnableCrossSpaceCompaction() {
-    return true;
-  }
-
-  default BaseConfig setEnableIDTable(boolean isEnableIDTable) {
-    return this;
-  }
-
-  default BaseConfig setDeviceIDTransformationMethod(String deviceIDTransformationMethod) {
-    return this;
-  }
-
-  default BaseConfig setAutoCreateSchemaEnabled(boolean enableAutoCreateSchema) {
-    return this;
-  }
-
-  default BaseConfig setEnableLastCache(boolean lastCacheEnable) {
-    return this;
-  }
-
-  default boolean isLastCacheEnabled() {
-    return true;
-  }
-
-  default int getMaxNumberOfPointsInPage() {
-    return 1024 * 1024;
-  }
-
-  default boolean isAutoCreateSchemaEnabled() {
-    return true;
-  }
-
-  default BaseConfig setPrimitiveArraySize(int primitiveArraySize) {
-    return this;
-  }
-
-  default int getPrimitiveArraySize() {
-    return 32;
-  }
-
-  default String getFlushCommand() {
-    return "flush";
-  }
-
-  default int getMaxQueryDeduplicatedPathNum() {
-    return 1000;
-  }
-
-  default int getAvgSeriesPointNumberThreshold() {
-    return 100000;
-  }
-
-  default BaseConfig setAvgSeriesPointNumberThreshold(int avgSeriesPointNumberThreshold) {
-    return this;
-  }
-
-  default int getMaxTsBlockLineNumber() {
-    return 1000;
-  }
-
-  default BaseConfig setMaxTsBlockLineNumber(int maxTsBlockLineNumber) {
-    return this;
-  }
-
-  default BaseConfig setConfigNodeConsesusProtocolClass(String configNodeConsesusProtocolClass) {
-    return this;
-  }
-
-  default String getClusterName() {
-    return "defaultCluster";
-  }
-
-  default String getConfigNodeConsensusProtocolClass() {
-    return "org.apache.iotdb.consensus.simple.SimpleConsensus";
-  }
-
-  default BaseConfig setSchemaRegionConsensusProtocolClass(
-      String schemaRegionConsensusProtocolClass) {
-    return this;
-  }
-
-  default String getSchemaRegionConsensusProtocolClass() {
-    return "org.apache.iotdb.consensus.simple.SimpleConsensus";
-  }
-
-  default BaseConfig setDataRegionConsensusProtocolClass(String dataRegionConsensusProtocolClass) {
-    return this;
-  }
-
-  default String getDataRegionConsensusProtocolClass() {
-    return "org.apache.iotdb.consensus.simple.SimpleConsensus";
-  }
-
-  default BaseConfig setEnableDataPartitionInheritPolicy(boolean enableDataPartitionInheritPolicy) {
-    return this;
-  }
-
-  default boolean isEnableDataPartitionInheritPolicy() {
-    return false;
-  }
-
-  default BaseConfig setSchemaRegionGroupExtensionPolicy(String schemaRegionGroupExtensionPolicy) {
-    return this;
-  }
-
-  default String getSchemaRegionGroupExtensionPolicy() {
-    return "AUTO";
-  }
-
-  default BaseConfig setSchemaRegionGroupPerDatabase(int schemaRegionGroupPerDatabase) {
-    return this;
-  }
-
-  default int getSchemaRegionGroupPerDatabase() {
-    return 1;
-  }
-
-  default BaseConfig setDataRegionGroupExtensionPolicy(String dataRegionGroupExtensionPolicy) {
-    return this;
-  }
-
-  default String getDataRegionGroupExtensionPolicy() {
-    return "AUTO";
-  }
-
-  default BaseConfig setDataRegionGroupPerDatabase(int dataRegionGroupPerDatabase) {
-    return this;
-  }
-
-  default int getDataRegionGroupPerDatabase() {
-    return 1;
-  }
-
-  default BaseConfig setSchemaReplicationFactor(int schemaReplicationFactor) {
-    return this;
-  }
-
-  default int getSchemaReplicationFactor() {
-    return 1;
-  }
-
-  default double getDataRegionPerProcessor() {
-    return 1.0;
-  }
-
-  default double getSchemaRegionPerDataNode() {
-    return 1.0;
-  }
-
-  default double getDiskSpaceWarningThreshold() {
-    return 0.05;
-  }
-
-  default String getReadConsistencyLevel() {
-    return "strong";
-  }
-
-  default BaseConfig setDataReplicationFactor(int dataReplicationFactor) {
-    return this;
-  }
-
-  default int getDataReplicationFactor() {
-    return 1;
-  }
-
-  default BaseConfig setSeriesPartitionSlotNum(int seriesPartitionSlotNum) {
-    return this;
-  }
-
-  default int getSeriesPartitionSlotNum() {
-    return 10000;
-  }
-
-  default String getSeriesPartitionExecutorClass() {
-    return "org.apache.iotdb.commons.partition.executor.hash.BKDRHashExecutor";
-  }
-
-  default long getDefaultTTL() {
-    return Long.MAX_VALUE;
-  }
-
-  default BaseConfig setTimePartitionInterval(long timePartitionInterval) {
-    return this;
-  }
-
-  default long getTimePartitionInterval() {
-    return 604800000;
-  }
-
-  default BaseConfig setConfigNodeRatisSnapshotTriggerThreshold(int ratisSnapshotTriggerThreshold) {
-    return this;
-  }
-
-  default int getConfigNodeRatisSnapshotTriggerThreshold() {
-    return 400000;
-  }
-
-  default int getConfigNodeRegionRatisRPCLeaderElectionTimeoutMaxMs() {
-    return 4000;
-  }
-
-  default BaseConfig setCompactionThreadCount(int compactionThreadCount) {
-    return this;
-  }
-
-  default int getConcurrentCompactionThread() {
-    return 10;
-  }
-
-  default BaseConfig setMaxDegreeOfIndexNode(int maxDegreeOfIndexNode) {
-    return this;
-  }
-
-  default int getMaxDegreeOfIndexNode() {
-    return 256;
-  }
-
-  default BaseConfig setEnableWatermark(boolean enableWatermark) {
-    return this;
-  }
-
-  default boolean isEnableWatermark() {
-    return false;
-  }
-
-  default String getWatermarkSecretKey() {
-    return "IoTDB*2019@Beijing";
-  }
-
-  default BaseConfig setWatermarkSecretKey(String watermarkSecretKey) {
-    return this;
-  }
-
-  default String getWatermarkBitString() {
-    return "100101110100";
-  }
-
-  default BaseConfig setWatermarkBitString(String watermarkBitString) {
-    return this;
-  }
-
-  default String getWatermarkMethod() {
-    return "GroupBasedLSBMethod(embed_row_cycle=2,embed_lsb_num=5)";
-  }
-
-  default BaseConfig setWatermarkMethod(String watermarkMethod) {
-    return this;
-  }
-
-  default boolean isEnableMQTTService() {
-    return false;
-  }
-
-  default BaseConfig setEnableMQTTService(boolean enableMQTTService) {
-    return this;
-  }
-
-  default BaseConfig setSchemaEngineMode(String schemaEngineMode) {
-    return this;
-  }
-
-  default String getSchemaEngineMode() {
-    return "Memory";
-  }
-
-  default BaseConfig setSelectIntoInsertTabletPlanRowLimit(int selectIntoInsertTabletPlanRowLimit) {
-    return this;
-  }
-
-  default int getSelectIntoInsertTabletPlanRowLimit() {
-    return 10000;
-  }
-
-  default BaseConfig setEnableAutoLeaderBalanceForRatisConsensus(
-      boolean enableAutoLeaderBalanceForRatisConsensus) {
-    return this;
-  }
-
-  default boolean isEnableAutoLeaderBalanceForRatisConsensus() {
-    return false;
-  }
-
-  default BaseConfig setEnableAutoLeaderBalanceForIoTConsensus(
-      boolean enableAutoLeaderBalanceForIoTConsensus) {
-    return this;
-  }
-
-  default boolean isEnableAutoLeaderBalanceForIoTConsensus() {
-    return true;
-  }
-
-  default BaseConfig setLeastDataRegionGroupNum(int leastDataRegionGroupNum) {
-    return this;
-  }
-
-  default int getLeastDataRegionGroupNum() {
-    return 5;
-  }
-
-  default BaseConfig setQueryThreadCount(int queryThreadCount) {
-    return this;
-  }
-
-  default int getQueryThreadCount() {
-    return Runtime.getRuntime().availableProcessors();
-  }
-
-  default BaseConfig setDataRatisTriggerSnapshotThreshold(long threshold) {
-    return this;
-  }
-}
diff --git a/integration-test/src/main/java/org/apache/iotdb/itbase/env/BaseEnv.java b/integration-test/src/main/java/org/apache/iotdb/itbase/env/BaseEnv.java
index efaf71cd7c..31dbf0d767 100644
--- a/integration-test/src/main/java/org/apache/iotdb/itbase/env/BaseEnv.java
+++ b/integration-test/src/main/java/org/apache/iotdb/itbase/env/BaseEnv.java
@@ -23,8 +23,8 @@ import org.apache.iotdb.confignode.rpc.thrift.IConfigNodeRPCService;
 import org.apache.iotdb.isession.ISession;
 import org.apache.iotdb.isession.SessionConfig;
 import org.apache.iotdb.isession.util.Version;
-import org.apache.iotdb.it.env.ConfigNodeWrapper;
-import org.apache.iotdb.it.env.DataNodeWrapper;
+import org.apache.iotdb.it.env.cluster.ConfigNodeWrapper;
+import org.apache.iotdb.it.env.cluster.DataNodeWrapper;
 import org.apache.iotdb.jdbc.Constant;
 import org.apache.iotdb.rpc.IoTDBConnectionException;
 import org.apache.iotdb.session.Session;
@@ -38,15 +38,22 @@ import java.util.List;
 
 public interface BaseEnv {
 
-  void initBeforeClass() throws InterruptedException;
+  /** Init a cluster with default number of ConfigNodes and DataNodes. */
+  void initClusterEnvironment();
 
+  /**
+   * Init a cluster with the specified number of ConfigNodes and DataNodes.
+   *
+   * @param configNodesNum the number of ConfigNodes.
+   * @param dataNodesNum the number of DataNodes.
+   */
   void initClusterEnvironment(int configNodesNum, int dataNodesNum);
 
-  void cleanAfterClass();
+  /** Destroy the cluster and all the configurations. */
+  void cleanClusterEnvironment();
 
-  void initBeforeTest() throws InterruptedException;
-
-  void cleanAfterTest();
+  /** Return the {@link ClusterConfig} for developers to set values before test. */
+  ClusterConfig getConfig();
 
   default Connection getConnection() throws SQLException {
     return getConnection("root", "root");
@@ -67,12 +74,8 @@ public interface BaseEnv {
 
   List<ConfigNodeWrapper> getConfigNodeWrapperList();
 
-  void setConfigNodeWrapperList(List<ConfigNodeWrapper> configNodeWrapperList);
-
   List<DataNodeWrapper> getDataNodeWrapperList();
 
-  void setDataNodeWrapperList(List<DataNodeWrapper> dataNodeWrapperList);
-
   IConfigNodeRPCService.Iface getLeaderConfigNodeConnection()
       throws ClientManagerException, IOException, InterruptedException;
 
@@ -187,7 +190,11 @@ public interface BaseEnv {
     return pool;
   }
 
-  /** @return The index of ConfigNode-Leader in configNodeWrapperList */
+  /**
+   * Get the index of the ConfigNode leader.
+   *
+   * @return The index of ConfigNode-Leader in configNodeWrapperList
+   */
   int getLeaderConfigNodeIndex() throws IOException, InterruptedException;
 
   /** Start an existed ConfigNode */
@@ -196,16 +203,32 @@ public interface BaseEnv {
   /** Shutdown an existed ConfigNode */
   void shutdownConfigNode(int index);
 
-  /** @return The ConfigNodeWrapper of the specified index */
+  /**
+   * Get the {@link ConfigNodeWrapper} of the specified index.
+   *
+   * @return The ConfigNodeWrapper of the specified index
+   */
   ConfigNodeWrapper getConfigNodeWrapper(int index);
 
-  /** @return The DataNodeWrapper of the specified indexx */
+  /**
+   * Get the {@link DataNodeWrapper} of the specified index.
+   *
+   * @return The DataNodeWrapper of the specified indexx
+   */
   DataNodeWrapper getDataNodeWrapper(int index);
 
-  /** @return A random available ConfigNodeWrapper */
+  /**
+   * Get a {@link ConfigNodeWrapper} randomly.
+   *
+   * @return A random available ConfigNodeWrapper
+   */
   ConfigNodeWrapper generateRandomConfigNodeWrapper();
 
-  /** @return A random available ConfigNodeWrapper */
+  /**
+   * Get a {@link DataNodeWrapper} randomly.
+   *
+   * @return A random available ConfigNodeWrapper
+   */
   DataNodeWrapper generateRandomDataNodeWrapper();
 
   /** Register a new DataNode with random ports */
diff --git a/integration-test/src/main/java/org/apache/iotdb/itbase/env/BaseNodeWrapper.java b/integration-test/src/main/java/org/apache/iotdb/itbase/env/BaseNodeWrapper.java
index c1efb1f351..32bc15d386 100644
--- a/integration-test/src/main/java/org/apache/iotdb/itbase/env/BaseNodeWrapper.java
+++ b/integration-test/src/main/java/org/apache/iotdb/itbase/env/BaseNodeWrapper.java
@@ -18,16 +18,12 @@
  */
 package org.apache.iotdb.itbase.env;
 
-import java.util.Properties;
-
 public interface BaseNodeWrapper {
 
   void createDir();
 
   void destroyDir();
 
-  void changeConfig(Properties properties);
-
   void start();
 
   void stop();
diff --git a/integration-test/src/main/java/org/apache/iotdb/itbase/env/BaseNodeWrapper.java b/integration-test/src/main/java/org/apache/iotdb/itbase/env/ClusterConfig.java
similarity index 55%
copy from integration-test/src/main/java/org/apache/iotdb/itbase/env/BaseNodeWrapper.java
copy to integration-test/src/main/java/org/apache/iotdb/itbase/env/ClusterConfig.java
index c1efb1f351..0f4192e185 100644
--- a/integration-test/src/main/java/org/apache/iotdb/itbase/env/BaseNodeWrapper.java
+++ b/integration-test/src/main/java/org/apache/iotdb/itbase/env/ClusterConfig.java
@@ -18,29 +18,33 @@
  */
 package org.apache.iotdb.itbase.env;
 
-import java.util.Properties;
-
-public interface BaseNodeWrapper {
-
-  void createDir();
-
-  void destroyDir();
-
-  void changeConfig(Properties properties);
-
-  void start();
-
-  void stop();
-
-  void waitingToShutDown();
-
-  String getIp();
-
-  int getPort();
-
-  String getId();
-
-  String getIpAndPortString();
-
-  void dumpJVMSnapshot(String testCaseName);
+public interface ClusterConfig {
+
+  /**
+   * Get the iotdb-datanode.properties of a data node.
+   *
+   * @return the {@link DataNodeConfig} instance.
+   */
+  DataNodeConfig getDataNodeConfig();
+
+  /**
+   * Get the iotdb-common.properties of a data node.
+   *
+   * @return the {@link CommonConfig} instance.
+   */
+  CommonConfig getDataNodeCommonConfig();
+
+  /**
+   * Get the iotdb-confignode.properties of a config node.
+   *
+   * @return the {@link ConfigNodeConfig} instance.
+   */
+  ConfigNodeConfig getConfigNodeConfig();
+
+  /**
+   * Get the iotdb-common.properties of a config node.
+   *
+   * @return the {@link CommonConfig} instance.
+   */
+  CommonConfig getConfigNodeCommonConfig();
 }
diff --git a/integration-test/src/main/java/org/apache/iotdb/itbase/env/CommonConfig.java b/integration-test/src/main/java/org/apache/iotdb/itbase/env/CommonConfig.java
new file mode 100644
index 0000000000..7d3ca7ff82
--- /dev/null
+++ b/integration-test/src/main/java/org/apache/iotdb/itbase/env/CommonConfig.java
@@ -0,0 +1,363 @@
+/*
+ * 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.itbase.env;
+
+/** This interface is used to handle properties in iotdb-common.properties. */
+public interface CommonConfig {
+
+  default CommonConfig setMaxNumberOfPointsInPage(int maxNumberOfPointsInPage) {
+    return this;
+  }
+
+  default int getPageSizeInByte() {
+    return 64 * 1024;
+  }
+
+  default CommonConfig setPageSizeInByte(int pageSizeInByte) {
+    return this;
+  }
+
+  default int getGroupSizeInByte() {
+    return 128 * 1024 * 1024;
+  }
+
+  default CommonConfig setGroupSizeInByte(int groupSizeInByte) {
+    return this;
+  }
+
+  default long getMemtableSizeThreshold() {
+    return 1024 * 1024 * 1024L;
+  }
+
+  default CommonConfig setMemtableSizeThreshold(long memtableSizeThreshold) {
+    return this;
+  }
+
+  default CommonConfig setPartitionInterval(long partitionInterval) {
+    return this;
+  }
+
+  default long getPartitionInterval() {
+    return 604800;
+  }
+
+  default CommonConfig setCompressor(String compressor) {
+    return this;
+  }
+
+  default CommonConfig setMaxQueryDeduplicatedPathNum(int maxQueryDeduplicatedPathNum) {
+    return this;
+  }
+
+  default CommonConfig setUdfMemoryBudgetInMB(float udfCollectorMemoryBudgetInMB) {
+    return this;
+  }
+
+  default CommonConfig setEnableSeqSpaceCompaction(boolean enableSeqSpaceCompaction) {
+    return this;
+  }
+
+  default boolean isEnableSeqSpaceCompaction() {
+    return true;
+  }
+
+  default CommonConfig setEnableUnseqSpaceCompaction(boolean enableUnseqSpaceCompaction) {
+    return this;
+  }
+
+  default boolean isEnableMemControl() {
+    return true;
+  }
+
+  default CommonConfig setEnableMemControl(boolean enableMemControl) {
+    return this;
+  }
+
+  default boolean isEnableUnseqSpaceCompaction() {
+    return true;
+  }
+
+  default CommonConfig setEnableCrossSpaceCompaction(boolean enableCrossSpaceCompaction) {
+    return this;
+  }
+
+  default boolean isEnableCrossSpaceCompaction() {
+    return true;
+  }
+
+  default CommonConfig setAutoCreateSchemaEnabled(boolean enableAutoCreateSchema) {
+    return this;
+  }
+
+  default CommonConfig setEnableLastCache(boolean lastCacheEnable) {
+    return this;
+  }
+
+  default boolean isLastCacheEnabled() {
+    return true;
+  }
+
+  default int getMaxNumberOfPointsInPage() {
+    return 1024 * 1024;
+  }
+
+  default boolean isAutoCreateSchemaEnabled() {
+    return true;
+  }
+
+  default CommonConfig setPrimitiveArraySize(int primitiveArraySize) {
+    return this;
+  }
+
+  default int getPrimitiveArraySize() {
+    return 32;
+  }
+
+  default String getFlushCommand() {
+    return "flush";
+  }
+
+  default int getMaxQueryDeduplicatedPathNum() {
+    return 1000;
+  }
+
+  default int getAvgSeriesPointNumberThreshold() {
+    return 100000;
+  }
+
+  default CommonConfig setAvgSeriesPointNumberThreshold(int avgSeriesPointNumberThreshold) {
+    return this;
+  }
+
+  default int getMaxTsBlockLineNumber() {
+    return 1000;
+  }
+
+  default CommonConfig setMaxTsBlockLineNumber(int maxTsBlockLineNumber) {
+    return this;
+  }
+
+  default CommonConfig setConfigNodeConsesusProtocolClass(String configNodeConsesusProtocolClass) {
+    return this;
+  }
+
+  default String getConfigNodeConsesusProtocolClass() {
+    return "org.apache.iotdb.consensus.simple.SimpleConsensus";
+  }
+
+  default CommonConfig setSchemaRegionConsensusProtocolClass(
+      String schemaRegionConsensusProtocolClass) {
+    return this;
+  }
+
+  default String getSchemaRegionConsensusProtocolClass() {
+    return "org.apache.iotdb.consensus.simple.SimpleConsensus";
+  }
+
+  default CommonConfig setDataRegionConsensusProtocolClass(
+      String dataRegionConsensusProtocolClass) {
+    return this;
+  }
+
+  default String getDataRegionConsensusProtocolClass() {
+    return "org.apache.iotdb.consensus.simple.SimpleConsensus";
+  }
+
+  default CommonConfig setEnableDataPartitionInheritPolicy(
+      boolean enableDataPartitionInheritPolicy) {
+    return this;
+  }
+
+  default boolean isEnableDataPartitionInheritPolicy() {
+    return false;
+  }
+
+  default CommonConfig setSchemaRegionGroupExtensionPolicy(
+      String schemaRegionGroupExtensionPolicy) {
+    return this;
+  }
+
+  default String getSchemaRegionGroupExtensionPolicy() {
+    return "AUTO";
+  }
+
+  default CommonConfig setSchemaRegionGroupPerDatabase(int schemaRegionGroupPerDatabase) {
+    return this;
+  }
+
+  default int getSchemaRegionGroupPerDatabase() {
+    return 1;
+  }
+
+  default CommonConfig setDataRegionGroupExtensionPolicy(String dataRegionGroupExtensionPolicy) {
+    return this;
+  }
+
+  default String getDataRegionGroupExtensionPolicy() {
+    return "AUTO";
+  }
+
+  default CommonConfig setDataRegionGroupPerDatabase(int dataRegionGroupPerDatabase) {
+    return this;
+  }
+
+  default int getDataRegionGroupPerDatabase() {
+    return 1;
+  }
+
+  default CommonConfig setSchemaReplicationFactor(int schemaReplicationFactor) {
+    return this;
+  }
+
+  default int getSchemaReplicationFactor() {
+    return 1;
+  }
+
+  default CommonConfig setDataReplicationFactor(int dataReplicationFactor) {
+    return this;
+  }
+
+  default int getDataReplicationFactor() {
+    return 1;
+  }
+
+  default CommonConfig setTimePartitionInterval(long timePartitionInterval) {
+    return this;
+  }
+
+  default long getTimePartitionInterval() {
+    return 604800000;
+  }
+
+  default CommonConfig setConfigNodeRatisSnapshotTriggerThreshold(
+      int ratisSnapshotTriggerThreshold) {
+    return this;
+  }
+
+  default int getConfigNodeRatisSnapshotTriggerThreshold() {
+    return 400000;
+  }
+
+  default int getConfigNodeRegionRatisRPCLeaderElectionTimeoutMaxMs() {
+    return 4000;
+  }
+
+  default CommonConfig setMaxDegreeOfIndexNode(int maxDegreeOfIndexNode) {
+    return this;
+  }
+
+  default int getMaxDegreeOfIndexNode() {
+    return 256;
+  }
+
+  default CommonConfig setEnableWatermark(boolean enableWatermark) {
+    return this;
+  }
+
+  default boolean isEnableWatermark() {
+    return false;
+  }
+
+  default String getWatermarkSecretKey() {
+    return "IoTDB*2019@Beijing";
+  }
+
+  default CommonConfig setWatermarkSecretKey(String watermarkSecretKey) {
+    return this;
+  }
+
+  default String getWatermarkBitString() {
+    return "100101110100";
+  }
+
+  default CommonConfig setWatermarkBitString(String watermarkBitString) {
+    return this;
+  }
+
+  default String getWatermarkMethod() {
+    return "GroupBasedLSBMethod(embed_row_cycle=2,embed_lsb_num=5)";
+  }
+
+  default CommonConfig setWatermarkMethod(String watermarkMethod) {
+    return this;
+  }
+
+  default boolean isEnableMQTTService() {
+    return false;
+  }
+
+  default CommonConfig setEnableMQTTService(boolean enableMQTTService) {
+    return this;
+  }
+
+  default CommonConfig setSchemaEngineMode(String schemaEngineMode) {
+    return this;
+  }
+
+  default String getSchemaEngineMode() {
+    return "Memory";
+  }
+
+  default CommonConfig setSelectIntoInsertTabletPlanRowLimit(
+      int selectIntoInsertTabletPlanRowLimit) {
+    return this;
+  }
+
+  default int getSelectIntoInsertTabletPlanRowLimit() {
+    return 10000;
+  }
+
+  default CommonConfig setEnableAutoLeaderBalanceForRatisConsensus(
+      boolean enableAutoLeaderBalanceForRatisConsensus) {
+    return this;
+  }
+
+  default boolean isEnableAutoLeaderBalanceForRatisConsensus() {
+    return false;
+  }
+
+  default CommonConfig setEnableAutoLeaderBalanceForIoTConsensus(
+      boolean enableAutoLeaderBalanceForIoTConsensus) {
+    return this;
+  }
+
+  default boolean isEnableAutoLeaderBalanceForIoTConsensus() {
+    return true;
+  }
+
+  default CommonConfig setLeastDataRegionGroupNum(int leastDataRegionGroupNum) {
+    return this;
+  }
+
+  default int getLeastDataRegionGroupNum() {
+    return 5;
+  }
+
+  default CommonConfig setQueryThreadCount(int queryThreadCount) {
+    return this;
+  }
+
+  default int getQueryThreadCount() {
+    return Runtime.getRuntime().availableProcessors();
+  }
+
+  default CommonConfig setDataRatisTriggerSnapshotThreshold(long threshold) {
+    return this;
+  }
+}
diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/ConfigFactory.java b/integration-test/src/main/java/org/apache/iotdb/itbase/env/ConfigNodeConfig.java
similarity index 57%
rename from integration-test/src/main/java/org/apache/iotdb/it/env/ConfigFactory.java
rename to integration-test/src/main/java/org/apache/iotdb/itbase/env/ConfigNodeConfig.java
index 5a2eb738ed..c719978637 100644
--- a/integration-test/src/main/java/org/apache/iotdb/it/env/ConfigFactory.java
+++ b/integration-test/src/main/java/org/apache/iotdb/itbase/env/ConfigNodeConfig.java
@@ -16,30 +16,16 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.iotdb.it.env;
+package org.apache.iotdb.itbase.env;
 
-import org.apache.iotdb.itbase.env.BaseConfig;
+/** This interface is used to handle properties in iotdb-confignode.properties. */
+public interface ConfigNodeConfig {
 
-public class ConfigFactory {
-  private static BaseConfig config;
+  default ConfigNodeConfig setSeriesPartitionSlotNum(int seriesPartitionSlotNum) {
+    return this;
+  }
 
-  public static BaseConfig getConfig() {
-    if (config == null) {
-      EnvType env = EnvType.getSystemEnvType();
-      switch (env) {
-        case Simple:
-        case Cluster1:
-          config = new MppConfig();
-          break;
-        case Remote:
-          config = new RemoteServerConfig();
-          break;
-        default:
-          System.out.println("Unknown env type: " + env);
-          System.exit(-1);
-          break;
-      }
-    }
-    return config;
+  default int getSeriesPartitionSlotNum() {
+    return 10000;
   }
 }
diff --git a/integration-test/src/main/java/org/apache/iotdb/it/env/RemoteServerConfig.java b/integration-test/src/main/java/org/apache/iotdb/itbase/env/DataNodeConfig.java
similarity index 84%
rename from integration-test/src/main/java/org/apache/iotdb/it/env/RemoteServerConfig.java
rename to integration-test/src/main/java/org/apache/iotdb/itbase/env/DataNodeConfig.java
index cfc3e58b28..21c75091b4 100644
--- a/integration-test/src/main/java/org/apache/iotdb/it/env/RemoteServerConfig.java
+++ b/integration-test/src/main/java/org/apache/iotdb/itbase/env/DataNodeConfig.java
@@ -16,8 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.iotdb.it.env;
+package org.apache.iotdb.itbase.env;
 
-import org.apache.iotdb.itbase.env.BaseConfig;
-
-public class RemoteServerConfig implements BaseConfig {}
+/** This interface is used to handle properties in iotdb-datanode.properties. */
+public interface DataNodeConfig {}
diff --git a/integration-test/src/test/java/org/apache/iotdb/cli/it/StartClientScriptIT.java b/integration-test/src/test/java/org/apache/iotdb/cli/it/StartClientScriptIT.java
index 3214a4db5e..82db931632 100644
--- a/integration-test/src/test/java/org/apache/iotdb/cli/it/StartClientScriptIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/cli/it/StartClientScriptIT.java
@@ -46,7 +46,7 @@ public class StartClientScriptIT extends AbstractScript {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
     ip = EnvFactory.getEnv().getIP();
     port = EnvFactory.getEnv().getPort();
     sbinPath = EnvFactory.getEnv().getSbinPath();
@@ -55,7 +55,7 @@ public class StartClientScriptIT extends AbstractScript {
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/IoTDBClusterAuthorityIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/IoTDBClusterAuthorityIT.java
index 7a6dfc6b69..2bd523683c 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/IoTDBClusterAuthorityIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/IoTDBClusterAuthorityIT.java
@@ -61,7 +61,7 @@ public class IoTDBClusterAuthorityIT {
 
   @After
   public void tearDown() {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   private void cleanUserAndRole(IConfigNodeRPCService.Iface client) throws TException {
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/IoTDBConfigNodeSnapshotIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/IoTDBConfigNodeSnapshotIT.java
index 1ca9588108..c9d22bf2a6 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/IoTDBConfigNodeSnapshotIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/IoTDBConfigNodeSnapshotIT.java
@@ -44,7 +44,6 @@ import org.apache.iotdb.confignode.rpc.thrift.TShowCQResp;
 import org.apache.iotdb.confignode.rpc.thrift.TStorageGroupSchema;
 import org.apache.iotdb.confignode.rpc.thrift.TTimeSlotList;
 import org.apache.iotdb.consensus.ConsensusFactory;
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -90,17 +89,19 @@ public class IoTDBConfigNodeSnapshotIT {
 
   @Before
   public void setUp() throws Exception {
-    originalConfigNodeConsensusProtocolClass =
-        ConfigFactory.getConfig().getConfigNodeConsensusProtocolClass();
-    ConfigFactory.getConfig().setConfigNodeConsesusProtocolClass(ConsensusFactory.RATIS_CONSENSUS);
-
-    originalRatisSnapshotTriggerThreshold =
-        ConfigFactory.getConfig().getConfigNodeRatisSnapshotTriggerThreshold();
-    ConfigFactory.getConfig()
-        .setConfigNodeRatisSnapshotTriggerThreshold(testRatisSnapshotTriggerThreshold);
-
-    originalTimePartitionInterval = ConfigFactory.getConfig().getTimePartitionInterval();
-    ConfigFactory.getConfig().setTimePartitionInterval(testTimePartitionInterval);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setConfigNodeConsesusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
+        .setConfigNodeRatisSnapshotTriggerThreshold(testRatisSnapshotTriggerThreshold)
+        .setTimePartitionInterval(testTimePartitionInterval);
+
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setConfigNodeConsesusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
+        .setConfigNodeRatisSnapshotTriggerThreshold(testRatisSnapshotTriggerThreshold)
+        .setTimePartitionInterval(testTimePartitionInterval);
 
     // Init 2C2D cluster environment
     EnvFactory.getEnv().initClusterEnvironment(2, 2);
@@ -108,13 +109,7 @@ public class IoTDBConfigNodeSnapshotIT {
 
   @After
   public void tearDown() {
-    EnvFactory.getEnv().cleanAfterClass();
-
-    ConfigFactory.getConfig()
-        .setConfigNodeConsesusProtocolClass(originalConfigNodeConsensusProtocolClass);
-    ConfigFactory.getConfig()
-        .setConfigNodeRatisSnapshotTriggerThreshold(originalRatisSnapshotTriggerThreshold);
-    ConfigFactory.getConfig().setTimePartitionInterval(originalTimePartitionInterval);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/IoTDBSnapshotTransferIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/IoTDBSnapshotTransferIT.java
index 17d9a13565..89aedea42b 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/IoTDBSnapshotTransferIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/IoTDBSnapshotTransferIT.java
@@ -28,7 +28,6 @@ import org.apache.iotdb.confignode.rpc.thrift.TRegionInfo;
 import org.apache.iotdb.confignode.rpc.thrift.TShowRegionReq;
 import org.apache.iotdb.confignode.rpc.thrift.TShowRegionResp;
 import org.apache.iotdb.consensus.ConsensusFactory;
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -57,7 +56,20 @@ public class IoTDBSnapshotTransferIT {
 
   @Before
   public void setUp() throws Exception {
-    ConfigFactory.getConfig()
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setDataRegionConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
+        .setSchemaRegionConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
+        .setConfigNodeConsesusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
+        .setDataReplicationFactor(2)
+        .setSchemaReplicationFactor(2)
+        .setDataRatisTriggerSnapshotThreshold(snapshotMagic)
+        .setConfigNodeRatisSnapshotTriggerThreshold(1); // must trigger snapshot
+
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
         .setDataRegionConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
         .setSchemaRegionConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
         .setConfigNodeConsesusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
@@ -71,7 +83,7 @@ public class IoTDBSnapshotTransferIT {
 
   @After
   public void tearDown() {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/IoTDBStorageGroupIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/IoTDBStorageGroupIT.java
index b305c07ae7..e5ceb71662 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/IoTDBStorageGroupIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/IoTDBStorageGroupIT.java
@@ -58,7 +58,7 @@ public class IoTDBStorageGroupIT {
 
   @After
   public void tearDown() {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/cluster/IoTDBClusterNodeErrorStartUpIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/cluster/IoTDBClusterNodeErrorStartUpIT.java
index d331af6226..5c829c36af 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/cluster/IoTDBClusterNodeErrorStartUpIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/cluster/IoTDBClusterNodeErrorStartUpIT.java
@@ -34,13 +34,13 @@ import org.apache.iotdb.confignode.rpc.thrift.TDataNodeRestartReq;
 import org.apache.iotdb.confignode.rpc.thrift.TDataNodeRestartResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowClusterResp;
 import org.apache.iotdb.consensus.ConsensusFactory;
-import org.apache.iotdb.it.env.ConfigFactory;
-import org.apache.iotdb.it.env.ConfigNodeWrapper;
-import org.apache.iotdb.it.env.DataNodeWrapper;
 import org.apache.iotdb.it.env.EnvFactory;
+import org.apache.iotdb.it.env.cluster.ConfigNodeWrapper;
+import org.apache.iotdb.it.env.cluster.DataNodeWrapper;
+import org.apache.iotdb.it.env.cluster.MppBaseConfig;
+import org.apache.iotdb.it.env.cluster.MppCommonConfig;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
-import org.apache.iotdb.itbase.env.BaseConfig;
 import org.apache.iotdb.rpc.TSStatusCode;
 
 import org.apache.thrift.TException;
@@ -64,13 +64,10 @@ public class IoTDBClusterNodeErrorStartUpIT {
 
   private static final Logger logger =
       LoggerFactory.getLogger(IoTDBClusterNodeErrorStartUpIT.class);
-  private static final BaseConfig CONF = ConfigFactory.getConfig();
 
   private static final int testConfigNodeNum = 3;
   private static final int testDataNodeNum = 1;
   private static final int testNodeNum = testConfigNodeNum + testDataNodeNum;
-
-  protected static String originalConfigNodeConsensusProtocolClass;
   private static final String testConsensusProtocolClass = ConsensusFactory.RATIS_CONSENSUS;
 
   private static final String TEST_CLUSTER_NAME = "defaultCluster";
@@ -79,8 +76,14 @@ public class IoTDBClusterNodeErrorStartUpIT {
 
   @Before
   public void setUp() throws Exception {
-    originalConfigNodeConsensusProtocolClass = CONF.getConfigNodeConsensusProtocolClass();
-    CONF.setConfigNodeConsesusProtocolClass(testConsensusProtocolClass);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setConfigNodeConsesusProtocolClass(testConsensusProtocolClass);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setConfigNodeConsesusProtocolClass(testConsensusProtocolClass);
 
     // Init 3C1D environment
     EnvFactory.getEnv().initClusterEnvironment(testConfigNodeNum, testDataNodeNum);
@@ -88,8 +91,7 @@ public class IoTDBClusterNodeErrorStartUpIT {
 
   @After
   public void tearDown() {
-    EnvFactory.getEnv().cleanAfterClass();
-    CONF.setConfigNodeConsesusProtocolClass(originalConfigNodeConsensusProtocolClass);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
@@ -102,7 +104,9 @@ public class IoTDBClusterNodeErrorStartUpIT {
         EnvFactory.getEnv().generateRandomConfigNodeWrapper();
     conflictConfigNodeWrapper.setConsensusPort(
         EnvFactory.getEnv().getConfigNodeWrapper(1).getConsensusPort());
-    conflictConfigNodeWrapper.changeConfig(ConfigFactory.getConfig().getConfignodeProperties());
+    conflictConfigNodeWrapper.changeConfig(
+        (MppBaseConfig) EnvFactory.getEnv().getConfig().getConfigNodeConfig(),
+        (MppCommonConfig) EnvFactory.getEnv().getConfig().getConfigNodeCommonConfig());
 
     // The registration request should be rejected since there exists conflict port
     try (SyncConfigNodeIServiceClient client =
@@ -129,7 +133,9 @@ public class IoTDBClusterNodeErrorStartUpIT {
     DataNodeWrapper conflictDataNodeWrapper = EnvFactory.getEnv().generateRandomDataNodeWrapper();
     conflictDataNodeWrapper.setInternalPort(
         EnvFactory.getEnv().getDataNodeWrapper(0).getInternalPort());
-    conflictDataNodeWrapper.changeConfig(ConfigFactory.getConfig().getEngineProperties());
+    conflictDataNodeWrapper.changeConfig(
+        (MppBaseConfig) EnvFactory.getEnv().getConfig().getDataNodeConfig(),
+        (MppCommonConfig) EnvFactory.getEnv().getConfig().getDataNodeCommonConfig());
 
     // The registration request should be rejected since there exists conflict port
     try (SyncConfigNodeIServiceClient client =
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/cluster/IoTDBClusterNodeGetterIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/cluster/IoTDBClusterNodeGetterIT.java
index 1462f579cd..c5efebbb18 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/cluster/IoTDBClusterNodeGetterIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/cluster/IoTDBClusterNodeGetterIT.java
@@ -24,6 +24,7 @@ import org.apache.iotdb.common.rpc.thrift.TDataNodeLocation;
 import org.apache.iotdb.common.rpc.thrift.TEndPoint;
 import org.apache.iotdb.common.rpc.thrift.TSStatus;
 import org.apache.iotdb.commons.client.sync.SyncConfigNodeIServiceClient;
+import org.apache.iotdb.confignode.it.utils.ConfigNodeTestUtils;
 import org.apache.iotdb.confignode.rpc.thrift.TClusterParameters;
 import org.apache.iotdb.confignode.rpc.thrift.TConfigNodeInfo;
 import org.apache.iotdb.confignode.rpc.thrift.TDataNodeConfigurationResp;
@@ -35,13 +36,11 @@ import org.apache.iotdb.confignode.rpc.thrift.TShowClusterResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowConfigNodesResp;
 import org.apache.iotdb.confignode.rpc.thrift.TShowDataNodesResp;
 import org.apache.iotdb.consensus.ConsensusFactory;
-import org.apache.iotdb.it.env.ConfigFactory;
-import org.apache.iotdb.it.env.ConfigNodeWrapper;
-import org.apache.iotdb.it.env.DataNodeWrapper;
 import org.apache.iotdb.it.env.EnvFactory;
+import org.apache.iotdb.it.env.cluster.ConfigNodeWrapper;
+import org.apache.iotdb.it.env.cluster.DataNodeWrapper;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
-import org.apache.iotdb.itbase.env.BaseConfig;
 import org.apache.iotdb.rpc.TSStatusCode;
 
 import org.junit.After;
@@ -64,24 +63,25 @@ import static org.junit.Assert.fail;
 @Category({ClusterIT.class})
 public class IoTDBClusterNodeGetterIT {
 
-  private static final BaseConfig CONF = ConfigFactory.getConfig();
-
   private static final int testConfigNodeNum = 2;
   private static final int testDataNodeNum = 2;
-
-  protected static String originalConfigNodeConsensusProtocolClass;
-  protected static String originalSchemaRegionConsensusProtocolClass;
-  protected static String originalDataRegionConsensusProtocolClass;
   private static final String testConsensusProtocolClass = ConsensusFactory.RATIS_CONSENSUS;
 
   @Before
   public void setUp() throws Exception {
-    originalConfigNodeConsensusProtocolClass = CONF.getConfigNodeConsensusProtocolClass();
-    CONF.setConfigNodeConsesusProtocolClass(testConsensusProtocolClass);
-    originalSchemaRegionConsensusProtocolClass = CONF.getSchemaRegionConsensusProtocolClass();
-    CONF.setSchemaRegionConsensusProtocolClass(testConsensusProtocolClass);
-    originalDataRegionConsensusProtocolClass = CONF.getDataRegionConsensusProtocolClass();
-    CONF.setDataRegionConsensusProtocolClass(testConsensusProtocolClass);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setConfigNodeConsesusProtocolClass(testConsensusProtocolClass)
+        .setSchemaRegionConsensusProtocolClass(testConsensusProtocolClass)
+        .setDataRegionConsensusProtocolClass(testConsensusProtocolClass);
+
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setConfigNodeConsesusProtocolClass(testConsensusProtocolClass)
+        .setSchemaRegionConsensusProtocolClass(testConsensusProtocolClass)
+        .setDataRegionConsensusProtocolClass(testConsensusProtocolClass);
 
     // Init 2C2D environment
     EnvFactory.getEnv().initClusterEnvironment(testConfigNodeNum, testDataNodeNum);
@@ -89,10 +89,7 @@ public class IoTDBClusterNodeGetterIT {
 
   @After
   public void tearDown() {
-    EnvFactory.getEnv().cleanAfterClass();
-    CONF.setConfigNodeConsesusProtocolClass(originalConfigNodeConsensusProtocolClass);
-    CONF.setSchemaRegionConsensusProtocolClass(originalSchemaRegionConsensusProtocolClass);
-    CONF.setDataRegionConsensusProtocolClass(originalDataRegionConsensusProtocolClass);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
@@ -148,6 +145,7 @@ public class IoTDBClusterNodeGetterIT {
           TSStatusCode.SUCCESS_STATUS.getStatusCode(),
           showClusterParametersResp.getStatus().getCode());
       TClusterParameters clusterParameters = showClusterParametersResp.getClusterParameters();
+      TClusterParameters expectedParameters = ConfigNodeTestUtils.generateClusterParameters();
       Assert.assertEquals(
           testConsensusProtocolClass, clusterParameters.getConfigNodeConsensusProtocolClass());
       Assert.assertEquals(
@@ -155,29 +153,39 @@ public class IoTDBClusterNodeGetterIT {
       Assert.assertEquals(
           testConsensusProtocolClass, clusterParameters.getSchemaRegionConsensusProtocolClass());
       Assert.assertEquals(
-          CONF.getSeriesPartitionSlotNum(), clusterParameters.getSeriesPartitionSlotNum());
+          expectedParameters.getSeriesPartitionSlotNum(),
+          clusterParameters.getSeriesPartitionSlotNum());
       Assert.assertEquals(
-          CONF.getSeriesPartitionExecutorClass(),
+          expectedParameters.getSeriesPartitionExecutorClass(),
           clusterParameters.getSeriesPartitionExecutorClass());
-      Assert.assertEquals(CONF.getDefaultTTL(), clusterParameters.getDefaultTTL());
+      Assert.assertEquals(expectedParameters.getDefaultTTL(), clusterParameters.getDefaultTTL());
       Assert.assertEquals(
-          CONF.getTimePartitionInterval(), clusterParameters.getTimePartitionInterval());
+          expectedParameters.getTimePartitionInterval(),
+          clusterParameters.getTimePartitionInterval());
       Assert.assertEquals(
-          CONF.getDataReplicationFactor(), clusterParameters.getDataReplicationFactor());
+          expectedParameters.getDataReplicationFactor(),
+          clusterParameters.getDataReplicationFactor());
       Assert.assertEquals(
-          CONF.getSchemaReplicationFactor(), clusterParameters.getSchemaReplicationFactor());
+          expectedParameters.getSchemaReplicationFactor(),
+          clusterParameters.getSchemaReplicationFactor());
       Assert.assertEquals(
-          CONF.getDataRegionPerProcessor(), clusterParameters.getDataRegionPerProcessor(), 0.01);
+          expectedParameters.getDataRegionPerProcessor(),
+          clusterParameters.getDataRegionPerProcessor(),
+          0.01);
       Assert.assertEquals(
-          CONF.getSchemaRegionPerDataNode(), clusterParameters.getSchemaRegionPerDataNode(), 0.01);
+          expectedParameters.getSchemaRegionPerDataNode(),
+          clusterParameters.getSchemaRegionPerDataNode(),
+          0.01);
       Assert.assertEquals(
-          CONF.getDiskSpaceWarningThreshold(),
+          expectedParameters.getDiskSpaceWarningThreshold(),
           clusterParameters.getDiskSpaceWarningThreshold(),
           0.01);
       Assert.assertEquals(
-          CONF.getReadConsistencyLevel(), clusterParameters.getReadConsistencyLevel());
+          expectedParameters.getReadConsistencyLevel(),
+          clusterParameters.getReadConsistencyLevel());
       Assert.assertEquals(
-          CONF.getLeastDataRegionGroupNum(), clusterParameters.getLeastDataRegionGroupNum());
+          expectedParameters.getLeastDataRegionGroupNum(),
+          clusterParameters.getLeastDataRegionGroupNum());
 
       /* Test showConfigNodes */
       TShowConfigNodesResp showConfigNodesResp = client.showConfigNodes();
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/cluster/IoTDBClusterRestartIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/cluster/IoTDBClusterRestartIT.java
index 0191ed3323..0ca4c40d22 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/cluster/IoTDBClusterRestartIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/cluster/IoTDBClusterRestartIT.java
@@ -30,12 +30,13 @@ import org.apache.iotdb.confignode.rpc.thrift.TSetStorageGroupReq;
 import org.apache.iotdb.confignode.rpc.thrift.TShowClusterResp;
 import org.apache.iotdb.confignode.rpc.thrift.TStorageGroupSchema;
 import org.apache.iotdb.consensus.ConsensusFactory;
-import org.apache.iotdb.it.env.AbstractEnv;
-import org.apache.iotdb.it.env.ConfigFactory;
-import org.apache.iotdb.it.env.ConfigNodeWrapper;
-import org.apache.iotdb.it.env.DataNodeWrapper;
 import org.apache.iotdb.it.env.EnvFactory;
-import org.apache.iotdb.it.env.EnvUtils;
+import org.apache.iotdb.it.env.cluster.AbstractEnv;
+import org.apache.iotdb.it.env.cluster.ConfigNodeWrapper;
+import org.apache.iotdb.it.env.cluster.DataNodeWrapper;
+import org.apache.iotdb.it.env.cluster.EnvUtils;
+import org.apache.iotdb.it.env.cluster.MppBaseConfig;
+import org.apache.iotdb.it.env.cluster.MppCommonConfig;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
 import org.apache.iotdb.rpc.TSStatusCode;
@@ -73,47 +74,37 @@ public class IoTDBClusterRestartIT {
   private static final int testDataNodeNum = 2;
   private static final int testReplicationFactor = 2;
   private static final long testTimePartitionInterval = 604800000;
-  protected static String originalConfigNodeConsensusProtocolClass;
-  protected static String originalSchemaRegionConsensusProtocolClass;
-  protected static String originalDataRegionConsensusProtocolClass;
-  protected static int originSchemaReplicationFactor;
-  protected static int originalDataReplicationFactor;
-  protected static long originalTimePartitionInterval;
 
   @Before
   public void setUp() throws Exception {
-    originalConfigNodeConsensusProtocolClass =
-        ConfigFactory.getConfig().getConfigNodeConsensusProtocolClass();
-    originalSchemaRegionConsensusProtocolClass =
-        ConfigFactory.getConfig().getSchemaRegionConsensusProtocolClass();
-    originalDataRegionConsensusProtocolClass =
-        ConfigFactory.getConfig().getDataRegionConsensusProtocolClass();
-    ConfigFactory.getConfig().setConfigNodeConsesusProtocolClass(ratisConsensusProtocolClass);
-    ConfigFactory.getConfig().setSchemaRegionConsensusProtocolClass(ratisConsensusProtocolClass);
-    ConfigFactory.getConfig().setDataRegionConsensusProtocolClass(ratisConsensusProtocolClass);
-    ConfigFactory.getConfig().setConfigNodeConsesusProtocolClass(ConsensusFactory.RATIS_CONSENSUS);
-
-    originSchemaReplicationFactor = ConfigFactory.getConfig().getSchemaReplicationFactor();
-    originalDataReplicationFactor = ConfigFactory.getConfig().getDataReplicationFactor();
-    ConfigFactory.getConfig().setSchemaReplicationFactor(testReplicationFactor);
-    ConfigFactory.getConfig().setDataReplicationFactor(testReplicationFactor);
-
-    originalTimePartitionInterval = ConfigFactory.getConfig().getTimePartitionInterval();
-    ConfigFactory.getConfig().setTimePartitionInterval(testTimePartitionInterval);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setConfigNodeConsesusProtocolClass(ratisConsensusProtocolClass)
+        .setSchemaRegionConsensusProtocolClass(ratisConsensusProtocolClass)
+        .setDataRegionConsensusProtocolClass(ratisConsensusProtocolClass)
+        .setConfigNodeConsesusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
+        .setSchemaReplicationFactor(testReplicationFactor)
+        .setDataReplicationFactor(testReplicationFactor)
+        .setTimePartitionInterval(testTimePartitionInterval);
+
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setConfigNodeConsesusProtocolClass(ratisConsensusProtocolClass)
+        .setSchemaRegionConsensusProtocolClass(ratisConsensusProtocolClass)
+        .setDataRegionConsensusProtocolClass(ratisConsensusProtocolClass)
+        .setConfigNodeConsesusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
+        .setSchemaReplicationFactor(testReplicationFactor)
+        .setDataReplicationFactor(testReplicationFactor)
+        .setTimePartitionInterval(testTimePartitionInterval);
     // Init 2C2D cluster environment
     EnvFactory.getEnv().initClusterEnvironment(testConfigNodeNum, testDataNodeNum);
   }
 
   @After
   public void tearDown() {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig()
-        .setConfigNodeConsesusProtocolClass(originalConfigNodeConsensusProtocolClass);
-    ConfigFactory.getConfig()
-        .setSchemaRegionConsensusProtocolClass(originalSchemaRegionConsensusProtocolClass);
-    ConfigFactory.getConfig()
-        .setDataRegionConsensusProtocolClass(originalDataRegionConsensusProtocolClass);
-    ConfigFactory.getConfig().setTimePartitionInterval(originalTimePartitionInterval);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
@@ -170,7 +161,11 @@ public class IoTDBClusterRestartIT {
     }
 
     for (int i = 0; i < testDataNodeNum; i++) {
-      dataNodeWrapperList.get(i).changeConfig(ConfigFactory.getConfig().getEngineProperties());
+      dataNodeWrapperList
+          .get(i)
+          .changeConfig(
+              (MppBaseConfig) EnvFactory.getEnv().getConfig().getDataNodeConfig(),
+              (MppCommonConfig) EnvFactory.getEnv().getConfig().getDataNodeCommonConfig());
       EnvFactory.getEnv().startDataNode(i);
     }
 
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/load/IoTDBClusterRegionLeaderBalancingIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/load/IoTDBClusterRegionLeaderBalancingIT.java
index faf6a6ccdb..e16d2fd6cf 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/load/IoTDBClusterRegionLeaderBalancingIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/load/IoTDBClusterRegionLeaderBalancingIT.java
@@ -33,16 +33,14 @@ import org.apache.iotdb.confignode.rpc.thrift.TShowRegionResp;
 import org.apache.iotdb.confignode.rpc.thrift.TStorageGroupSchema;
 import org.apache.iotdb.confignode.rpc.thrift.TTimeSlotList;
 import org.apache.iotdb.consensus.ConsensusFactory;
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
-import org.apache.iotdb.itbase.env.BaseConfig;
 import org.apache.iotdb.rpc.TSStatusCode;
 
-import org.junit.AfterClass;
+import org.junit.After;
 import org.junit.Assert;
-import org.junit.BeforeClass;
+import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import org.junit.runner.RunWith;
@@ -57,63 +55,45 @@ import java.util.concurrent.atomic.AtomicInteger;
 @RunWith(IoTDBTestRunner.class)
 @Category({ClusterIT.class})
 public class IoTDBClusterRegionLeaderBalancingIT {
-
-  private static final BaseConfig CONF = ConfigFactory.getConfig();
-
-  protected static boolean originalEnableAutoLeaderBalanceForRatisConsensus;
-  protected static boolean originalEnableAutoLeaderBalancerForIoTConsensus;
-
-  protected static String originalSchemaRegionConsensusProtocolClass;
   private static final String testSchemaRegionConsensusProtocolClass =
       ConsensusFactory.RATIS_CONSENSUS;
-  protected static String originalDataRegionConsensusProtocolClass;
   private static final String testDataRegionConsensusProtocolClass = ConsensusFactory.IOT_CONSENSUS;
-
-  protected static int originalSchemaReplicationFactor;
-  protected static int originalDataReplicationFactor;
   private static final int testReplicationFactor = 3;
 
   private static final String sg = "root.sg";
-
-  @BeforeClass
-  public static void setUp() {
-    originalEnableAutoLeaderBalanceForRatisConsensus =
-        CONF.isEnableAutoLeaderBalanceForRatisConsensus();
-    CONF.setEnableAutoLeaderBalanceForRatisConsensus(true);
-    originalEnableAutoLeaderBalancerForIoTConsensus =
-        CONF.isEnableAutoLeaderBalanceForIoTConsensus();
-    CONF.setEnableAutoLeaderBalanceForIoTConsensus(true);
-
-    originalSchemaRegionConsensusProtocolClass = CONF.getSchemaRegionConsensusProtocolClass();
-    CONF.setSchemaRegionConsensusProtocolClass(testSchemaRegionConsensusProtocolClass);
-
-    originalDataRegionConsensusProtocolClass = CONF.getDataRegionConsensusProtocolClass();
-    CONF.setDataRegionConsensusProtocolClass(testDataRegionConsensusProtocolClass);
-
-    originalSchemaReplicationFactor = CONF.getSchemaReplicationFactor();
-    originalDataReplicationFactor = CONF.getDataReplicationFactor();
-    CONF.setSchemaReplicationFactor(testReplicationFactor);
-    CONF.setDataReplicationFactor(testReplicationFactor);
+  private final int testDataNodeNum = 3;
+
+  @Before
+  public void setUp() {
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setEnableAutoLeaderBalanceForRatisConsensus(true)
+        .setEnableAutoLeaderBalanceForIoTConsensus(true)
+        .setSchemaRegionConsensusProtocolClass(testSchemaRegionConsensusProtocolClass)
+        .setDataRegionConsensusProtocolClass(testDataRegionConsensusProtocolClass)
+        .setSchemaReplicationFactor(testReplicationFactor)
+        .setDataReplicationFactor(testReplicationFactor);
+
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setEnableAutoLeaderBalanceForRatisConsensus(true)
+        .setEnableAutoLeaderBalanceForIoTConsensus(true)
+        .setSchemaRegionConsensusProtocolClass(testSchemaRegionConsensusProtocolClass)
+        .setDataRegionConsensusProtocolClass(testDataRegionConsensusProtocolClass)
+        .setSchemaReplicationFactor(testReplicationFactor)
+        .setDataReplicationFactor(testReplicationFactor);
+    EnvFactory.getEnv().initClusterEnvironment(1, 3);
   }
 
-  @AfterClass
-  public static void tearDown() {
-    CONF.setEnableAutoLeaderBalanceForRatisConsensus(
-        originalEnableAutoLeaderBalanceForRatisConsensus);
-    CONF.setEnableAutoLeaderBalanceForIoTConsensus(originalEnableAutoLeaderBalancerForIoTConsensus);
-
-    CONF.setSchemaRegionConsensusProtocolClass(originalSchemaRegionConsensusProtocolClass);
-    CONF.setDataRegionConsensusProtocolClass(originalDataRegionConsensusProtocolClass);
-
-    CONF.setSchemaReplicationFactor(originalSchemaReplicationFactor);
-    CONF.setDataReplicationFactor(originalDataReplicationFactor);
+  @After
+  public void tearDown() {
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
   public void testGreedyLeaderDistribution() throws Exception {
-    final int testConfigNodeNum = 1;
-    final int testDataNodeNum = 3;
-    EnvFactory.getEnv().initClusterEnvironment(testConfigNodeNum, testDataNodeNum);
 
     TSStatus status;
     final int storageGroupNum = 3;
@@ -164,10 +144,7 @@ public class IoTDBClusterRegionLeaderBalancingIT {
 
   @Test
   public void testMCFLeaderDistribution() throws Exception {
-    final int testConfigNodeNum = 1;
-    final int testDataNodeNum = 3;
     final int retryNum = 50;
-    EnvFactory.getEnv().initClusterEnvironment(testConfigNodeNum, testDataNodeNum);
 
     TSStatus status;
     final int storageGroupNum = 6;
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/load/IoTDBConfigNodeSwitchLeaderIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/load/IoTDBConfigNodeSwitchLeaderIT.java
index e1b990e9f8..a9e93e1364 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/load/IoTDBConfigNodeSwitchLeaderIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/load/IoTDBConfigNodeSwitchLeaderIT.java
@@ -31,7 +31,6 @@ import org.apache.iotdb.confignode.rpc.thrift.TSetStorageGroupReq;
 import org.apache.iotdb.confignode.rpc.thrift.TStorageGroupSchema;
 import org.apache.iotdb.confignode.rpc.thrift.TTimeSlotList;
 import org.apache.iotdb.consensus.ConsensusFactory;
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -54,13 +53,6 @@ import java.util.concurrent.TimeUnit;
 @RunWith(IoTDBTestRunner.class)
 @Category({ClusterIT.class})
 public class IoTDBConfigNodeSwitchLeaderIT {
-
-  protected static String originalConfigNodeConsensusProtocolClass;
-  protected static String originalSchemaRegionConsensusProtocolClass;
-  protected static String originalDataRegionConsensusProtocolClass;
-
-  protected static int originalSchemaReplicationFactor;
-  protected static int originalDataReplicationFactor;
   private static final int testReplicationFactor = 3;
 
   private static final int testConfigNodeNum = 3;
@@ -70,24 +62,29 @@ public class IoTDBConfigNodeSwitchLeaderIT {
 
   @Before
   public void setUp() throws Exception {
-    originalConfigNodeConsensusProtocolClass =
-        ConfigFactory.getConfig().getConfigNodeConsensusProtocolClass();
-    originalSchemaRegionConsensusProtocolClass =
-        ConfigFactory.getConfig().getSchemaRegionConsensusProtocolClass();
-    originalDataRegionConsensusProtocolClass =
-        ConfigFactory.getConfig().getDataRegionConsensusProtocolClass();
-    ConfigFactory.getConfig().setConfigNodeConsesusProtocolClass(ConsensusFactory.RATIS_CONSENSUS);
-    ConfigFactory.getConfig()
-        .setSchemaRegionConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS);
-    ConfigFactory.getConfig().setDataRegionConsensusProtocolClass(ConsensusFactory.IOT_CONSENSUS);
-
-    originalSchemaReplicationFactor = ConfigFactory.getConfig().getSchemaReplicationFactor();
-    originalDataReplicationFactor = ConfigFactory.getConfig().getDataReplicationFactor();
-    ConfigFactory.getConfig().setSchemaReplicationFactor(testReplicationFactor);
-    ConfigFactory.getConfig().setDataReplicationFactor(testReplicationFactor);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setConfigNodeConsesusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
+        .setSchemaRegionConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
+        .setDataRegionConsensusProtocolClass(ConsensusFactory.IOT_CONSENSUS)
+        .setSchemaReplicationFactor(testReplicationFactor)
+        .setDataReplicationFactor(testReplicationFactor);
 
     configNodeRegionRatisRPCLeaderElectionTimeoutMaxMs =
-        ConfigFactory.getConfig().getConfigNodeRegionRatisRPCLeaderElectionTimeoutMaxMs();
+        EnvFactory.getEnv()
+            .getConfig()
+            .getConfigNodeCommonConfig()
+            .getConfigNodeRegionRatisRPCLeaderElectionTimeoutMaxMs();
+
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setConfigNodeConsesusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
+        .setSchemaRegionConsensusProtocolClass(ConsensusFactory.RATIS_CONSENSUS)
+        .setDataRegionConsensusProtocolClass(ConsensusFactory.IOT_CONSENSUS)
+        .setSchemaReplicationFactor(testReplicationFactor)
+        .setDataReplicationFactor(testReplicationFactor);
 
     // Init 3C3D cluster environment
     EnvFactory.getEnv().initClusterEnvironment(testConfigNodeNum, testDataNodeNum);
@@ -95,17 +92,7 @@ public class IoTDBConfigNodeSwitchLeaderIT {
 
   @After
   public void tearDown() {
-    EnvFactory.getEnv().cleanAfterClass();
-
-    ConfigFactory.getConfig()
-        .setConfigNodeConsesusProtocolClass(originalConfigNodeConsensusProtocolClass);
-    ConfigFactory.getConfig()
-        .setSchemaRegionConsensusProtocolClass(originalSchemaRegionConsensusProtocolClass);
-    ConfigFactory.getConfig()
-        .setDataRegionConsensusProtocolClass(originalDataRegionConsensusProtocolClass);
-
-    ConfigFactory.getConfig().setSchemaReplicationFactor(originalSchemaReplicationFactor);
-    ConfigFactory.getConfig().setDataReplicationFactor(originalDataReplicationFactor);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   private void switchLeader() throws IOException, InterruptedException {
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBAutoRegionGroupExtensionIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBAutoRegionGroupExtensionIT.java
index 32282d19ab..28013fce25 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBAutoRegionGroupExtensionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBAutoRegionGroupExtensionIT.java
@@ -33,11 +33,9 @@ import org.apache.iotdb.confignode.rpc.thrift.TShowRegionResp;
 import org.apache.iotdb.confignode.rpc.thrift.TStorageGroupSchema;
 import org.apache.iotdb.confignode.rpc.thrift.TTimeSlotList;
 import org.apache.iotdb.consensus.ConsensusFactory;
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
-import org.apache.iotdb.itbase.env.BaseConfig;
 import org.apache.iotdb.rpc.TSStatusCode;
 
 import org.apache.thrift.TException;
@@ -56,59 +54,44 @@ import java.util.concurrent.atomic.AtomicInteger;
 @RunWith(IoTDBTestRunner.class)
 @Category({ClusterIT.class})
 public class IoTDBAutoRegionGroupExtensionIT {
-
-  private static final BaseConfig CONF = ConfigFactory.getConfig();
-
-  private static String originalDataRegionGroupExtensionPolicy;
   private static final String testDataRegionGroupExtensionPolicy = "AUTO";
-
-  private static String originalSchemaRegionConsensusProtocolClass;
-  private static String originalDataRegionConsensusProtocolClass;
   private static final String testConsensusProtocolClass = ConsensusFactory.RATIS_CONSENSUS;
-
-  private static int originalSchemaReplicationFactor;
-  private static int originalDataReplicationFactor;
   private static final int testReplicationFactor = 1;
 
-  private static long originalTimePartitionInterval;
-
-  private static int originalLeastDataRegionGroupNum;
-
   private static final String sg = "root.sg";
   private static final int testSgNum = 2;
+  private long originalTimePartitionInterval;
+  private int originalLeastDataRegionGroupNum;
 
   @Before
   public void setUp() throws Exception {
-    originalSchemaRegionConsensusProtocolClass = CONF.getSchemaRegionConsensusProtocolClass();
-    originalDataRegionConsensusProtocolClass = CONF.getDataRegionConsensusProtocolClass();
-    CONF.setSchemaRegionConsensusProtocolClass(testConsensusProtocolClass);
-    CONF.setDataRegionConsensusProtocolClass(testConsensusProtocolClass);
-
-    originalSchemaReplicationFactor = CONF.getSchemaReplicationFactor();
-    originalDataReplicationFactor = CONF.getDataReplicationFactor();
-    CONF.setSchemaReplicationFactor(testReplicationFactor);
-    CONF.setDataReplicationFactor(testReplicationFactor);
-
-    originalTimePartitionInterval = CONF.getTimePartitionInterval();
-
-    originalLeastDataRegionGroupNum = CONF.getLeastDataRegionGroupNum();
-
-    originalDataRegionGroupExtensionPolicy = CONF.getDataRegionGroupExtensionPolicy();
-    CONF.setDataRegionGroupExtensionPolicy(testDataRegionGroupExtensionPolicy);
-
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setSchemaRegionConsensusProtocolClass(testConsensusProtocolClass)
+        .setDataRegionConsensusProtocolClass(testConsensusProtocolClass)
+        .setSchemaReplicationFactor(testReplicationFactor)
+        .setDataReplicationFactor(testReplicationFactor)
+        .setDataRegionGroupExtensionPolicy(testDataRegionGroupExtensionPolicy);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setSchemaRegionConsensusProtocolClass(testConsensusProtocolClass)
+        .setDataRegionConsensusProtocolClass(testConsensusProtocolClass)
+        .setSchemaReplicationFactor(testReplicationFactor)
+        .setDataReplicationFactor(testReplicationFactor)
+        .setDataRegionGroupExtensionPolicy(testDataRegionGroupExtensionPolicy);
+    originalTimePartitionInterval =
+        EnvFactory.getEnv().getConfig().getConfigNodeCommonConfig().getTimePartitionInterval();
+    originalLeastDataRegionGroupNum =
+        EnvFactory.getEnv().getConfig().getConfigNodeCommonConfig().getLeastDataRegionGroupNum();
     // Init 1C3D environment
     EnvFactory.getEnv().initClusterEnvironment(1, 3);
   }
 
   @After
   public void tearDown() {
-    EnvFactory.getEnv().cleanAfterClass();
-
-    CONF.setSchemaRegionConsensusProtocolClass(originalSchemaRegionConsensusProtocolClass);
-    CONF.setDataRegionConsensusProtocolClass(originalDataRegionConsensusProtocolClass);
-    CONF.setSchemaReplicationFactor(originalSchemaReplicationFactor);
-    CONF.setDataReplicationFactor(originalDataReplicationFactor);
-    CONF.setDataRegionGroupExtensionPolicy(originalDataRegionGroupExtensionPolicy);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBCustomRegionGroupExtensionIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBCustomRegionGroupExtensionIT.java
index 0d22f3982c..1428e36a80 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBCustomRegionGroupExtensionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBCustomRegionGroupExtensionIT.java
@@ -33,11 +33,9 @@ import org.apache.iotdb.confignode.rpc.thrift.TShowRegionResp;
 import org.apache.iotdb.confignode.rpc.thrift.TStorageGroupSchema;
 import org.apache.iotdb.confignode.rpc.thrift.TTimeSlotList;
 import org.apache.iotdb.consensus.ConsensusFactory;
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
-import org.apache.iotdb.itbase.env.BaseConfig;
 import org.apache.iotdb.rpc.TSStatusCode;
 
 import org.junit.After;
@@ -57,56 +55,46 @@ import static org.apache.iotdb.confignode.it.utils.ConfigNodeTestUtils.generateP
 @Category({ClusterIT.class})
 public class IoTDBCustomRegionGroupExtensionIT {
 
-  private static final BaseConfig CONF = ConfigFactory.getConfig();
-
-  private static String originalSchemaRegionGroupExtensionPolicy;
   private static final String testSchemaRegionGroupExtensionPolicy = "CUSTOM";
-  private static String originalDataRegionGroupExtensionPolicy;
   private static final String testDataRegionGroupExtensionPolicy = "CUSTOM";
-
-  private static String originalSchemaRegionConsensusProtocolClass;
-  private static String originalDataRegionConsensusProtocolClass;
   private static final String testConsensusProtocolClass = ConsensusFactory.RATIS_CONSENSUS;
-
-  private static int originalSchemaRegionGroupPerDatabase;
   private static final int testSchemaRegionGroupPerDatabase = 2;
-  private static int originalDataRegionGroupPerDatabase;
   private static final int testDataRegionGroupPerDatabase = 3;
-
-  private static int originalSchemaReplicationFactor;
-  private static int originalDataReplicationFactor;
   private static final int testReplicationFactor = 3;
 
-  private static long originalTimePartitionInterval;
+  private long originalTimePartitionInterval;
 
   private static final String sg = "root.sg";
   private static final int testSgNum = 2;
 
   @Before
   public void setUp() throws Exception {
-    originalSchemaRegionConsensusProtocolClass = CONF.getSchemaRegionConsensusProtocolClass();
-    originalDataRegionConsensusProtocolClass = CONF.getDataRegionConsensusProtocolClass();
-    CONF.setSchemaRegionConsensusProtocolClass(testConsensusProtocolClass);
-    CONF.setDataRegionConsensusProtocolClass(testConsensusProtocolClass);
-
-    originalSchemaReplicationFactor = CONF.getSchemaReplicationFactor();
-    originalDataReplicationFactor = CONF.getDataReplicationFactor();
-    CONF.setSchemaReplicationFactor(testReplicationFactor);
-    CONF.setDataReplicationFactor(testReplicationFactor);
-
-    originalTimePartitionInterval = CONF.getTimePartitionInterval();
-
-    originalSchemaRegionGroupExtensionPolicy = CONF.getSchemaRegionGroupExtensionPolicy();
-    CONF.setSchemaRegionGroupExtensionPolicy(testSchemaRegionGroupExtensionPolicy);
-
-    originalSchemaRegionGroupPerDatabase = CONF.getSchemaRegionGroupPerDatabase();
-    CONF.setSchemaRegionGroupPerDatabase(testSchemaRegionGroupPerDatabase);
-
-    originalDataRegionGroupExtensionPolicy = CONF.getDataRegionGroupExtensionPolicy();
-    CONF.setDataRegionGroupExtensionPolicy(testDataRegionGroupExtensionPolicy);
-
-    originalDataRegionGroupPerDatabase = CONF.getDataRegionGroupPerDatabase();
-    CONF.setDataRegionGroupPerDatabase(testDataRegionGroupPerDatabase);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setSchemaRegionConsensusProtocolClass(testConsensusProtocolClass)
+        .setDataRegionConsensusProtocolClass(testConsensusProtocolClass)
+        .setSchemaReplicationFactor(testReplicationFactor)
+        .setDataReplicationFactor(testReplicationFactor)
+        .setSchemaRegionGroupExtensionPolicy(testSchemaRegionGroupExtensionPolicy)
+        .setSchemaRegionGroupPerDatabase(testSchemaRegionGroupPerDatabase)
+        .setDataRegionGroupExtensionPolicy(testDataRegionGroupExtensionPolicy)
+        .setDataRegionGroupPerDatabase(testDataRegionGroupPerDatabase);
+
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setSchemaRegionConsensusProtocolClass(testConsensusProtocolClass)
+        .setDataRegionConsensusProtocolClass(testConsensusProtocolClass)
+        .setSchemaReplicationFactor(testReplicationFactor)
+        .setDataReplicationFactor(testReplicationFactor)
+        .setSchemaRegionGroupExtensionPolicy(testSchemaRegionGroupExtensionPolicy)
+        .setSchemaRegionGroupPerDatabase(testSchemaRegionGroupPerDatabase)
+        .setDataRegionGroupExtensionPolicy(testDataRegionGroupExtensionPolicy)
+        .setDataRegionGroupPerDatabase(testDataRegionGroupPerDatabase);
+
+    originalTimePartitionInterval =
+        EnvFactory.getEnv().getConfig().getConfigNodeCommonConfig().getTimePartitionInterval();
 
     // Init 1C3D environment
     EnvFactory.getEnv().initClusterEnvironment(1, 3);
@@ -114,17 +102,7 @@ public class IoTDBCustomRegionGroupExtensionIT {
 
   @After
   public void tearDown() {
-    EnvFactory.getEnv().cleanAfterClass();
-
-    CONF.setSchemaRegionConsensusProtocolClass(originalSchemaRegionConsensusProtocolClass);
-    CONF.setDataRegionConsensusProtocolClass(originalDataRegionConsensusProtocolClass);
-    CONF.setSchemaReplicationFactor(originalSchemaReplicationFactor);
-    CONF.setDataReplicationFactor(originalDataReplicationFactor);
-
-    CONF.setSchemaRegionGroupExtensionPolicy(originalSchemaRegionGroupExtensionPolicy);
-    CONF.setSchemaRegionGroupPerDatabase(originalSchemaRegionGroupPerDatabase);
-    CONF.setDataRegionGroupExtensionPolicy(originalDataRegionGroupExtensionPolicy);
-    CONF.setDataRegionGroupPerDatabase(originalDataRegionGroupPerDatabase);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionDurableIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionDurableIT.java
index a5da4cf85e..2af3903e6c 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionDurableIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionDurableIT.java
@@ -42,9 +42,8 @@ import org.apache.iotdb.confignode.rpc.thrift.TShowRegionResp;
 import org.apache.iotdb.confignode.rpc.thrift.TStorageGroupSchema;
 import org.apache.iotdb.confignode.rpc.thrift.TTimeSlotList;
 import org.apache.iotdb.consensus.ConsensusFactory;
-import org.apache.iotdb.it.env.ConfigFactory;
-import org.apache.iotdb.it.env.DataNodeWrapper;
 import org.apache.iotdb.it.env.EnvFactory;
+import org.apache.iotdb.it.env.cluster.DataNodeWrapper;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
 import org.apache.iotdb.rpc.TSStatusCode;
@@ -71,17 +70,8 @@ import java.util.concurrent.atomic.AtomicInteger;
 public class IoTDBPartitionDurableIT {
 
   private static final Logger LOGGER = LoggerFactory.getLogger(IoTDBPartitionDurableIT.class);
-
-  private static String originalConfigNodeConsensusProtocolClass;
-  private static String originalSchemaRegionConsensusProtocolClass;
-  private static String originalDataRegionConsensusProtocolClass;
   private static final String testConsensusProtocolClass = ConsensusFactory.RATIS_CONSENSUS;
-
-  private static int originalSchemaReplicationFactor;
-  private static int originalDataReplicationFactor;
   private static final int testReplicationFactor = 3;
-
-  private static long originalTimePartitionInterval;
   private static final long testTimePartitionInterval = 604800000;
 
   private static final int testDataNodeId = 0;
@@ -102,23 +92,25 @@ public class IoTDBPartitionDurableIT {
 
   @Before
   public void setUp() throws Exception {
-    originalConfigNodeConsensusProtocolClass =
-        ConfigFactory.getConfig().getConfigNodeConsensusProtocolClass();
-    originalSchemaRegionConsensusProtocolClass =
-        ConfigFactory.getConfig().getSchemaRegionConsensusProtocolClass();
-    originalDataRegionConsensusProtocolClass =
-        ConfigFactory.getConfig().getDataRegionConsensusProtocolClass();
-    ConfigFactory.getConfig().setConfigNodeConsesusProtocolClass(testConsensusProtocolClass);
-    ConfigFactory.getConfig().setSchemaRegionConsensusProtocolClass(testConsensusProtocolClass);
-    ConfigFactory.getConfig().setDataRegionConsensusProtocolClass(testConsensusProtocolClass);
-
-    originalSchemaReplicationFactor = ConfigFactory.getConfig().getSchemaReplicationFactor();
-    originalDataReplicationFactor = ConfigFactory.getConfig().getDataReplicationFactor();
-    ConfigFactory.getConfig().setSchemaReplicationFactor(testReplicationFactor);
-    ConfigFactory.getConfig().setDataReplicationFactor(testReplicationFactor);
-
-    originalTimePartitionInterval = ConfigFactory.getConfig().getTimePartitionInterval();
-    ConfigFactory.getConfig().setTimePartitionInterval(testTimePartitionInterval);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setConfigNodeConsesusProtocolClass(testConsensusProtocolClass)
+        .setSchemaRegionConsensusProtocolClass(testConsensusProtocolClass)
+        .setDataRegionConsensusProtocolClass(testConsensusProtocolClass)
+        .setSchemaReplicationFactor(testReplicationFactor)
+        .setDataReplicationFactor(testReplicationFactor)
+        .setTimePartitionInterval(testTimePartitionInterval);
+
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setConfigNodeConsesusProtocolClass(testConsensusProtocolClass)
+        .setSchemaRegionConsensusProtocolClass(testConsensusProtocolClass)
+        .setDataRegionConsensusProtocolClass(testConsensusProtocolClass)
+        .setSchemaReplicationFactor(testReplicationFactor)
+        .setDataReplicationFactor(testReplicationFactor)
+        .setTimePartitionInterval(testTimePartitionInterval);
 
     // Init 1C3D environment
     EnvFactory.getEnv().initClusterEnvironment(1, 3);
@@ -137,19 +129,7 @@ public class IoTDBPartitionDurableIT {
 
   @After
   public void tearDown() {
-    EnvFactory.getEnv().cleanAfterClass();
-
-    ConfigFactory.getConfig()
-        .setConfigNodeConsesusProtocolClass(originalConfigNodeConsensusProtocolClass);
-    ConfigFactory.getConfig()
-        .setSchemaRegionConsensusProtocolClass(originalSchemaRegionConsensusProtocolClass);
-    ConfigFactory.getConfig()
-        .setDataRegionConsensusProtocolClass(originalDataRegionConsensusProtocolClass);
-
-    ConfigFactory.getConfig().setSchemaReplicationFactor(originalSchemaReplicationFactor);
-    ConfigFactory.getConfig().setDataReplicationFactor(originalDataReplicationFactor);
-
-    ConfigFactory.getConfig().setTimePartitionInterval(originalTimePartitionInterval);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionGetterIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionGetterIT.java
index 36d4fe4a57..60b967434c 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionGetterIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionGetterIT.java
@@ -46,11 +46,9 @@ import org.apache.iotdb.confignode.rpc.thrift.TShowStorageGroupResp;
 import org.apache.iotdb.confignode.rpc.thrift.TStorageGroupSchema;
 import org.apache.iotdb.confignode.rpc.thrift.TTimeSlotList;
 import org.apache.iotdb.consensus.ConsensusFactory;
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
-import org.apache.iotdb.itbase.env.BaseConfig;
 import org.apache.iotdb.rpc.TSStatusCode;
 
 import org.junit.AfterClass;
@@ -76,24 +74,9 @@ import static org.apache.iotdb.confignode.it.utils.ConfigNodeTestUtils.generateP
 public class IoTDBPartitionGetterIT {
 
   private static final Logger LOGGER = LoggerFactory.getLogger(IoTDBPartitionGetterIT.class);
-
-  private static final BaseConfig CONF = ConfigFactory.getConfig();
-
-  private static String originalConfigNodeConsensusProtocolClass;
-  private static String originalSchemaRegionConsensusProtocolClass;
-  private static String originalDataRegionConsensusProtocolClass;
   private static final String testConsensusProtocolClass = ConsensusFactory.RATIS_CONSENSUS;
-
-  private static int originalSchemaReplicationFactor;
-  private static int originalDataReplicationFactor;
   private static final int testReplicationFactor = 3;
-
-  private static int originalSeriesPartitionSlotNum;
-
-  private static long originalTimePartitionInterval;
   private static final long testTimePartitionInterval = 604800000;
-
-  protected static int originalLeastDataRegionGroupNum;
   private static final int testLeastDataRegionGroupNum = 3;
 
   private static final String sg = "root.sg";
@@ -105,35 +88,42 @@ public class IoTDBPartitionGetterIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    originalConfigNodeConsensusProtocolClass =
-        ConfigFactory.getConfig().getConfigNodeConsensusProtocolClass();
-    originalSchemaRegionConsensusProtocolClass =
-        ConfigFactory.getConfig().getSchemaRegionConsensusProtocolClass();
-    originalDataRegionConsensusProtocolClass =
-        ConfigFactory.getConfig().getDataRegionConsensusProtocolClass();
-    CONF.setConfigNodeConsesusProtocolClass(testConsensusProtocolClass);
-    CONF.setSchemaRegionConsensusProtocolClass(testConsensusProtocolClass);
-    CONF.setDataRegionConsensusProtocolClass(testConsensusProtocolClass);
-
-    originalSchemaReplicationFactor = CONF.getSchemaReplicationFactor();
-    originalDataReplicationFactor = CONF.getDataReplicationFactor();
-    CONF.setSchemaReplicationFactor(testReplicationFactor);
-    CONF.setDataReplicationFactor(testReplicationFactor);
-
-    originalSeriesPartitionSlotNum = CONF.getSeriesPartitionSlotNum();
-    CONF.setSeriesPartitionSlotNum(testSeriesPartitionSlotNum);
-
-    originalTimePartitionInterval = CONF.getTimePartitionInterval();
-    CONF.setTimePartitionInterval(testTimePartitionInterval);
-
-    originalLeastDataRegionGroupNum = CONF.getLeastDataRegionGroupNum();
-    CONF.setLeastDataRegionGroupNum(testLeastDataRegionGroupNum);
-
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setConfigNodeConsesusProtocolClass(testConsensusProtocolClass)
+        .setSchemaRegionConsensusProtocolClass(testConsensusProtocolClass)
+        .setDataRegionConsensusProtocolClass(testConsensusProtocolClass)
+        .setSchemaReplicationFactor(testReplicationFactor)
+        .setDataReplicationFactor(testReplicationFactor)
+        .setTimePartitionInterval(testTimePartitionInterval)
+        .setLeastDataRegionGroupNum(testLeastDataRegionGroupNum);
+
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setConfigNodeConsesusProtocolClass(testConsensusProtocolClass)
+        .setSchemaRegionConsensusProtocolClass(testConsensusProtocolClass)
+        .setDataRegionConsensusProtocolClass(testConsensusProtocolClass)
+        .setSchemaReplicationFactor(testReplicationFactor)
+        .setDataReplicationFactor(testReplicationFactor)
+        .setTimePartitionInterval(testTimePartitionInterval)
+        .setLeastDataRegionGroupNum(testLeastDataRegionGroupNum);
+
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeConfig()
+        .setSeriesPartitionSlotNum(testSeriesPartitionSlotNum);
     // Init 1C3D environment
     EnvFactory.getEnv().initClusterEnvironment(1, 3);
     prepareData();
   }
 
+  @AfterClass
+  public static void tearDown() {
+    EnvFactory.getEnv().cleanClusterEnvironment();
+  }
+
   private static void prepareData() throws Exception {
     try (SyncConfigNodeIServiceClient client =
         (SyncConfigNodeIServiceClient) EnvFactory.getEnv().getLeaderConfigNodeConnection()) {
@@ -223,20 +213,6 @@ public class IoTDBPartitionGetterIT {
     }
   }
 
-  @AfterClass
-  public static void tearDown() {
-    EnvFactory.getEnv().cleanAfterClass();
-
-    CONF.setConfigNodeConsesusProtocolClass(originalConfigNodeConsensusProtocolClass);
-    CONF.setSchemaRegionConsensusProtocolClass(originalSchemaRegionConsensusProtocolClass);
-    CONF.setDataRegionConsensusProtocolClass(originalDataRegionConsensusProtocolClass);
-
-    CONF.setSchemaReplicationFactor(originalSchemaReplicationFactor);
-    CONF.setDataReplicationFactor(originalDataReplicationFactor);
-    CONF.setSeriesPartitionSlotNum(originalSeriesPartitionSlotNum);
-    CONF.setTimePartitionInterval(originalTimePartitionInterval);
-  }
-
   @Test
   public void testGetSchemaPartition() throws Exception {
     final String sg = "root.sg";
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionInheritPolicyIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionInheritPolicyIT.java
index f9dd8af7e9..1309e5cfde 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionInheritPolicyIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/partition/IoTDBPartitionInheritPolicyIT.java
@@ -30,7 +30,6 @@ import org.apache.iotdb.confignode.rpc.thrift.TShowRegionResp;
 import org.apache.iotdb.confignode.rpc.thrift.TStorageGroupSchema;
 import org.apache.iotdb.confignode.rpc.thrift.TTimeSlotList;
 import org.apache.iotdb.consensus.ConsensusFactory;
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -53,20 +52,10 @@ import java.util.concurrent.TimeUnit;
 public class IoTDBPartitionInheritPolicyIT {
 
   private static final Logger LOGGER = LoggerFactory.getLogger(IoTDBPartitionInheritPolicyIT.class);
-
-  private static boolean originalEnableDataPartitionInheritPolicy;
   private static final boolean testEnableDataPartitionInheritPolicy = true;
-
-  private static String originalDataRegionConsensusProtocolClass;
   private static final String testDataRegionConsensusProtocolClass =
       ConsensusFactory.RATIS_CONSENSUS;
-
-  private static int originalDataReplicationFactor;
   private static final int testReplicationFactor = 3;
-
-  private static int originalSeriesPartitionSlotNum;
-
-  private static long originalTimePartitionInterval;
   private static final long testTimePartitionInterval = 604800000;
 
   private static final String sg = "root.sg";
@@ -78,24 +67,26 @@ public class IoTDBPartitionInheritPolicyIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    originalDataRegionConsensusProtocolClass =
-        ConfigFactory.getConfig().getDataRegionConsensusProtocolClass();
-    ConfigFactory.getConfig()
-        .setDataRegionConsensusProtocolClass(testDataRegionConsensusProtocolClass);
-
-    originalEnableDataPartitionInheritPolicy =
-        ConfigFactory.getConfig().isEnableDataPartitionInheritPolicy();
-    ConfigFactory.getConfig()
-        .setEnableDataPartitionInheritPolicy(testEnableDataPartitionInheritPolicy);
-
-    originalDataReplicationFactor = ConfigFactory.getConfig().getDataReplicationFactor();
-    ConfigFactory.getConfig().setDataReplicationFactor(testReplicationFactor);
-
-    originalSeriesPartitionSlotNum = ConfigFactory.getConfig().getSeriesPartitionSlotNum();
-    ConfigFactory.getConfig().setSeriesPartitionSlotNum(testSeriesPartitionSlotNum * 10);
-
-    originalTimePartitionInterval = ConfigFactory.getConfig().getTimePartitionInterval();
-    ConfigFactory.getConfig().setTimePartitionInterval(testTimePartitionInterval);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setDataRegionConsensusProtocolClass(testDataRegionConsensusProtocolClass)
+        .setEnableDataPartitionInheritPolicy(testEnableDataPartitionInheritPolicy)
+        .setDataReplicationFactor(testReplicationFactor)
+        .setTimePartitionInterval(testTimePartitionInterval);
+
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setDataRegionConsensusProtocolClass(testDataRegionConsensusProtocolClass)
+        .setEnableDataPartitionInheritPolicy(testEnableDataPartitionInheritPolicy)
+        .setDataReplicationFactor(testReplicationFactor)
+        .setTimePartitionInterval(testTimePartitionInterval);
+
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeConfig()
+        .setSeriesPartitionSlotNum(testSeriesPartitionSlotNum * 10);
 
     // Init 1C3D environment
     EnvFactory.getEnv().initClusterEnvironment(1, 3);
@@ -113,15 +104,7 @@ public class IoTDBPartitionInheritPolicyIT {
 
   @AfterClass
   public static void tearDown() {
-    EnvFactory.getEnv().cleanAfterClass();
-
-    ConfigFactory.getConfig()
-        .setDataRegionConsensusProtocolClass(originalDataRegionConsensusProtocolClass);
-    ConfigFactory.getConfig()
-        .setEnableDataPartitionInheritPolicy(originalEnableDataPartitionInheritPolicy);
-    ConfigFactory.getConfig().setDataReplicationFactor(originalDataReplicationFactor);
-    ConfigFactory.getConfig().setSeriesPartitionSlotNum(originalSeriesPartitionSlotNum);
-    ConfigFactory.getConfig().setTimePartitionInterval(originalTimePartitionInterval);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/utils/ConfigNodeTestUtils.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/utils/ConfigNodeTestUtils.java
index 66376ae959..9921c8a427 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/utils/ConfigNodeTestUtils.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/utils/ConfigNodeTestUtils.java
@@ -37,10 +37,8 @@ import org.apache.iotdb.confignode.rpc.thrift.TDataNodeRegisterReq;
 import org.apache.iotdb.confignode.rpc.thrift.TDataNodeRestartReq;
 import org.apache.iotdb.confignode.rpc.thrift.TShowClusterResp;
 import org.apache.iotdb.confignode.rpc.thrift.TTimeSlotList;
-import org.apache.iotdb.it.env.ConfigFactory;
-import org.apache.iotdb.it.env.ConfigNodeWrapper;
-import org.apache.iotdb.it.env.DataNodeWrapper;
-import org.apache.iotdb.itbase.env.BaseConfig;
+import org.apache.iotdb.it.env.cluster.ConfigNodeWrapper;
+import org.apache.iotdb.it.env.cluster.DataNodeWrapper;
 import org.apache.iotdb.tsfile.utils.PublicBAOS;
 
 import org.apache.thrift.TException;
@@ -58,8 +56,6 @@ import static org.junit.Assert.assertTrue;
 
 public class ConfigNodeTestUtils {
 
-  private static final BaseConfig CONF = ConfigFactory.getConfig();
-
   private static final int retryNum = 30;
 
   public static TShowClusterResp getClusterNodeInfos(
@@ -220,26 +216,27 @@ public class ConfigNodeTestUtils {
         .setClusterParameters(generateClusterParameters());
   }
 
-  private static TClusterParameters generateClusterParameters() {
+  public static TClusterParameters generateClusterParameters() {
     TClusterParameters clusterParameters = new TClusterParameters();
-    clusterParameters.setClusterName(CONF.getClusterName());
+    clusterParameters.setClusterName("defaultCluster");
     clusterParameters.setConfigNodeConsensusProtocolClass(
-        CONF.getConfigNodeConsensusProtocolClass());
+        "org.apache.iotdb.consensus.simple.SimpleConsensus");
     clusterParameters.setDataRegionConsensusProtocolClass(
-        CONF.getDataRegionConsensusProtocolClass());
+        "org.apache.iotdb.consensus.simple.SimpleConsensus");
     clusterParameters.setSchemaRegionConsensusProtocolClass(
-        CONF.getSchemaRegionConsensusProtocolClass());
-    clusterParameters.setSeriesPartitionSlotNum(CONF.getSeriesPartitionSlotNum());
-    clusterParameters.setSeriesPartitionExecutorClass(CONF.getSeriesPartitionExecutorClass());
-    clusterParameters.setDefaultTTL(CONF.getDefaultTTL());
-    clusterParameters.setTimePartitionInterval(CONF.getTimePartitionInterval());
-    clusterParameters.setDataReplicationFactor(CONF.getDataReplicationFactor());
-    clusterParameters.setSchemaReplicationFactor(CONF.getSchemaReplicationFactor());
-    clusterParameters.setDataRegionPerProcessor(CONF.getDataRegionPerProcessor());
-    clusterParameters.setSchemaRegionPerDataNode(CONF.getSchemaRegionPerDataNode());
-    clusterParameters.setDiskSpaceWarningThreshold(CONF.getDiskSpaceWarningThreshold());
-    clusterParameters.setReadConsistencyLevel(CONF.getReadConsistencyLevel());
-    clusterParameters.setLeastDataRegionGroupNum(CONF.getLeastDataRegionGroupNum());
+        "org.apache.iotdb.consensus.simple.SimpleConsensus");
+    clusterParameters.setSeriesPartitionSlotNum(10000);
+    clusterParameters.setSeriesPartitionExecutorClass(
+        "org.apache.iotdb.commons.partition.executor.hash.BKDRHashExecutor");
+    clusterParameters.setDefaultTTL(Long.MAX_VALUE);
+    clusterParameters.setTimePartitionInterval(604800000);
+    clusterParameters.setDataReplicationFactor(1);
+    clusterParameters.setSchemaReplicationFactor(1);
+    clusterParameters.setDataRegionPerProcessor(1.0);
+    clusterParameters.setSchemaRegionPerDataNode(1.0);
+    clusterParameters.setDiskSpaceWarningThreshold(0.05);
+    clusterParameters.setReadConsistencyLevel("strong");
+    clusterParameters.setLeastDataRegionGroupNum(5);
     return clusterParameters;
   }
 
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IOTDBLoadTsFileIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IOTDBLoadTsFileIT.java
index 2a2639ae2c..ca6fd4a8be 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IOTDBLoadTsFileIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IOTDBLoadTsFileIT.java
@@ -20,7 +20,6 @@
 package org.apache.iotdb.db.it;
 
 import org.apache.iotdb.db.mpp.common.header.ColumnHeaderConstant;
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.it.utils.TsFileGenerator;
@@ -57,24 +56,27 @@ public class IOTDBLoadTsFileIT {
   private static final Logger LOGGER = LoggerFactory.getLogger(IOTDBLoadTsFileIT.class);
   private static final long PARTITION_INTERVAL = 10 * 1000L;
 
-  private long originConfigNodePartitionInterval;
-
   private File tmpDir;
 
   @Before
   public void setUp() throws Exception {
     tmpDir = new File(Files.createTempDirectory("load").toUri());
-    originConfigNodePartitionInterval = ConfigFactory.getConfig().getTimePartitionInterval();
-    ConfigFactory.getConfig().setTimePartitionInterval(PARTITION_INTERVAL);
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setTimePartitionInterval(PARTITION_INTERVAL);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setTimePartitionInterval(PARTITION_INTERVAL);
+    EnvFactory.getEnv().initClusterEnvironment();
   }
 
   @After
   public void tearDown() throws Exception {
     deleteSG();
 
-    EnvFactory.getEnv().cleanAfterTest();
-    ConfigFactory.getConfig().setTimePartitionInterval(originConfigNodePartitionInterval);
+    EnvFactory.getEnv().cleanClusterEnvironment();
 
     if (!deleteDir()) {
       LOGGER.error("Can not delete tmp dir for loading tsfile.");
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBAuthIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBAuthIT.java
index d24bfc755e..389e7e39b8 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBAuthIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBAuthIT.java
@@ -54,12 +54,12 @@ public class IoTDBAuthIT {
 
   @Before
   public void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv().initClusterEnvironment();
   }
 
   @After
   public void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterTest();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBDatetimeFormatIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBDatetimeFormatIT.java
index 5c6115dd48..5812d6b432 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBDatetimeFormatIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBDatetimeFormatIT.java
@@ -44,12 +44,12 @@ public class IoTDBDatetimeFormatIT {
 
   @Before
   public void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv().initClusterEnvironment();
   }
 
   @After
   public void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterTest();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBDeletionIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBDeletionIT.java
index 789eedab1a..49d3a457f7 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBDeletionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBDeletionIT.java
@@ -19,7 +19,6 @@
 
 package org.apache.iotdb.db.it;
 
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -61,26 +60,29 @@ public class IoTDBDeletionIT {
   private String insertTemplate =
       "INSERT INTO root.vehicle.d0(timestamp,s0,s1,s2,s3,s4" + ") VALUES(%d,%d,%d,%f,%s,%b)";
   private String deleteAllTemplate = "DELETE FROM root.vehicle.d0.* WHERE time <= 10000";
-  private long prevPartitionInterval;
-  private long size;
 
   @Before
   public void setUp() throws Exception {
     Locale.setDefault(Locale.ENGLISH);
-    prevPartitionInterval = ConfigFactory.getConfig().getPartitionInterval();
-    ConfigFactory.getConfig().setPartitionInterval(1000);
-    size = ConfigFactory.getConfig().getMemtableSizeThreshold();
+
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setPartitionInterval(1000)
+        .setMemtableSizeThreshold(10000);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setPartitionInterval(1000)
+        .setMemtableSizeThreshold(10000);
     // Adjust memstable threshold size to make it flush automatically
-    ConfigFactory.getConfig().setMemtableSizeThreshold(10000);
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv().initClusterEnvironment();
     prepareSeries();
   }
 
   @After
   public void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterTest();
-    ConfigFactory.getConfig().setPartitionInterval(prevPartitionInterval);
-    ConfigFactory.getConfig().setMemtableSizeThreshold(size);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   /**
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBEncodingIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBEncodingIT.java
index ff1452c953..71e408c531 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBEncodingIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBEncodingIT.java
@@ -45,12 +45,12 @@ public class IoTDBEncodingIT {
 
   @Before
   public void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
   }
 
   @After
   public void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBExampleIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBExampleIT.java
index e0f5151216..3646f74182 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBExampleIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBExampleIT.java
@@ -42,12 +42,12 @@ import java.sql.Statement;
 public class IoTDBExampleIT {
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBExecuteBatchIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBExecuteBatchIT.java
index 7efaf49e92..743921aec9 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBExecuteBatchIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBExecuteBatchIT.java
@@ -44,12 +44,12 @@ import static org.junit.Assert.fail;
 public class IoTDBExecuteBatchIT {
   @Before
   public void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv().initClusterEnvironment();
   }
 
   @After
   public void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterTest();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFilterBetweenIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFilterBetweenIT.java
index a3ef48a0d1..b2799a1c6a 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFilterBetweenIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFilterBetweenIT.java
@@ -48,14 +48,14 @@ public class IoTDBFilterBetweenIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv().initClusterEnvironment();
     createTimeSeries();
     generateData();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterTest();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   private static void createTimeSeries() {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFilterIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFilterIT.java
index 7a64a5592e..9f6ac61c2a 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFilterIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFilterIT.java
@@ -19,7 +19,6 @@
 
 package org.apache.iotdb.db.it;
 
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -38,7 +37,6 @@ import java.sql.Statement;
 import static org.apache.iotdb.db.it.utils.TestUtils.assertTestFail;
 import static org.apache.iotdb.db.it.utils.TestUtils.resultSetEqualTest;
 import static org.apache.iotdb.itbase.constant.TestConstant.TIMESTAMP_STR;
-import static org.apache.iotdb.itbase.constant.TestConstant.count;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
@@ -47,33 +45,30 @@ import static org.junit.Assert.fail;
 public class IoTDBFilterIT {
   protected static final int ITERATION_TIMES = 10;
 
-  protected static boolean enableSeqSpaceCompaction;
-  protected static boolean enableUnseqSpaceCompaction;
-  protected static boolean enableCrossSpaceCompaction;
-
   @BeforeClass
   public static void setUp() throws Exception {
-    enableSeqSpaceCompaction = ConfigFactory.getConfig().isEnableSeqSpaceCompaction();
-    enableUnseqSpaceCompaction = ConfigFactory.getConfig().isEnableUnseqSpaceCompaction();
-    enableCrossSpaceCompaction = ConfigFactory.getConfig().isEnableCrossSpaceCompaction();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(false);
-    ConfigFactory.getConfig()
-        .setUdfCollectorMemoryBudgetInMB(5)
-        .setUdfTransformerMemoryBudgetInMB(5)
-        .setUdfReaderMemoryBudgetInMB(5);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setUdfMemoryBudgetInMB(5);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setUdfMemoryBudgetInMB(5);
+    EnvFactory.getEnv().initClusterEnvironment();
     createTimeSeries();
     generateData();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   private static void createTimeSeries() {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFilterNullIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFilterNullIT.java
index acc1586ca1..ad06ea1b88 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFilterNullIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFilterNullIT.java
@@ -76,13 +76,13 @@ public class IoTDBFilterNullIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv().initClusterEnvironment();
     prepareData();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterTest();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFloatPrecisionIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFloatPrecisionIT.java
index 8c85dbbcba..881a8f205b 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFloatPrecisionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFloatPrecisionIT.java
@@ -65,14 +65,14 @@ public class IoTDBFloatPrecisionIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
     initCreateSQLStatement();
     insertData();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   private static void initCreateSQLStatement() {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFlushQueryMergeIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFlushQueryMergeIT.java
index a7d8012f19..18359f5424 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFlushQueryMergeIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBFlushQueryMergeIT.java
@@ -65,13 +65,13 @@ public class IoTDBFlushQueryMergeIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
     insertData();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   private static void insertData() {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBInsertMultiRowIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBInsertMultiRowIT.java
index 4c866c776a..ef3eec20ad 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBInsertMultiRowIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBInsertMultiRowIT.java
@@ -55,7 +55,7 @@ public class IoTDBInsertMultiRowIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
     initCreateSQLStatement();
     insertData();
   }
@@ -63,7 +63,7 @@ public class IoTDBInsertMultiRowIT {
   @AfterClass
   public static void tearDown() throws Exception {
     close();
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   private static void close() {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBInsertNaNIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBInsertNaNIT.java
index 8f6ef49cfc..9663d6164d 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBInsertNaNIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBInsertNaNIT.java
@@ -67,14 +67,14 @@ public class IoTDBInsertNaNIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
     initCreateSQLStatement();
     insertData();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   private static void initCreateSQLStatement() {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBInsertNullIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBInsertNullIT.java
index c5df37ecd9..47f1e8f67d 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBInsertNullIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBInsertNullIT.java
@@ -54,7 +54,7 @@ public class IoTDBInsertNullIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
     initCreateSQLStatement();
     insertData();
   }
@@ -62,7 +62,7 @@ public class IoTDBInsertNullIT {
   @AfterClass
   public static void tearDown() throws Exception {
     close();
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   private static void close() {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBInsertWithQueryIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBInsertWithQueryIT.java
index dfad777bee..da3975f926 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBInsertWithQueryIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBInsertWithQueryIT.java
@@ -51,12 +51,12 @@ public class IoTDBInsertWithQueryIT {
 
   @Before
   public void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
   }
 
   @After
   public void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBInsertWithoutTimeIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBInsertWithoutTimeIT.java
index c59c8eb4d7..d9d576ea20 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBInsertWithoutTimeIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBInsertWithoutTimeIT.java
@@ -53,13 +53,13 @@ public class IoTDBInsertWithoutTimeIT {
 
   @Before
   public void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv().initClusterEnvironment();
     createTimeseries();
   }
 
   @After
   public void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterTest();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   private void createTimeseries() {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBMultiDeviceIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBMultiDeviceIT.java
index 5edc326848..2aa1754e35 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBMultiDeviceIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBMultiDeviceIT.java
@@ -18,13 +18,11 @@
  */
 package org.apache.iotdb.db.it;
 
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
 import org.apache.iotdb.itbase.category.LocalStandaloneIT;
 import org.apache.iotdb.itbase.constant.TestConstant;
-import org.apache.iotdb.itbase.env.BaseConfig;
 
 import org.junit.After;
 import org.junit.Before;
@@ -47,46 +45,36 @@ import static org.junit.Assert.fail;
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBMultiDeviceIT {
 
-  private static BaseConfig tsFileConfig = ConfigFactory.getConfig();
-  private static int maxNumberOfPointsInPage;
-  private static int pageSizeInByte;
-  private static int groupSizeInByte;
-  private static long prevPartitionInterval;
-
   @Before
   public void setUp() throws Exception {
-    // use small page setting
-    // origin value
-    maxNumberOfPointsInPage = tsFileConfig.getMaxNumberOfPointsInPage();
-    pageSizeInByte = tsFileConfig.getPageSizeInByte();
-    groupSizeInByte = tsFileConfig.getGroupSizeInByte();
-
-    // new value
-    tsFileConfig.setMaxNumberOfPointsInPage(100);
-    tsFileConfig.setPageSizeInByte(1024 * 15);
-    tsFileConfig.setGroupSizeInByte(1024 * 100);
-    ConfigFactory.getConfig().setMemtableSizeThreshold(1024 * 100);
-    prevPartitionInterval = ConfigFactory.getConfig().getPartitionInterval();
-    ConfigFactory.getConfig().setPartitionInterval(100);
-    ConfigFactory.getConfig().setCompressor("LZ4");
-
-    EnvFactory.getEnv().initBeforeTest();
+    // use small page
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setMaxNumberOfPointsInPage(100)
+        .setPageSizeInByte(1024 * 15)
+        .setGroupSizeInByte(1024 * 100)
+        .setMemtableSizeThreshold(1024 * 100)
+        .setPartitionInterval(100)
+        .setCompressor("LZ4");
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setMaxNumberOfPointsInPage(100)
+        .setPageSizeInByte(1024 * 15)
+        .setGroupSizeInByte(1024 * 100)
+        .setMemtableSizeThreshold(1024 * 100)
+        .setPartitionInterval(100)
+        .setCompressor("LZ4");
+
+    EnvFactory.getEnv().initClusterEnvironment();
 
     insertData();
   }
 
   @After
   public void tearDown() throws Exception {
-    // recovery value
-    ConfigFactory.getConfig().setMaxNumberOfPointsInPage(maxNumberOfPointsInPage);
-    ConfigFactory.getConfig().setPageSizeInByte(pageSizeInByte);
-    ConfigFactory.getConfig().setGroupSizeInByte(groupSizeInByte);
-
-    EnvFactory.getEnv().cleanAfterTest();
-
-    ConfigFactory.getConfig().setPartitionInterval(prevPartitionInterval);
-    ConfigFactory.getConfig().setMemtableSizeThreshold(groupSizeInByte);
-    ConfigFactory.getConfig().setCompressor("SNAPPY");
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   private static void insertData() {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBNestedQueryIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBNestedQueryIT.java
index 07c54ddc1c..a65f1066e5 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBNestedQueryIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBNestedQueryIT.java
@@ -19,7 +19,6 @@
 package org.apache.iotdb.db.it;
 
 import org.apache.iotdb.db.mpp.common.header.ColumnHeaderConstant;
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -50,23 +49,24 @@ public class IoTDBNestedQueryIT {
 
   protected static final int ITERATION_TIMES = 10;
 
-  protected static boolean enableSeqSpaceCompaction;
-  protected static boolean enableUnseqSpaceCompaction;
-  protected static boolean enableCrossSpaceCompaction;
-
   @BeforeClass
   public static void setUp() throws Exception {
-    enableSeqSpaceCompaction = ConfigFactory.getConfig().isEnableSeqSpaceCompaction();
-    enableUnseqSpaceCompaction = ConfigFactory.getConfig().isEnableUnseqSpaceCompaction();
-    enableCrossSpaceCompaction = ConfigFactory.getConfig().isEnableCrossSpaceCompaction();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(false);
-    ConfigFactory.getConfig()
-        .setUdfCollectorMemoryBudgetInMB(5)
-        .setUdfTransformerMemoryBudgetInMB(5)
-        .setUdfReaderMemoryBudgetInMB(5);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setUdfMemoryBudgetInMB(5);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setUdfMemoryBudgetInMB(5);
+
+    EnvFactory.getEnv().initClusterEnvironment();
     createTimeSeries();
     generateData();
     registerUDF();
@@ -74,14 +74,7 @@ public class IoTDBNestedQueryIT {
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
-    ConfigFactory.getConfig()
-        .setUdfCollectorMemoryBudgetInMB(100)
-        .setUdfTransformerMemoryBudgetInMB(100)
-        .setUdfReaderMemoryBudgetInMB(100);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   private static void createTimeSeries() {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBPartialInsertionIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBPartialInsertionIT.java
index d98c60b577..dc03376541 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBPartialInsertionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBPartialInsertionIT.java
@@ -18,7 +18,6 @@
  */
 package org.apache.iotdb.db.it;
 
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -51,14 +50,14 @@ public class IoTDBPartialInsertionIT {
 
   @Before
   public void setUp() throws Exception {
-    ConfigFactory.getConfig().setAutoCreateSchemaEnabled(false);
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv().getConfig().getConfigNodeCommonConfig().setAutoCreateSchemaEnabled(false);
+    EnvFactory.getEnv().getConfig().getDataNodeCommonConfig().setAutoCreateSchemaEnabled(false);
+    EnvFactory.getEnv().initClusterEnvironment();
   }
 
   @After
   public void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterTest();
-    ConfigFactory.getConfig().setAutoCreateSchemaEnabled(true);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBQueryWithRecreatedTimeseriesIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBQueryWithRecreatedTimeseriesIT.java
index cd2ba57e12..5472fabec5 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBQueryWithRecreatedTimeseriesIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBQueryWithRecreatedTimeseriesIT.java
@@ -40,12 +40,12 @@ public class IoTDBQueryWithRecreatedTimeseriesIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBQuotedPathIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBQuotedPathIT.java
index ab66cc7fb7..5379bdf243 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBQuotedPathIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBQuotedPathIT.java
@@ -43,12 +43,12 @@ import static org.junit.Assert.assertEquals;
 public class IoTDBQuotedPathIT {
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRecoverIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRecoverIT.java
index dc2b8ae7ba..fa95c4fec3 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRecoverIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRecoverIT.java
@@ -88,13 +88,13 @@ public class IoTDBRecoverIT {
 
   @Before
   public void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv().initClusterEnvironment();
     prepareData();
   }
 
   @After
   public void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterTest();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRecoverUnclosedIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRecoverUnclosedIT.java
index f25ea6d2f1..c62618e745 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRecoverUnclosedIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRecoverUnclosedIT.java
@@ -95,7 +95,7 @@ public class IoTDBRecoverUnclosedIT {
 
   @Before
   public void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
     prevWALMode = config.getWalMode();
     config.setWalMode(WALMode.SYNC);
     prepareData();
@@ -104,7 +104,7 @@ public class IoTDBRecoverUnclosedIT {
   @After
   public void tearDown() throws Exception {
     config.setWalMode(prevWALMode);
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRestartIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRestartIT.java
index 91d63d9113..e93497a5da 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRestartIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBRestartIT.java
@@ -54,12 +54,12 @@ public class IoTDBRestartIT {
 
   @Before
   public void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
   }
 
   @After
   public void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSameMeasurementsDifferentTypesIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSameMeasurementsDifferentTypesIT.java
index b6373741ee..059eafdec7 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSameMeasurementsDifferentTypesIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSameMeasurementsDifferentTypesIT.java
@@ -18,13 +18,11 @@
  */
 package org.apache.iotdb.db.it;
 
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
 import org.apache.iotdb.itbase.category.LocalStandaloneIT;
 import org.apache.iotdb.itbase.constant.TestConstant;
-import org.apache.iotdb.itbase.env.BaseConfig;
 
 import org.junit.AfterClass;
 import org.junit.Assert;
@@ -47,41 +45,32 @@ import static org.junit.Assert.fail;
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBSameMeasurementsDifferentTypesIT {
 
-  private static final BaseConfig tsFileConfig = ConfigFactory.getConfig();
-  private static int maxNumberOfPointsInPage;
-  private static int pageSizeInByte;
-  private static int groupSizeInByte;
-
   @BeforeClass
   public static void setUp() throws Exception {
-
-    // use small page setting
-    // origin value
-    maxNumberOfPointsInPage = tsFileConfig.getMaxNumberOfPointsInPage();
-    pageSizeInByte = tsFileConfig.getPageSizeInByte();
-    groupSizeInByte = tsFileConfig.getGroupSizeInByte();
-
-    // new value
-    ConfigFactory.getConfig()
+    // use small page
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setMaxNumberOfPointsInPage(1000)
+        .setPageSizeInByte(1024 * 150)
+        .setGroupSizeInByte(1024 * 1000)
+        .setMemtableSizeThreshold(1024 * 1000);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
         .setMaxNumberOfPointsInPage(1000)
         .setPageSizeInByte(1024 * 150)
         .setGroupSizeInByte(1024 * 1000)
         .setMemtableSizeThreshold(1024 * 1000);
 
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
 
     insertData();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    // recovery value
-    ConfigFactory.getConfig()
-        .setMaxNumberOfPointsInPage(maxNumberOfPointsInPage)
-        .setPageSizeInByte(pageSizeInByte)
-        .setGroupSizeInByte(groupSizeInByte)
-        .setMemtableSizeThreshold(groupSizeInByte);
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   private static void insertData() {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSettleIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSettleIT.java
index bf652f30df..6d9d9e42ff 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSettleIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSettleIT.java
@@ -49,14 +49,14 @@ public class IoTDBSettleIT {
   @BeforeClass
   public static void setUp() throws Exception {
     initCreateSQLStatement();
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv().initClusterEnvironment();
     executeSql();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
     close();
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv().initClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSimpleQueryIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSimpleQueryIT.java
index 4cafcb277a..082b89fdca 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSimpleQueryIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSimpleQueryIT.java
@@ -53,12 +53,12 @@ public class IoTDBSimpleQueryIT {
 
   @Before
   public void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv().initClusterEnvironment();
   }
 
   @After
   public void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterTest();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSyntaxConventionIdentifierIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSyntaxConventionIdentifierIT.java
index 967d40be8d..f134488d1b 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSyntaxConventionIdentifierIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSyntaxConventionIdentifierIT.java
@@ -46,12 +46,12 @@ import static org.junit.Assert.fail;
 public class IoTDBSyntaxConventionIdentifierIT {
   @Before
   public void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv().initClusterEnvironment();
   }
 
   @After
   public void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterTest();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSyntaxConventionStringLiteralIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSyntaxConventionStringLiteralIT.java
index 3a015b76c5..2d9355eb70 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSyntaxConventionStringLiteralIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBSyntaxConventionStringLiteralIT.java
@@ -49,12 +49,12 @@ public class IoTDBSyntaxConventionStringLiteralIT {
 
   @Before
   public void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv().initClusterEnvironment();
   }
 
   @After
   public void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterTest();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   /** Legal cases of using StringLiteral with single quote in insert and select clause. */
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBTimeZoneIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBTimeZoneIT.java
index 8cbe3924e4..ef7fe8a249 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBTimeZoneIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBTimeZoneIT.java
@@ -70,13 +70,13 @@ public class IoTDBTimeZoneIT {
 
   @Before
   public void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
     createTimeseries();
   }
 
   @After
   public void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   /**
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBTtlIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBTtlIT.java
index abfb591ad5..a0ad94a994 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBTtlIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBTtlIT.java
@@ -44,12 +44,12 @@ public class IoTDBTtlIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationByLevelIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationByLevelIT.java
index 648ea8fea6..97136f6b7e 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationByLevelIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationByLevelIT.java
@@ -79,13 +79,13 @@ public class IoTDBAggregationByLevelIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
     prepareData();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationDeleteIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationDeleteIT.java
index 67f0f2c52d..610682a245 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationDeleteIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationDeleteIT.java
@@ -18,7 +18,6 @@
  */
 package org.apache.iotdb.db.it.aggregation;
 
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -52,20 +51,18 @@ public class IoTDBAggregationDeleteIT {
         "flush",
         "delete from root.turbine.d1.s1 where time < 3"
       };
-  private long prevPartitionInterval;
 
   @Before
   public void setUp() throws Exception {
-    prevPartitionInterval = ConfigFactory.getConfig().getPartitionInterval();
-    ConfigFactory.getConfig().setPartitionInterval(1000);
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv().getConfig().getConfigNodeCommonConfig().setPartitionInterval(1000);
+    EnvFactory.getEnv().getConfig().getDataNodeCommonConfig().setPartitionInterval(1000);
+    EnvFactory.getEnv().initClusterEnvironment();
     prepareData();
   }
 
   @After
   public void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterTest();
-    ConfigFactory.getConfig().setPartitionInterval(prevPartitionInterval);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationIT.java
index 8018a84f44..65aee3dfc2 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationIT.java
@@ -47,7 +47,6 @@ import static org.apache.iotdb.db.constant.TestConstant.minTime;
 import static org.apache.iotdb.db.constant.TestConstant.minValue;
 import static org.apache.iotdb.db.constant.TestConstant.sum;
 import static org.apache.iotdb.db.it.utils.TestUtils.resultSetEqualWithDescOrderTest;
-import static org.apache.iotdb.itbase.constant.TestConstant.TIMESTAMP_STR;
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.fail;
 
@@ -107,17 +106,16 @@ public class IoTDBAggregationIT {
   private final String d0s3 = "root.vehicle.d0.s3";
   private static final String insertTemplate =
       "INSERT INTO root.vehicle.d0(timestamp,s0,s1,s2,s3,s4)" + " VALUES(%d,%d,%d,%f,%s,%s)";
-  private static long prevPartitionInterval;
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
     prepareData();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   // add test for part of points in page don't satisfy filter
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationLargeDataIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationLargeDataIT.java
index f5c431f3fc..e18fd71935 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationLargeDataIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationLargeDataIT.java
@@ -19,7 +19,6 @@
 
 package org.apache.iotdb.db.it.aggregation;
 
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -115,19 +114,15 @@ public class IoTDBAggregationLargeDataIT {
         "insert into root.vehicle.d0(timestamp,s4) values(100, true)",
       };
 
-  private static long prevPartitionInterval;
-
   @BeforeClass
   public static void setUp() throws Exception {
-    prevPartitionInterval = ConfigFactory.getConfig().getPartitionInterval();
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
     insertSQL();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig().setPartitionInterval(prevPartitionInterval);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationOptimizeIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationOptimizeIT.java
index 05b4a84326..f7573a9163 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationOptimizeIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationOptimizeIT.java
@@ -71,13 +71,13 @@ public class IoTDBAggregationOptimizeIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
     prepareData(SQLs);
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationScanOrderIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationScanOrderIT.java
index 48646546f3..8d10a197bd 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationScanOrderIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationScanOrderIT.java
@@ -19,7 +19,6 @@
 
 package org.apache.iotdb.db.it.aggregation;
 
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -40,10 +39,6 @@ import static org.apache.iotdb.db.it.utils.TestUtils.resultSetEqualWithDescOrder
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBAggregationScanOrderIT {
 
-  protected static boolean enableSeqSpaceCompaction;
-  protected static boolean enableUnseqSpaceCompaction;
-  protected static boolean enableCrossSpaceCompaction;
-
   private static final String[] sqls =
       new String[] {
         "insert into root.sg1.d1(time, s1) values (12, 12);",
@@ -76,22 +71,25 @@ public class IoTDBAggregationScanOrderIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    enableSeqSpaceCompaction = ConfigFactory.getConfig().isEnableSeqSpaceCompaction();
-    enableUnseqSpaceCompaction = ConfigFactory.getConfig().isEnableUnseqSpaceCompaction();
-    enableCrossSpaceCompaction = ConfigFactory.getConfig().isEnableCrossSpaceCompaction();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(false);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false);
+    EnvFactory.getEnv().initClusterEnvironment();
     prepareData(sqls);
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationSmallDataIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationSmallDataIT.java
index 32e7f2fecd..acde324d42 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationSmallDataIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBAggregationSmallDataIT.java
@@ -118,13 +118,13 @@ public class IoTDBAggregationSmallDataIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
     insertSQL();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBTagAggregationIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBTagAggregationIT.java
index b9304607b1..b26a5b74c3 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBTagAggregationIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aggregation/IoTDBTagAggregationIT.java
@@ -79,7 +79,7 @@ public class IoTDBTagAggregationIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
       for (String sql : DATASET) {
@@ -93,7 +93,7 @@ public class IoTDBTagAggregationIT {
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/alignbydevice/IoTDBAlignByDeviceIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/alignbydevice/IoTDBAlignByDeviceIT.java
index 3d6a3fbaea..9d264203f6 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/alignbydevice/IoTDBAlignByDeviceIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/alignbydevice/IoTDBAlignByDeviceIT.java
@@ -104,13 +104,13 @@ public class IoTDBAlignByDeviceIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
     insertData();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   private static void insertData() {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/alignbydevice/IoTDBOrderByWithAlignByDeviceIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/alignbydevice/IoTDBOrderByWithAlignByDeviceIT.java
index b777de6fb7..a6e766475b 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/alignbydevice/IoTDBOrderByWithAlignByDeviceIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/alignbydevice/IoTDBOrderByWithAlignByDeviceIT.java
@@ -73,13 +73,13 @@ public class IoTDBOrderByWithAlignByDeviceIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
     insertData();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   /**
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAggregationWithDeletion2IT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAggregationWithDeletion2IT.java
index 534bf1f015..5ea036892d 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAggregationWithDeletion2IT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAggregationWithDeletion2IT.java
@@ -19,7 +19,6 @@
 package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.db.it.utils.AlignedWriteUtil;
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -40,22 +39,25 @@ import static org.junit.Assert.fail;
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBAggregationWithDeletion2IT extends IoTDBAggregationWithDeletionIT {
 
-  private static int numOfPointsPerPage;
-
   @BeforeClass
   public static void setUp() throws Exception {
-    enableSeqSpaceCompaction = ConfigFactory.getConfig().isEnableSeqSpaceCompaction();
-    enableUnseqSpaceCompaction = ConfigFactory.getConfig().isEnableUnseqSpaceCompaction();
-    enableCrossSpaceCompaction = ConfigFactory.getConfig().isEnableCrossSpaceCompaction();
-    numOfPointsPerPage = ConfigFactory.getConfig().getMaxNumberOfPointsInPage();
-    maxTsBlockLineNumber = ConfigFactory.getConfig().getMaxTsBlockLineNumber();
-
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(false);
-    ConfigFactory.getConfig().setMaxNumberOfPointsInPage(3);
-    ConfigFactory.getConfig().setMaxTsBlockLineNumber(3);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setMaxTsBlockLineNumber(3)
+        .setMaxNumberOfPointsInPage(3);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setMaxTsBlockLineNumber(3)
+        .setMaxNumberOfPointsInPage(3);
+    EnvFactory.getEnv().initClusterEnvironment();
     AlignedWriteUtil.insertData();
 
     try (Connection connection = EnvFactory.getEnv().getConnection();
@@ -70,11 +72,6 @@ public class IoTDBAggregationWithDeletion2IT extends IoTDBAggregationWithDeletio
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
-    ConfigFactory.getConfig().setMaxNumberOfPointsInPage(numOfPointsPerPage);
-    ConfigFactory.getConfig().setMaxTsBlockLineNumber(maxTsBlockLineNumber);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 }
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAggregationWithDeletionIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAggregationWithDeletionIT.java
index fa4ac3d93e..923022ba7b 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAggregationWithDeletionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAggregationWithDeletionIT.java
@@ -19,7 +19,6 @@
 package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.db.it.utils.AlignedWriteUtil;
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -48,22 +47,24 @@ import static org.junit.Assert.fail;
 public class IoTDBAggregationWithDeletionIT {
 
   private static final double DELTA = 1e-6;
-  protected static boolean enableSeqSpaceCompaction;
-  protected static boolean enableUnseqSpaceCompaction;
-  protected static boolean enableCrossSpaceCompaction;
-  protected static int maxTsBlockLineNumber;
 
   @BeforeClass
   public static void setUp() throws Exception {
-    enableSeqSpaceCompaction = ConfigFactory.getConfig().isEnableSeqSpaceCompaction();
-    enableUnseqSpaceCompaction = ConfigFactory.getConfig().isEnableUnseqSpaceCompaction();
-    enableCrossSpaceCompaction = ConfigFactory.getConfig().isEnableCrossSpaceCompaction();
-    maxTsBlockLineNumber = ConfigFactory.getConfig().getMaxTsBlockLineNumber();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(false);
-    ConfigFactory.getConfig().setMaxTsBlockLineNumber(3);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setMaxTsBlockLineNumber(3);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setMaxTsBlockLineNumber(3);
+    EnvFactory.getEnv().initClusterEnvironment();
     AlignedWriteUtil.insertData();
 
     try (Connection connection = EnvFactory.getEnv().getConnection();
@@ -78,11 +79,7 @@ public class IoTDBAggregationWithDeletionIT {
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
-    ConfigFactory.getConfig().setMaxTsBlockLineNumber(maxTsBlockLineNumber);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedDataDeletionIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedDataDeletionIT.java
index 6e01b63c10..d6efa6829f 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedDataDeletionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedDataDeletionIT.java
@@ -19,7 +19,6 @@
 
 package org.apache.iotdb.db.it.aligned;
 
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -57,26 +56,29 @@ public class IoTDBAlignedDataDeletionIT {
       "INSERT INTO root.vehicle.d0(timestamp,s0,s1,s2,s3,s4"
           + ") ALIGNED VALUES(%d,%d,%d,%f,%s,%b)";
   private String deleteAllTemplate = "DELETE FROM root.vehicle.d0.* WHERE time <= 10000";
-  private long prevPartitionInterval;
-  private long size;
 
   @Before
   public void setUp() throws Exception {
     Locale.setDefault(Locale.ENGLISH);
-    prevPartitionInterval = ConfigFactory.getConfig().getPartitionInterval();
-    ConfigFactory.getConfig().setPartitionInterval(1000);
-    size = ConfigFactory.getConfig().getMemtableSizeThreshold();
-    // Adjust memstable threshold size to make it flush automatically
-    ConfigFactory.getConfig().setMemtableSizeThreshold(10000);
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setPartitionInterval(1000)
+        // Adjust memstable threshold size to make it flush automatically
+        .setMemtableSizeThreshold(10000);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setPartitionInterval(1000)
+        // Adjust memstable threshold size to make it flush automatically
+        .setMemtableSizeThreshold(10000);
+    EnvFactory.getEnv().initClusterEnvironment();
     prepareSeries();
   }
 
   @After
   public void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterTest();
-    ConfigFactory.getConfig().setPartitionInterval(prevPartitionInterval);
-    ConfigFactory.getConfig().setMemtableSizeThreshold(size);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   /**
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedLastQuery2IT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedLastQuery2IT.java
index 4fb5e8d229..be6026e406 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedLastQuery2IT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedLastQuery2IT.java
@@ -19,7 +19,6 @@
 package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.db.it.utils.AlignedWriteUtil;
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -34,32 +33,30 @@ import org.junit.runner.RunWith;
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBAlignedLastQuery2IT extends IoTDBAlignedLastQueryIT {
 
-  private static int numOfPointsPerPage;
-
   @BeforeClass
   public static void setUp() throws Exception {
-    enableSeqSpaceCompaction = ConfigFactory.getConfig().isEnableSeqSpaceCompaction();
-    enableUnseqSpaceCompaction = ConfigFactory.getConfig().isEnableUnseqSpaceCompaction();
-    enableCrossSpaceCompaction = ConfigFactory.getConfig().isEnableCrossSpaceCompaction();
-    numOfPointsPerPage = ConfigFactory.getConfig().getMaxNumberOfPointsInPage();
-    maxTsBlockLineNumber = ConfigFactory.getConfig().getMaxTsBlockLineNumber();
-
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(false);
-    ConfigFactory.getConfig().setMaxNumberOfPointsInPage(2);
-    ConfigFactory.getConfig().setMaxTsBlockLineNumber(3);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setMaxTsBlockLineNumber(3)
+        .setMaxNumberOfPointsInPage(2);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setMaxTsBlockLineNumber(3)
+        .setMaxNumberOfPointsInPage(2);
+    EnvFactory.getEnv().initClusterEnvironment();
     AlignedWriteUtil.insertData();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
-    ConfigFactory.getConfig().setMaxNumberOfPointsInPage(numOfPointsPerPage);
-    ConfigFactory.getConfig().setMaxTsBlockLineNumber(maxTsBlockLineNumber);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 }
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedLastQuery3IT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedLastQuery3IT.java
index bba2c6dab9..d46764ac56 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedLastQuery3IT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedLastQuery3IT.java
@@ -19,7 +19,6 @@
 package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.db.it.utils.AlignedWriteUtil;
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -34,32 +33,30 @@ import org.junit.runner.RunWith;
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBAlignedLastQuery3IT extends IoTDBAlignedLastQueryIT {
 
-  private static int numOfPointsPerPage;
-
   @BeforeClass
   public static void setUp() throws Exception {
-    enableSeqSpaceCompaction = ConfigFactory.getConfig().isEnableSeqSpaceCompaction();
-    enableUnseqSpaceCompaction = ConfigFactory.getConfig().isEnableUnseqSpaceCompaction();
-    enableCrossSpaceCompaction = ConfigFactory.getConfig().isEnableCrossSpaceCompaction();
-    numOfPointsPerPage = ConfigFactory.getConfig().getMaxNumberOfPointsInPage();
-    maxTsBlockLineNumber = ConfigFactory.getConfig().getMaxTsBlockLineNumber();
-
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(false);
-    ConfigFactory.getConfig().setMaxNumberOfPointsInPage(2);
-    ConfigFactory.getConfig().setMaxTsBlockLineNumber(3);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setMaxTsBlockLineNumber(3)
+        .setMaxNumberOfPointsInPage(2);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setMaxTsBlockLineNumber(3)
+        .setMaxNumberOfPointsInPage(2);
+    EnvFactory.getEnv().initClusterEnvironment();
     AlignedWriteUtil.insertData();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
-    ConfigFactory.getConfig().setMaxNumberOfPointsInPage(numOfPointsPerPage);
-    ConfigFactory.getConfig().setMaxTsBlockLineNumber(maxTsBlockLineNumber);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 }
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedLastQueryIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedLastQueryIT.java
index c8a616acc5..ce20916200 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedLastQueryIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedLastQueryIT.java
@@ -20,7 +20,6 @@ package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.db.it.utils.AlignedWriteUtil;
 import org.apache.iotdb.db.mpp.common.header.ColumnHeaderConstant;
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -53,32 +52,29 @@ import static org.junit.Assert.fail;
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBAlignedLastQueryIT {
 
-  protected static boolean enableSeqSpaceCompaction;
-  protected static boolean enableUnseqSpaceCompaction;
-  protected static boolean enableCrossSpaceCompaction;
-  protected static int maxTsBlockLineNumber;
-
   @BeforeClass
   public static void setUp() throws Exception {
-    enableSeqSpaceCompaction = ConfigFactory.getConfig().isEnableSeqSpaceCompaction();
-    enableUnseqSpaceCompaction = ConfigFactory.getConfig().isEnableUnseqSpaceCompaction();
-    enableCrossSpaceCompaction = ConfigFactory.getConfig().isEnableCrossSpaceCompaction();
-    maxTsBlockLineNumber = ConfigFactory.getConfig().getMaxTsBlockLineNumber();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(false);
-    ConfigFactory.getConfig().setMaxTsBlockLineNumber(3);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setMaxTsBlockLineNumber(3);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setMaxTsBlockLineNumber(3);
+    EnvFactory.getEnv().initClusterEnvironment();
     AlignedWriteUtil.insertData();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
-    ConfigFactory.getConfig().setMaxTsBlockLineNumber(maxTsBlockLineNumber);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   // ----------------------------------------Last Query-----------------------------------------
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedSeriesQuery2IT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedSeriesQuery2IT.java
index 76355e4638..73893f9100 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedSeriesQuery2IT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedSeriesQuery2IT.java
@@ -19,7 +19,6 @@
 package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.db.it.utils.AlignedWriteUtil;
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -34,32 +33,30 @@ import org.junit.runner.RunWith;
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBAlignedSeriesQuery2IT extends IoTDBAlignedSeriesQueryIT {
 
-  private static int numOfPointsPerPage;
-
   @BeforeClass
   public static void setUp() throws Exception {
-    enableSeqSpaceCompaction = ConfigFactory.getConfig().isEnableSeqSpaceCompaction();
-    enableUnseqSpaceCompaction = ConfigFactory.getConfig().isEnableUnseqSpaceCompaction();
-    enableCrossSpaceCompaction = ConfigFactory.getConfig().isEnableCrossSpaceCompaction();
-    numOfPointsPerPage = ConfigFactory.getConfig().getMaxNumberOfPointsInPage();
-    maxTsBlockLineNumber = ConfigFactory.getConfig().getMaxTsBlockLineNumber();
-
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(false);
-    ConfigFactory.getConfig().setMaxNumberOfPointsInPage(2);
-    ConfigFactory.getConfig().setMaxTsBlockLineNumber(3);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setMaxTsBlockLineNumber(3)
+        .setMaxNumberOfPointsInPage(2);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setMaxTsBlockLineNumber(3)
+        .setMaxNumberOfPointsInPage(2);
+    EnvFactory.getEnv().initClusterEnvironment();
     AlignedWriteUtil.insertData();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
-    ConfigFactory.getConfig().setMaxNumberOfPointsInPage(numOfPointsPerPage);
-    ConfigFactory.getConfig().setMaxTsBlockLineNumber(maxTsBlockLineNumber);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 }
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedSeriesQuery3IT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedSeriesQuery3IT.java
index 6d7aa59e84..c9c3bfa26b 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedSeriesQuery3IT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedSeriesQuery3IT.java
@@ -19,7 +19,6 @@
 package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.db.it.utils.AlignedWriteUtil;
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -34,31 +33,30 @@ import org.junit.runner.RunWith;
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBAlignedSeriesQuery3IT extends IoTDBAlignedSeriesQueryIT {
 
-  private static int numOfPointsPerPage;
-
   @BeforeClass
   public static void setUp() throws Exception {
-    enableSeqSpaceCompaction = ConfigFactory.getConfig().isEnableSeqSpaceCompaction();
-    enableUnseqSpaceCompaction = ConfigFactory.getConfig().isEnableUnseqSpaceCompaction();
-    enableCrossSpaceCompaction = ConfigFactory.getConfig().isEnableCrossSpaceCompaction();
-    numOfPointsPerPage = ConfigFactory.getConfig().getMaxNumberOfPointsInPage();
-    maxTsBlockLineNumber = ConfigFactory.getConfig().getMaxTsBlockLineNumber();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(false);
-    ConfigFactory.getConfig().setMaxNumberOfPointsInPage(3);
-    ConfigFactory.getConfig().setMaxTsBlockLineNumber(3);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setMaxTsBlockLineNumber(3)
+        .setMaxNumberOfPointsInPage(3);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setMaxTsBlockLineNumber(3)
+        .setMaxNumberOfPointsInPage(3);
+    EnvFactory.getEnv().initClusterEnvironment();
     AlignedWriteUtil.insertData();
   }
 
   @AfterClass
   public static void tearDown() {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
-    ConfigFactory.getConfig().setMaxNumberOfPointsInPage(numOfPointsPerPage);
-    ConfigFactory.getConfig().setMaxTsBlockLineNumber(maxTsBlockLineNumber);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 }
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedSeriesQueryIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedSeriesQueryIT.java
index c24e03603b..e44f270a58 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedSeriesQueryIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedSeriesQueryIT.java
@@ -20,7 +20,6 @@ package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.db.it.utils.AlignedWriteUtil;
 import org.apache.iotdb.db.mpp.common.header.ColumnHeaderConstant;
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -60,32 +59,30 @@ import static org.junit.Assert.fail;
 public class IoTDBAlignedSeriesQueryIT {
 
   private static final double DELTA = 1e-6;
-  protected static boolean enableSeqSpaceCompaction;
-  protected static boolean enableUnseqSpaceCompaction;
-  protected static boolean enableCrossSpaceCompaction;
-  protected static int maxTsBlockLineNumber;
 
   @BeforeClass
   public static void setUp() throws Exception {
-    enableSeqSpaceCompaction = ConfigFactory.getConfig().isEnableSeqSpaceCompaction();
-    enableUnseqSpaceCompaction = ConfigFactory.getConfig().isEnableUnseqSpaceCompaction();
-    enableCrossSpaceCompaction = ConfigFactory.getConfig().isEnableCrossSpaceCompaction();
-    maxTsBlockLineNumber = ConfigFactory.getConfig().getMaxTsBlockLineNumber();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(false);
-    ConfigFactory.getConfig().setMaxTsBlockLineNumber(3);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setMaxTsBlockLineNumber(3);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setMaxTsBlockLineNumber(3);
+    EnvFactory.getEnv().initClusterEnvironment();
     AlignedWriteUtil.insertData();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
-    ConfigFactory.getConfig().setMaxTsBlockLineNumber(maxTsBlockLineNumber);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   // ------------------------------Raw Query Without Value Filter----------------------------------
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedSeriesQueryWithDeletionIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedSeriesQueryWithDeletionIT.java
index 5bace03811..6fc16caef4 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedSeriesQueryWithDeletionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBAlignedSeriesQueryWithDeletionIT.java
@@ -20,7 +20,6 @@
 package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.db.it.utils.AlignedWriteUtil;
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -48,22 +47,23 @@ import static org.junit.Assert.fail;
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBAlignedSeriesQueryWithDeletionIT {
 
-  protected static boolean enableSeqSpaceCompaction;
-  protected static boolean enableUnseqSpaceCompaction;
-  protected static boolean enableCrossSpaceCompaction;
-  protected static int maxTsBlockLineNumber;
-
   @BeforeClass
   public static void setUp() throws Exception {
-    enableSeqSpaceCompaction = ConfigFactory.getConfig().isEnableSeqSpaceCompaction();
-    enableUnseqSpaceCompaction = ConfigFactory.getConfig().isEnableUnseqSpaceCompaction();
-    enableCrossSpaceCompaction = ConfigFactory.getConfig().isEnableCrossSpaceCompaction();
-    maxTsBlockLineNumber = ConfigFactory.getConfig().getMaxTsBlockLineNumber();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(false);
-    ConfigFactory.getConfig().setMaxTsBlockLineNumber(3);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setMaxTsBlockLineNumber(3);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setMaxTsBlockLineNumber(3);
+    EnvFactory.getEnv().initClusterEnvironment();
     AlignedWriteUtil.insertData();
 
     try (Connection connection = EnvFactory.getEnv().getConnection();
@@ -77,11 +77,7 @@ public class IoTDBAlignedSeriesQueryWithDeletionIT {
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
-    ConfigFactory.getConfig().setMaxTsBlockLineNumber(maxTsBlockLineNumber);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBCountMultiTimesWithDeletionIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBCountMultiTimesWithDeletionIT.java
index 09f7a34e70..51ca2609d3 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBCountMultiTimesWithDeletionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBCountMultiTimesWithDeletionIT.java
@@ -18,7 +18,6 @@
  */
 package org.apache.iotdb.db.it.aligned;
 
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -46,22 +45,23 @@ import static org.junit.Assert.fail;
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBCountMultiTimesWithDeletionIT {
 
-  protected static boolean enableSeqSpaceCompaction;
-  protected static boolean enableUnseqSpaceCompaction;
-  protected static boolean enableCrossSpaceCompaction;
-  protected static int maxTsBlockLineNumber;
-
   @BeforeClass
   public static void setUp() throws Exception {
-    enableSeqSpaceCompaction = ConfigFactory.getConfig().isEnableSeqSpaceCompaction();
-    enableUnseqSpaceCompaction = ConfigFactory.getConfig().isEnableUnseqSpaceCompaction();
-    enableCrossSpaceCompaction = ConfigFactory.getConfig().isEnableCrossSpaceCompaction();
-    maxTsBlockLineNumber = ConfigFactory.getConfig().getMaxTsBlockLineNumber();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(false);
-    ConfigFactory.getConfig().setMaxTsBlockLineNumber(3);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setMaxTsBlockLineNumber(3);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setMaxTsBlockLineNumber(3);
+    EnvFactory.getEnv().initClusterEnvironment();
 
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
@@ -77,11 +77,7 @@ public class IoTDBCountMultiTimesWithDeletionIT {
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
-    ConfigFactory.getConfig().setMaxTsBlockLineNumber(maxTsBlockLineNumber);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBGroupByLevelQueryIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBGroupByLevelQueryIT.java
index a49168f137..b9dc8aeb97 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBGroupByLevelQueryIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBGroupByLevelQueryIT.java
@@ -19,7 +19,6 @@
 package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.db.it.utils.AlignedWriteUtil;
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -41,23 +40,23 @@ import static org.apache.iotdb.itbase.constant.TestConstant.NULL;
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBGroupByLevelQueryIT {
 
-  protected static boolean enableSeqSpaceCompaction;
-  protected static boolean enableUnseqSpaceCompaction;
-  protected static boolean enableCrossSpaceCompaction;
-  protected static int maxTsBlockLineNumber;
-
   @BeforeClass
   public static void setUp() throws Exception {
-    enableSeqSpaceCompaction = ConfigFactory.getConfig().isEnableSeqSpaceCompaction();
-    enableUnseqSpaceCompaction = ConfigFactory.getConfig().isEnableUnseqSpaceCompaction();
-    enableCrossSpaceCompaction = ConfigFactory.getConfig().isEnableCrossSpaceCompaction();
-    maxTsBlockLineNumber = ConfigFactory.getConfig().getMaxTsBlockLineNumber();
-
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(false);
-    ConfigFactory.getConfig().setMaxTsBlockLineNumber(3);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setMaxTsBlockLineNumber(3);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setMaxTsBlockLineNumber(3);
+    EnvFactory.getEnv().initClusterEnvironment();
 
     AlignedWriteUtil.insertData();
     try (Connection connection = EnvFactory.getEnv().getConnection();
@@ -91,11 +90,7 @@ public class IoTDBGroupByLevelQueryIT {
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
-    ConfigFactory.getConfig().setMaxTsBlockLineNumber(maxTsBlockLineNumber);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBGroupByQueryWithValueFilterWithDeletion2IT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBGroupByQueryWithValueFilterWithDeletion2IT.java
index 613a702e38..1ccd6cd570 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBGroupByQueryWithValueFilterWithDeletion2IT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBGroupByQueryWithValueFilterWithDeletion2IT.java
@@ -19,7 +19,6 @@
 package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.db.it.utils.AlignedWriteUtil;
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -38,22 +37,26 @@ import java.sql.Statement;
 public class IoTDBGroupByQueryWithValueFilterWithDeletion2IT
     extends IoTDBGroupByQueryWithValueFilterWithDeletionIT {
 
-  private static int numOfPointsPerPage;
-
   @BeforeClass
   public static void setUp() throws Exception {
-    enableSeqSpaceCompaction = ConfigFactory.getConfig().isEnableSeqSpaceCompaction();
-    enableUnseqSpaceCompaction = ConfigFactory.getConfig().isEnableUnseqSpaceCompaction();
-    enableCrossSpaceCompaction = ConfigFactory.getConfig().isEnableCrossSpaceCompaction();
-    numOfPointsPerPage = ConfigFactory.getConfig().getMaxNumberOfPointsInPage();
-    maxTsBlockLineNumber = ConfigFactory.getConfig().getMaxTsBlockLineNumber();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(false);
-    ConfigFactory.getConfig().setMaxNumberOfPointsInPage(3);
-    ConfigFactory.getConfig().setMaxTsBlockLineNumber(3);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setMaxTsBlockLineNumber(3)
+        .setMaxNumberOfPointsInPage(3);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setMaxTsBlockLineNumber(3)
+        .setMaxNumberOfPointsInPage(3);
 
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
 
     AlignedWriteUtil.insertData();
     try (Connection connection = EnvFactory.getEnv().getConnection();
@@ -67,11 +70,6 @@ public class IoTDBGroupByQueryWithValueFilterWithDeletion2IT
 
   @AfterClass
   public static void tearDown() throws Exception {
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
-    ConfigFactory.getConfig().setMaxNumberOfPointsInPage(numOfPointsPerPage);
-    ConfigFactory.getConfig().setMaxTsBlockLineNumber(maxTsBlockLineNumber);
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 }
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBGroupByQueryWithValueFilterWithDeletionIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBGroupByQueryWithValueFilterWithDeletionIT.java
index 67c85094e8..ff0a30109a 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBGroupByQueryWithValueFilterWithDeletionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBGroupByQueryWithValueFilterWithDeletionIT.java
@@ -19,7 +19,6 @@
 package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.db.it.utils.AlignedWriteUtil;
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -50,23 +49,24 @@ import static org.apache.iotdb.itbase.constant.TestConstant.TIMESTAMP_STR;
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBGroupByQueryWithValueFilterWithDeletionIT {
 
-  protected static boolean enableSeqSpaceCompaction;
-  protected static boolean enableUnseqSpaceCompaction;
-  protected static boolean enableCrossSpaceCompaction;
-  protected static int maxTsBlockLineNumber;
-
   @BeforeClass
   public static void setUp() throws Exception {
-    enableSeqSpaceCompaction = ConfigFactory.getConfig().isEnableSeqSpaceCompaction();
-    enableUnseqSpaceCompaction = ConfigFactory.getConfig().isEnableUnseqSpaceCompaction();
-    enableCrossSpaceCompaction = ConfigFactory.getConfig().isEnableCrossSpaceCompaction();
-    maxTsBlockLineNumber = ConfigFactory.getConfig().getMaxTsBlockLineNumber();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(false);
-    ConfigFactory.getConfig().setMaxTsBlockLineNumber(3);
-
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setMaxTsBlockLineNumber(3);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setMaxTsBlockLineNumber(3);
+
+    EnvFactory.getEnv().initClusterEnvironment();
 
     AlignedWriteUtil.insertData();
     try (Connection connection = EnvFactory.getEnv().getConnection();
@@ -80,11 +80,7 @@ public class IoTDBGroupByQueryWithValueFilterWithDeletionIT {
 
   @AfterClass
   public static void tearDown() throws Exception {
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
-    ConfigFactory.getConfig().setMaxTsBlockLineNumber(maxTsBlockLineNumber);
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBGroupByQueryWithoutValueFilterWithDeletion2IT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBGroupByQueryWithoutValueFilterWithDeletion2IT.java
index 928b604f62..11d4eef69a 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBGroupByQueryWithoutValueFilterWithDeletion2IT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBGroupByQueryWithoutValueFilterWithDeletion2IT.java
@@ -19,7 +19,6 @@
 package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.db.it.utils.AlignedWriteUtil;
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -38,22 +37,25 @@ import java.sql.Statement;
 public class IoTDBGroupByQueryWithoutValueFilterWithDeletion2IT
     extends IoTDBGroupByQueryWithoutValueFilterWithDeletionIT {
 
-  private static int numOfPointsPerPage;
-
   @BeforeClass
   public static void setUp() throws Exception {
-    enableSeqSpaceCompaction = ConfigFactory.getConfig().isEnableSeqSpaceCompaction();
-    enableUnseqSpaceCompaction = ConfigFactory.getConfig().isEnableUnseqSpaceCompaction();
-    enableCrossSpaceCompaction = ConfigFactory.getConfig().isEnableCrossSpaceCompaction();
-    numOfPointsPerPage = ConfigFactory.getConfig().getMaxNumberOfPointsInPage();
-    maxTsBlockLineNumber = ConfigFactory.getConfig().getMaxTsBlockLineNumber();
-
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(false);
-    ConfigFactory.getConfig().setMaxNumberOfPointsInPage(3);
-    ConfigFactory.getConfig().setMaxTsBlockLineNumber(3);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setMaxTsBlockLineNumber(3)
+        .setMaxNumberOfPointsInPage(3);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setMaxTsBlockLineNumber(3)
+        .setMaxNumberOfPointsInPage(3);
+    EnvFactory.getEnv().initClusterEnvironment();
     AlignedWriteUtil.insertData();
 
     try (Connection connection = EnvFactory.getEnv().getConnection();
@@ -68,11 +70,6 @@ public class IoTDBGroupByQueryWithoutValueFilterWithDeletion2IT
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
-    ConfigFactory.getConfig().setMaxNumberOfPointsInPage(numOfPointsPerPage);
-    ConfigFactory.getConfig().setMaxTsBlockLineNumber(maxTsBlockLineNumber);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 }
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBGroupByQueryWithoutValueFilterWithDeletionIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBGroupByQueryWithoutValueFilterWithDeletionIT.java
index e7c69f4523..b177ce4ac6 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBGroupByQueryWithoutValueFilterWithDeletionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBGroupByQueryWithoutValueFilterWithDeletionIT.java
@@ -19,7 +19,6 @@
 package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.db.it.utils.AlignedWriteUtil;
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -49,25 +48,25 @@ import static org.apache.iotdb.db.constant.TestConstant.minValue;
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBGroupByQueryWithoutValueFilterWithDeletionIT {
 
-  protected static boolean enableSeqSpaceCompaction;
-  protected static boolean enableUnseqSpaceCompaction;
-  protected static boolean enableCrossSpaceCompaction;
-  protected static long prevPartitionInterval;
-  protected static int maxTsBlockLineNumber;
-
   private static final String TIMESTAMP_STR = "Time";
 
   @BeforeClass
   public static void setUp() throws Exception {
-    enableSeqSpaceCompaction = ConfigFactory.getConfig().isEnableSeqSpaceCompaction();
-    enableUnseqSpaceCompaction = ConfigFactory.getConfig().isEnableUnseqSpaceCompaction();
-    enableCrossSpaceCompaction = ConfigFactory.getConfig().isEnableCrossSpaceCompaction();
-    maxTsBlockLineNumber = ConfigFactory.getConfig().getMaxTsBlockLineNumber();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(false);
-    ConfigFactory.getConfig().setMaxTsBlockLineNumber(3);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setMaxTsBlockLineNumber(3);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setMaxTsBlockLineNumber(3);
+    EnvFactory.getEnv().initClusterEnvironment();
     AlignedWriteUtil.insertData();
 
     try (Connection connection = EnvFactory.getEnv().getConnection();
@@ -82,12 +81,7 @@ public class IoTDBGroupByQueryWithoutValueFilterWithDeletionIT {
 
   @AfterClass
   public static void tearDown() throws Exception {
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
-    ConfigFactory.getConfig().setPartitionInterval(prevPartitionInterval);
-    ConfigFactory.getConfig().setMaxTsBlockLineNumber(maxTsBlockLineNumber);
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValues2IT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValues2IT.java
index 7e2a0a4fb4..23f5c8743e 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValues2IT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValues2IT.java
@@ -18,7 +18,6 @@
  */
 package org.apache.iotdb.db.it.aligned;
 
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -40,23 +39,25 @@ import static org.junit.Assert.assertEquals;
 @RunWith(IoTDBTestRunner.class)
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBInsertAlignedValues2IT {
-  private int numOfPointsPerPage;
-  private boolean autoCreateSchemaEnabled;
 
   @Before
   public void setUp() throws Exception {
-    numOfPointsPerPage = ConfigFactory.getConfig().getMaxNumberOfPointsInPage();
-    autoCreateSchemaEnabled = ConfigFactory.getConfig().isAutoCreateSchemaEnabled();
-    ConfigFactory.getConfig().setAutoCreateSchemaEnabled(true);
-    ConfigFactory.getConfig().setMaxNumberOfPointsInPage(2);
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setAutoCreateSchemaEnabled(true)
+        .setMaxNumberOfPointsInPage(2);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setAutoCreateSchemaEnabled(true)
+        .setMaxNumberOfPointsInPage(2);
+    EnvFactory.getEnv().initClusterEnvironment();
   }
 
   @After
   public void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterTest();
-    ConfigFactory.getConfig().setAutoCreateSchemaEnabled(autoCreateSchemaEnabled);
-    ConfigFactory.getConfig().setMaxNumberOfPointsInPage(numOfPointsPerPage);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValues3IT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValues3IT.java
index 3d49a998ae..e177faea06 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValues3IT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValues3IT.java
@@ -18,7 +18,6 @@
  */
 package org.apache.iotdb.db.it.aligned;
 
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -40,23 +39,25 @@ import static org.junit.Assert.assertEquals;
 @RunWith(IoTDBTestRunner.class)
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBInsertAlignedValues3IT {
-  private int numOfPointsPerPage;
-  private boolean autoCreateSchemaEnabled;
 
   @Before
   public void setUp() throws Exception {
-    numOfPointsPerPage = ConfigFactory.getConfig().getMaxNumberOfPointsInPage();
-    autoCreateSchemaEnabled = ConfigFactory.getConfig().isAutoCreateSchemaEnabled();
-    ConfigFactory.getConfig().setAutoCreateSchemaEnabled(true);
-    ConfigFactory.getConfig().setMaxNumberOfPointsInPage(4);
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setAutoCreateSchemaEnabled(true)
+        .setMaxNumberOfPointsInPage(4);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setAutoCreateSchemaEnabled(true)
+        .setMaxNumberOfPointsInPage(4);
+    EnvFactory.getEnv().initClusterEnvironment();
   }
 
   @After
   public void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterTest();
-    ConfigFactory.getConfig().setAutoCreateSchemaEnabled(autoCreateSchemaEnabled);
-    ConfigFactory.getConfig().setMaxNumberOfPointsInPage(numOfPointsPerPage);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValues4IT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValues4IT.java
index cfdad3529d..9157f647eb 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValues4IT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValues4IT.java
@@ -18,7 +18,6 @@
  */
 package org.apache.iotdb.db.it.aligned;
 
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -39,23 +38,25 @@ import static org.junit.Assert.fail;
 @RunWith(IoTDBTestRunner.class)
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBInsertAlignedValues4IT {
-  private boolean autoCreateSchemaEnabled;
-  private int primitiveArraySize;
 
   @Before
   public void setUp() throws Exception {
-    autoCreateSchemaEnabled = ConfigFactory.getConfig().isAutoCreateSchemaEnabled();
-    primitiveArraySize = ConfigFactory.getConfig().getPrimitiveArraySize();
-    ConfigFactory.getConfig().setAutoCreateSchemaEnabled(true);
-    ConfigFactory.getConfig().setPrimitiveArraySize(2);
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setAutoCreateSchemaEnabled(true)
+        .setPrimitiveArraySize(2);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setAutoCreateSchemaEnabled(true)
+        .setPrimitiveArraySize(2);
+    EnvFactory.getEnv().initClusterEnvironment();
   }
 
   @After
   public void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterTest();
-    ConfigFactory.getConfig().setAutoCreateSchemaEnabled(autoCreateSchemaEnabled);
-    ConfigFactory.getConfig().setPrimitiveArraySize(primitiveArraySize);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValuesIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValuesIT.java
index 7b4b5eab56..2f831c283d 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValuesIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBInsertAlignedValuesIT.java
@@ -19,7 +19,6 @@
 
 package org.apache.iotdb.db.it.aligned;
 
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -45,19 +44,17 @@ import static org.junit.Assert.fail;
 @RunWith(IoTDBTestRunner.class)
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBInsertAlignedValuesIT {
-  private boolean autoCreateSchemaEnabled;
 
   @Before
   public void setUp() throws Exception {
-    autoCreateSchemaEnabled = ConfigFactory.getConfig().isAutoCreateSchemaEnabled();
-    ConfigFactory.getConfig().setAutoCreateSchemaEnabled(true);
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv().getConfig().getConfigNodeCommonConfig().setAutoCreateSchemaEnabled(true);
+    EnvFactory.getEnv().getConfig().getDataNodeCommonConfig().setAutoCreateSchemaEnabled(true);
+    EnvFactory.getEnv().initClusterEnvironment();
   }
 
   @After
   public void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterTest();
-    ConfigFactory.getConfig().setAutoCreateSchemaEnabled(autoCreateSchemaEnabled);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithDeletion2IT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithDeletion2IT.java
index 129084e987..ad831bd64d 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithDeletion2IT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithDeletion2IT.java
@@ -19,7 +19,6 @@
 package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.db.it.utils.AlignedWriteUtil;
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -39,20 +38,23 @@ import static org.junit.Assert.fail;
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBLastQueryWithDeletion2IT extends IoTDBLastQueryWithDeletionIT {
 
-  private static int numOfPointsPerPage;
-
   @BeforeClass
   public static void setUp() throws Exception {
-    enableSeqSpaceCompaction = ConfigFactory.getConfig().isEnableSeqSpaceCompaction();
-    enableUnseqSpaceCompaction = ConfigFactory.getConfig().isEnableUnseqSpaceCompaction();
-    enableCrossSpaceCompaction = ConfigFactory.getConfig().isEnableCrossSpaceCompaction();
-    numOfPointsPerPage = ConfigFactory.getConfig().getMaxNumberOfPointsInPage();
-
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(false);
-    ConfigFactory.getConfig().setMaxNumberOfPointsInPage(3);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setMaxNumberOfPointsInPage(3);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setMaxNumberOfPointsInPage(3);
+    EnvFactory.getEnv().initClusterEnvironment();
     AlignedWriteUtil.insertData();
 
     try (Connection connection = EnvFactory.getEnv().getConnection();
@@ -67,10 +69,6 @@ public class IoTDBLastQueryWithDeletion2IT extends IoTDBLastQueryWithDeletionIT
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
-    ConfigFactory.getConfig().setMaxNumberOfPointsInPage(numOfPointsPerPage);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 }
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithDeletionIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithDeletionIT.java
index bf7c2419e9..d843db8ae1 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithDeletionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithDeletionIT.java
@@ -19,7 +19,6 @@
 package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.db.it.utils.AlignedWriteUtil;
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -52,19 +51,21 @@ import static org.junit.Assert.fail;
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBLastQueryWithDeletionIT {
 
-  protected static boolean enableSeqSpaceCompaction;
-  protected static boolean enableUnseqSpaceCompaction;
-  protected static boolean enableCrossSpaceCompaction;
-
   @BeforeClass
   public static void setUp() throws Exception {
-    enableSeqSpaceCompaction = ConfigFactory.getConfig().isEnableSeqSpaceCompaction();
-    enableUnseqSpaceCompaction = ConfigFactory.getConfig().isEnableUnseqSpaceCompaction();
-    enableCrossSpaceCompaction = ConfigFactory.getConfig().isEnableCrossSpaceCompaction();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(false);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false);
+    EnvFactory.getEnv().initClusterEnvironment();
     AlignedWriteUtil.insertData();
 
     try (Connection connection = EnvFactory.getEnv().getConnection();
@@ -79,10 +80,7 @@ public class IoTDBLastQueryWithDeletionIT {
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCache2IT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCache2IT.java
index ab872c93aa..2f95a90f22 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCache2IT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCache2IT.java
@@ -19,7 +19,6 @@
 package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.db.it.utils.AlignedWriteUtil;
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -34,31 +33,30 @@ import org.junit.runner.RunWith;
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBLastQueryWithoutLastCache2IT extends IoTDBLastQueryWithoutLastCacheIT {
 
-  private static int numOfPointsPerPage;
-
   @BeforeClass
   public static void setUp() throws Exception {
-    enableSeqSpaceCompaction = ConfigFactory.getConfig().isEnableSeqSpaceCompaction();
-    enableUnseqSpaceCompaction = ConfigFactory.getConfig().isEnableUnseqSpaceCompaction();
-    enableCrossSpaceCompaction = ConfigFactory.getConfig().isEnableCrossSpaceCompaction();
-    enableLastCache = ConfigFactory.getConfig().isLastCacheEnabled();
-    numOfPointsPerPage = ConfigFactory.getConfig().getMaxNumberOfPointsInPage();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableLastCache(false);
-    ConfigFactory.getConfig().setMaxNumberOfPointsInPage(3);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setEnableLastCache(false)
+        .setMaxNumberOfPointsInPage(3);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setEnableLastCache(false)
+        .setMaxNumberOfPointsInPage(3);
+    EnvFactory.getEnv().initClusterEnvironment();
     AlignedWriteUtil.insertData();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
-    ConfigFactory.getConfig().setEnableLastCache(enableLastCache);
-    ConfigFactory.getConfig().setMaxNumberOfPointsInPage(numOfPointsPerPage);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 }
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCacheIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCacheIT.java
index ac7a3df6f4..97580c1c92 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCacheIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCacheIT.java
@@ -19,7 +19,6 @@
 package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.db.it.utils.AlignedWriteUtil;
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -52,32 +51,29 @@ import static org.junit.Assert.fail;
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBLastQueryWithoutLastCacheIT {
 
-  protected static boolean enableSeqSpaceCompaction;
-  protected static boolean enableUnseqSpaceCompaction;
-  protected static boolean enableCrossSpaceCompaction;
-  protected static boolean enableLastCache;
-
   @BeforeClass
   public static void setUp() throws Exception {
-    enableSeqSpaceCompaction = ConfigFactory.getConfig().isEnableSeqSpaceCompaction();
-    enableUnseqSpaceCompaction = ConfigFactory.getConfig().isEnableUnseqSpaceCompaction();
-    enableCrossSpaceCompaction = ConfigFactory.getConfig().isEnableCrossSpaceCompaction();
-    enableLastCache = ConfigFactory.getConfig().isLastCacheEnabled();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableLastCache(false);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setEnableLastCache(false);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setEnableLastCache(false);
+    EnvFactory.getEnv().initClusterEnvironment();
     AlignedWriteUtil.insertData();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
-    ConfigFactory.getConfig().setEnableLastCache(enableLastCache);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCacheWithDeletion2IT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCacheWithDeletion2IT.java
index 1a59ae8bdf..2c457e0bed 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCacheWithDeletion2IT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCacheWithDeletion2IT.java
@@ -19,7 +19,6 @@
 package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.db.it.utils.AlignedWriteUtil;
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -40,22 +39,26 @@ import static org.junit.Assert.fail;
 public class IoTDBLastQueryWithoutLastCacheWithDeletion2IT
     extends IoTDBLastQueryWithoutLastCacheWithDeletionIT {
 
-  private static int numOfPointsPerPage;
-
   @BeforeClass
   public static void setUp() throws Exception {
 
-    enableSeqSpaceCompaction = ConfigFactory.getConfig().isEnableSeqSpaceCompaction();
-    enableUnseqSpaceCompaction = ConfigFactory.getConfig().isEnableUnseqSpaceCompaction();
-    enableCrossSpaceCompaction = ConfigFactory.getConfig().isEnableCrossSpaceCompaction();
-    enableLastCache = ConfigFactory.getConfig().isLastCacheEnabled();
-    numOfPointsPerPage = ConfigFactory.getConfig().getMaxNumberOfPointsInPage();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableLastCache(false);
-    ConfigFactory.getConfig().setMaxNumberOfPointsInPage(3);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setEnableLastCache(false)
+        .setMaxNumberOfPointsInPage(3);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setEnableLastCache(false)
+        .setMaxNumberOfPointsInPage(3);
+    EnvFactory.getEnv().initClusterEnvironment();
     AlignedWriteUtil.insertData();
 
     try (Connection connection = EnvFactory.getEnv().getConnection();
@@ -70,11 +73,6 @@ public class IoTDBLastQueryWithoutLastCacheWithDeletion2IT
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
-    ConfigFactory.getConfig().setEnableLastCache(enableLastCache);
-    ConfigFactory.getConfig().setMaxNumberOfPointsInPage(numOfPointsPerPage);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 }
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCacheWithDeletionIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCacheWithDeletionIT.java
index 9de6222ba9..7d5b269b88 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCacheWithDeletionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBLastQueryWithoutLastCacheWithDeletionIT.java
@@ -19,7 +19,6 @@
 package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.db.it.utils.AlignedWriteUtil;
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -39,23 +38,24 @@ import static org.junit.Assert.fail;
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBLastQueryWithoutLastCacheWithDeletionIT extends IoTDBLastQueryWithDeletionIT {
 
-  protected static boolean enableSeqSpaceCompaction;
-  protected static boolean enableUnseqSpaceCompaction;
-  protected static boolean enableCrossSpaceCompaction;
-  protected static boolean enableLastCache;
-
   @BeforeClass
   public static void setUp() throws Exception {
 
-    enableSeqSpaceCompaction = ConfigFactory.getConfig().isEnableSeqSpaceCompaction();
-    enableUnseqSpaceCompaction = ConfigFactory.getConfig().isEnableUnseqSpaceCompaction();
-    enableCrossSpaceCompaction = ConfigFactory.getConfig().isEnableCrossSpaceCompaction();
-    enableLastCache = ConfigFactory.getConfig().isLastCacheEnabled();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableLastCache(false);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setEnableLastCache(false);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setEnableLastCache(false);
+    EnvFactory.getEnv().initClusterEnvironment();
     AlignedWriteUtil.insertData();
 
     try (Connection connection = EnvFactory.getEnv().getConnection();
@@ -70,10 +70,6 @@ public class IoTDBLastQueryWithoutLastCacheWithDeletionIT extends IoTDBLastQuery
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
-    ConfigFactory.getConfig().setEnableLastCache(enableLastCache);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 }
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBRawQueryWithoutValueFilterWithDeletion2IT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBRawQueryWithoutValueFilterWithDeletion2IT.java
index 5352b9c508..c2faf5c252 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBRawQueryWithoutValueFilterWithDeletion2IT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBRawQueryWithoutValueFilterWithDeletion2IT.java
@@ -19,7 +19,6 @@
 package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.db.it.utils.AlignedWriteUtil;
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -41,20 +40,23 @@ import static org.junit.Assert.fail;
 public class IoTDBRawQueryWithoutValueFilterWithDeletion2IT
     extends IoTDBRawQueryWithoutValueFilterWithDeletionIT {
 
-  private static int numOfPointsPerPage;
-
   @BeforeClass
   public static void setUp() throws Exception {
-    enableSeqSpaceCompaction = ConfigFactory.getConfig().isEnableSeqSpaceCompaction();
-    enableUnseqSpaceCompaction = ConfigFactory.getConfig().isEnableUnseqSpaceCompaction();
-    enableCrossSpaceCompaction = ConfigFactory.getConfig().isEnableCrossSpaceCompaction();
-    numOfPointsPerPage = ConfigFactory.getConfig().getMaxNumberOfPointsInPage();
-
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(false);
-    ConfigFactory.getConfig().setMaxNumberOfPointsInPage(3);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setMaxNumberOfPointsInPage(3);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setMaxNumberOfPointsInPage(3);
+    EnvFactory.getEnv().initClusterEnvironment();
     AlignedWriteUtil.insertData();
 
     try (Connection connection = EnvFactory.getEnv().getConnection();
@@ -71,10 +73,6 @@ public class IoTDBRawQueryWithoutValueFilterWithDeletion2IT
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
-    ConfigFactory.getConfig().setMaxNumberOfPointsInPage(numOfPointsPerPage);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 }
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBRawQueryWithoutValueFilterWithDeletionIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBRawQueryWithoutValueFilterWithDeletionIT.java
index 75c979a78c..042302cb12 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBRawQueryWithoutValueFilterWithDeletionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/aligned/IoTDBRawQueryWithoutValueFilterWithDeletionIT.java
@@ -19,7 +19,6 @@
 package org.apache.iotdb.db.it.aligned;
 
 import org.apache.iotdb.db.it.utils.AlignedWriteUtil;
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -46,19 +45,21 @@ import static org.junit.Assert.fail;
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBRawQueryWithoutValueFilterWithDeletionIT {
 
-  protected static boolean enableSeqSpaceCompaction;
-  protected static boolean enableUnseqSpaceCompaction;
-  protected static boolean enableCrossSpaceCompaction;
-
   @BeforeClass
   public static void setUp() throws Exception {
-    enableSeqSpaceCompaction = ConfigFactory.getConfig().isEnableSeqSpaceCompaction();
-    enableUnseqSpaceCompaction = ConfigFactory.getConfig().isEnableUnseqSpaceCompaction();
-    enableCrossSpaceCompaction = ConfigFactory.getConfig().isEnableCrossSpaceCompaction();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(false);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false);
+    EnvFactory.getEnv().initClusterEnvironment();
     AlignedWriteUtil.insertData();
 
     try (Connection connection = EnvFactory.getEnv().getConnection();
@@ -75,10 +76,7 @@ public class IoTDBRawQueryWithoutValueFilterWithDeletionIT {
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/cq/IoTDBCQExecIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/cq/IoTDBCQExecIT.java
index 5c014bc444..cdc03dcc89 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/cq/IoTDBCQExecIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/cq/IoTDBCQExecIT.java
@@ -44,12 +44,12 @@ public class IoTDBCQExecIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/cq/IoTDBCQIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/cq/IoTDBCQIT.java
index b03ddec6f1..1168efd62b 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/cq/IoTDBCQIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/cq/IoTDBCQIT.java
@@ -44,12 +44,12 @@ public class IoTDBCQIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   // =======================================create cq======================================
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/env/StandaloneEnv.java b/integration-test/src/test/java/org/apache/iotdb/db/it/env/StandaloneEnv.java
deleted file mode 100644
index cc2d22822b..0000000000
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/env/StandaloneEnv.java
+++ /dev/null
@@ -1,275 +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.
- */
-package org.apache.iotdb.db.it.env;
-
-import org.apache.iotdb.confignode.rpc.thrift.IConfigNodeRPCService;
-import org.apache.iotdb.db.utils.EnvironmentUtils;
-import org.apache.iotdb.isession.ISession;
-import org.apache.iotdb.isession.SessionConfig;
-import org.apache.iotdb.isession.util.Version;
-import org.apache.iotdb.it.env.ConfigNodeWrapper;
-import org.apache.iotdb.it.env.DataNodeWrapper;
-import org.apache.iotdb.itbase.env.BaseEnv;
-import org.apache.iotdb.jdbc.Config;
-import org.apache.iotdb.jdbc.Constant;
-import org.apache.iotdb.rpc.IoTDBConnectionException;
-import org.apache.iotdb.session.Session;
-
-import java.io.IOException;
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.SQLException;
-import java.time.ZoneId;
-import java.util.List;
-
-import static org.apache.iotdb.jdbc.Config.VERSION;
-import static org.junit.Assert.fail;
-
-/** This class is used by EnvFactory with using reflection. */
-public class StandaloneEnv implements BaseEnv {
-
-  @Override
-  public void initBeforeClass() {
-    EnvironmentUtils.envSetUp();
-  }
-
-  @Override
-  public void initClusterEnvironment(int configNodesNum, int dataNodesNum) {
-    // Do nothing
-  }
-
-  @Override
-  public void cleanAfterClass() {
-    cleanAfterTest();
-  }
-
-  @Override
-  public void initBeforeTest() {
-    EnvironmentUtils.envSetUp();
-  }
-
-  @Override
-  public void cleanAfterTest() {
-    try {
-      EnvironmentUtils.cleanEnv();
-    } catch (Exception e) {
-      e.printStackTrace();
-      System.exit(-1);
-    }
-  }
-
-  @Override
-  public Connection getConnection(String username, String password) throws SQLException {
-    try {
-      Class.forName(Config.JDBC_DRIVER_NAME);
-      return DriverManager.getConnection(
-          Config.IOTDB_URL_PREFIX + "127.0.0.1:6667/", username, password);
-    } catch (ClassNotFoundException e) {
-      e.printStackTrace();
-      fail();
-    }
-    return null;
-  }
-
-  @Override
-  public Connection getConnection(Constant.Version version, String username, String password)
-      throws SQLException {
-    try {
-      Class.forName(Config.JDBC_DRIVER_NAME);
-      return DriverManager.getConnection(
-          Config.IOTDB_URL_PREFIX + "127.0.0.1:6667" + "?" + VERSION + "=" + version.toString(),
-          username,
-          password);
-    } catch (ClassNotFoundException e) {
-      e.printStackTrace();
-      fail();
-    }
-    return null;
-  }
-
-  public void setTestMethodName(String testCaseName) {
-    // Do nothing
-  }
-
-  public void dumpTestJVMSnapshot() {
-    // Do nothing
-  }
-
-  @Override
-  public List<ConfigNodeWrapper> getConfigNodeWrapperList() {
-    return null;
-  }
-
-  @Override
-  public void setConfigNodeWrapperList(List<ConfigNodeWrapper> configNodeWrapperList) {
-    // Do nothing
-  }
-
-  @Override
-  public List<DataNodeWrapper> getDataNodeWrapperList() {
-    return null;
-  }
-
-  @Override
-  public void setDataNodeWrapperList(List<DataNodeWrapper> dataNodeWrapperList) {
-    // Do nothing
-  }
-
-  @Override
-  public IConfigNodeRPCService.Iface getLeaderConfigNodeConnection() {
-    return null;
-  }
-
-  @Override
-  public ISession getSessionConnection() throws IoTDBConnectionException {
-    Session session =
-        new Session(
-            SessionConfig.DEFAULT_HOST,
-            SessionConfig.DEFAULT_PORT,
-            SessionConfig.DEFAULT_USER,
-            SessionConfig.DEFAULT_PASSWORD);
-    session.open();
-    return session;
-  }
-
-  @Override
-  public ISession getSessionConnection(
-      String host,
-      int rpcPort,
-      String username,
-      String password,
-      int fetchSize,
-      ZoneId zoneId,
-      int thriftDefaultBufferSize,
-      int thriftMaxFrameSize,
-      boolean enableRedirection,
-      Version version)
-      throws IoTDBConnectionException {
-    Session session =
-        new Session(
-            host,
-            rpcPort,
-            username,
-            password,
-            fetchSize,
-            zoneId,
-            thriftDefaultBufferSize,
-            thriftMaxFrameSize,
-            enableRedirection,
-            version);
-
-    session.open();
-    return session;
-  }
-
-  @Override
-  public int getLeaderConfigNodeIndex() throws IOException {
-    return -1;
-  }
-
-  @Override
-  public void startConfigNode(int index) {
-    throw new UnsupportedOperationException();
-  }
-
-  @Override
-  public void shutdownConfigNode(int index) {
-    throw new UnsupportedOperationException();
-  }
-
-  @Override
-  public ConfigNodeWrapper generateRandomConfigNodeWrapper() {
-    throw new UnsupportedOperationException();
-  }
-
-  @Override
-  public DataNodeWrapper generateRandomDataNodeWrapper() {
-    throw new UnsupportedOperationException();
-  }
-
-  @Override
-  public ConfigNodeWrapper getConfigNodeWrapper(int index) {
-    throw new UnsupportedOperationException();
-  }
-
-  @Override
-  public DataNodeWrapper getDataNodeWrapper(int index) {
-    throw new UnsupportedOperationException();
-  }
-
-  @Override
-  public void registerNewDataNode(boolean isNeedVerify) {
-    throw new UnsupportedOperationException();
-  }
-
-  @Override
-  public void registerNewConfigNode(boolean isNeedVerify) {
-    throw new UnsupportedOperationException();
-  }
-
-  @Override
-  public void registerNewDataNode(DataNodeWrapper newDataNodeWrapper, boolean isNeedVerify) {
-    throw new UnsupportedOperationException();
-  }
-
-  @Override
-  public void registerNewConfigNode(ConfigNodeWrapper newConfigNodeWrapper, boolean isNeedVerify) {
-    throw new UnsupportedOperationException();
-  }
-
-  @Override
-  public void startDataNode(int index) {
-    throw new UnsupportedOperationException();
-  }
-
-  @Override
-  public void shutdownDataNode(int index) {
-    throw new UnsupportedOperationException();
-  }
-
-  @Override
-  public int getMqttPort() {
-    return 1883;
-  }
-
-  @Override
-  public String getIP() {
-    return "127.0.0.1";
-  }
-
-  @Override
-  public String getPort() {
-    return "6667";
-  }
-
-  @Override
-  public String getSbinPath() {
-    throw new UnsupportedOperationException();
-  }
-
-  @Override
-  public String getToolsPath() {
-    throw new UnsupportedOperationException();
-  }
-
-  @Override
-  public String getLibPath() {
-    throw new UnsupportedOperationException();
-  }
-}
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/env/StandaloneEnvConfig.java b/integration-test/src/test/java/org/apache/iotdb/db/it/env/StandaloneEnvConfig.java
deleted file mode 100644
index bb6aff4fb0..0000000000
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/env/StandaloneEnvConfig.java
+++ /dev/null
@@ -1,354 +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.
- */
-package org.apache.iotdb.db.it.env;
-
-import org.apache.iotdb.db.conf.IoTDBDescriptor;
-import org.apache.iotdb.itbase.env.BaseConfig;
-import org.apache.iotdb.tsfile.common.conf.TSFileDescriptor;
-
-/** This class is used by ConfigFactory with using reflection. */
-public class StandaloneEnvConfig implements BaseConfig {
-
-  @Override
-  public BaseConfig setMaxNumberOfPointsInPage(int maxNumberOfPointsInPage) {
-    TSFileDescriptor.getInstance().getConfig().setMaxNumberOfPointsInPage(maxNumberOfPointsInPage);
-    return this;
-  }
-
-  @Override
-  public BaseConfig setPageSizeInByte(int pageSizeInByte) {
-    TSFileDescriptor.getInstance().getConfig().setPageSizeInByte(pageSizeInByte);
-    return this;
-  }
-
-  @Override
-  public BaseConfig setGroupSizeInByte(int groupSizeInByte) {
-    TSFileDescriptor.getInstance().getConfig().setGroupSizeInByte(groupSizeInByte);
-    return this;
-  }
-
-  @Override
-  public BaseConfig setMemtableSizeThreshold(long memtableSizeThreshold) {
-    IoTDBDescriptor.getInstance().getConfig().setMemtableSizeThreshold(memtableSizeThreshold);
-    return this;
-  }
-
-  @Override
-  public int getDataRegionNum() {
-    return IoTDBDescriptor.getInstance().getConfig().getDataRegionNum();
-  }
-
-  @Override
-  public BaseConfig setDataRegionNum(int dataRegionNum) {
-    IoTDBDescriptor.getInstance().getConfig().setDataRegionNum(dataRegionNum);
-    return this;
-  }
-
-  @Override
-  public BaseConfig setPartitionInterval(long partitionInterval) {
-    IoTDBDescriptor.getInstance().getConfig().setTimePartitionInterval(partitionInterval);
-    return this;
-  }
-
-  @Override
-  public long getPartitionInterval() {
-    return IoTDBDescriptor.getInstance().getConfig().getTimePartitionInterval();
-  }
-
-  @Override
-  public BaseConfig setCompressor(String compressor) {
-    TSFileDescriptor.getInstance().getConfig().setCompressor(compressor);
-    return this;
-  }
-
-  @Override
-  public BaseConfig setMaxQueryDeduplicatedPathNum(int maxQueryDeduplicatedPathNum) {
-    IoTDBDescriptor.getInstance()
-        .getConfig()
-        .setMaxQueryDeduplicatedPathNum(maxQueryDeduplicatedPathNum);
-    return this;
-  }
-
-  @Override
-  public BaseConfig setRpcThriftCompressionEnable(boolean rpcThriftCompressionEnable) {
-    IoTDBDescriptor.getInstance()
-        .getConfig()
-        .setRpcThriftCompressionEnable(rpcThriftCompressionEnable);
-    return this;
-  }
-
-  @Override
-  public BaseConfig setRpcAdvancedCompressionEnable(boolean rpcAdvancedCompressionEnable) {
-    IoTDBDescriptor.getInstance()
-        .getConfig()
-        .setRpcAdvancedCompressionEnable(rpcAdvancedCompressionEnable);
-    return this;
-  }
-
-  @Override
-  public BaseConfig setUdfCollectorMemoryBudgetInMB(float udfCollectorMemoryBudgetInMB) {
-    IoTDBDescriptor.getInstance()
-        .getConfig()
-        .setUdfCollectorMemoryBudgetInMB(udfCollectorMemoryBudgetInMB);
-    return this;
-  }
-
-  @Override
-  public BaseConfig setUdfTransformerMemoryBudgetInMB(float udfTransformerMemoryBudgetInMB) {
-    IoTDBDescriptor.getInstance()
-        .getConfig()
-        .setUdfTransformerMemoryBudgetInMB(udfTransformerMemoryBudgetInMB);
-    return this;
-  }
-
-  @Override
-  public BaseConfig setUdfReaderMemoryBudgetInMB(float udfReaderMemoryBudgetInMB) {
-    IoTDBDescriptor.getInstance()
-        .getConfig()
-        .setUdfReaderMemoryBudgetInMB(udfReaderMemoryBudgetInMB);
-    return this;
-  }
-
-  @Override
-  public BaseConfig setEnableSeqSpaceCompaction(boolean enableSeqSpaceCompaction) {
-    IoTDBDescriptor.getInstance().getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
-    return this;
-  }
-
-  @Override
-  public BaseConfig setEnableUnseqSpaceCompaction(boolean enableUnseqSpaceCompaction) {
-    IoTDBDescriptor.getInstance()
-        .getConfig()
-        .setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
-    return this;
-  }
-
-  @Override
-  public BaseConfig setEnableCrossSpaceCompaction(boolean enableCrossSpaceCompaction) {
-    IoTDBDescriptor.getInstance()
-        .getConfig()
-        .setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
-    return this;
-  }
-
-  @Override
-  public BaseConfig setEnableIDTable(boolean isEnableIDTable) {
-    IoTDBDescriptor.getInstance().getConfig().setEnableIDTable(isEnableIDTable);
-    return this;
-  }
-
-  @Override
-  public BaseConfig setDeviceIDTransformationMethod(String deviceIDTransformationMethod) {
-    IoTDBDescriptor.getInstance()
-        .getConfig()
-        .setDeviceIDTransformationMethod(deviceIDTransformationMethod);
-    return this;
-  }
-
-  @Override
-  public BaseConfig setAutoCreateSchemaEnabled(boolean enableAutoCreateSchema) {
-    IoTDBDescriptor.getInstance().getConfig().setAutoCreateSchemaEnabled(enableAutoCreateSchema);
-    return this;
-  }
-
-  @Override
-  public BaseConfig setEnableLastCache(boolean lastCacheEnable) {
-    IoTDBDescriptor.getInstance().getConfig().setEnableLastCache(lastCacheEnable);
-    return this;
-  }
-
-  @Override
-  public boolean isLastCacheEnabled() {
-    return IoTDBDescriptor.getInstance().getConfig().isLastCacheEnabled();
-  }
-
-  @Override
-  public boolean isEnableSeqSpaceCompaction() {
-    return IoTDBDescriptor.getInstance().getConfig().isEnableSeqSpaceCompaction();
-  }
-
-  @Override
-  public boolean isEnableUnseqSpaceCompaction() {
-    return IoTDBDescriptor.getInstance().getConfig().isEnableUnseqSpaceCompaction();
-  }
-
-  @Override
-  public boolean isEnableCrossSpaceCompaction() {
-    return IoTDBDescriptor.getInstance().getConfig().isEnableCrossSpaceCompaction();
-  }
-
-  @Override
-  public boolean isAutoCreateSchemaEnabled() {
-    return IoTDBDescriptor.getInstance().getConfig().isAutoCreateSchemaEnabled();
-  }
-
-  @Override
-  public int getMaxNumberOfPointsInPage() {
-    return TSFileDescriptor.getInstance().getConfig().getMaxNumberOfPointsInPage();
-  }
-
-  @Override
-  public BaseConfig setPrimitiveArraySize(int primitiveArraySize) {
-    IoTDBDescriptor.getInstance().getConfig().setPrimitiveArraySize(primitiveArraySize);
-    return this;
-  }
-
-  @Override
-  public int getPrimitiveArraySize() {
-    return IoTDBDescriptor.getInstance().getConfig().getPrimitiveArraySize();
-  }
-
-  public int getAvgSeriesPointNumberThreshold() {
-    return IoTDBDescriptor.getInstance().getConfig().getAvgSeriesPointNumberThreshold();
-  }
-
-  @Override
-  public BaseConfig setAvgSeriesPointNumberThreshold(int avgSeriesPointNumberThreshold) {
-    IoTDBDescriptor.getInstance()
-        .getConfig()
-        .setAvgSeriesPointNumberThreshold(avgSeriesPointNumberThreshold);
-    return this;
-  }
-
-  @Override
-  public int getMaxTsBlockLineNumber() {
-    return TSFileDescriptor.getInstance().getConfig().getMaxTsBlockLineNumber();
-  }
-
-  @Override
-  public BaseConfig setMaxTsBlockLineNumber(int maxTsBlockLineNumber) {
-    TSFileDescriptor.getInstance().getConfig().setMaxTsBlockLineNumber(maxTsBlockLineNumber);
-    return this;
-  }
-
-  @Override
-  public BaseConfig setCompactionThreadCount(int concurrentCompactionThread) {
-    IoTDBDescriptor.getInstance().getConfig().setCompactionThreadCount(concurrentCompactionThread);
-    return this;
-  }
-
-  @Override
-  public int getConcurrentCompactionThread() {
-    return IoTDBDescriptor.getInstance().getConfig().getCompactionThreadCount();
-  }
-
-  @Override
-  public BaseConfig setMaxDegreeOfIndexNode(int maxDegreeOfIndexNode) {
-    TSFileDescriptor.getInstance().getConfig().setMaxDegreeOfIndexNode(maxDegreeOfIndexNode);
-    return this;
-  }
-
-  @Override
-  public int getMaxDegreeOfIndexNode() {
-    return TSFileDescriptor.getInstance().getConfig().getMaxDegreeOfIndexNode();
-  }
-
-  @Override
-  public BaseConfig setEnableWatermark(boolean enableWatermark) {
-    IoTDBDescriptor.getInstance().getConfig().setEnableWatermark(enableWatermark);
-    return this;
-  }
-
-  @Override
-  public boolean isEnableWatermark() {
-    return IoTDBDescriptor.getInstance().getConfig().isEnableWatermark();
-  }
-
-  @Override
-  public String getWatermarkSecretKey() {
-    return IoTDBDescriptor.getInstance().getConfig().getWatermarkSecretKey();
-  }
-
-  @Override
-  public BaseConfig setWatermarkSecretKey(String watermarkSecretKey) {
-    IoTDBDescriptor.getInstance().getConfig().setWatermarkSecretKey(watermarkSecretKey);
-    return this;
-  }
-
-  @Override
-  public String getWatermarkBitString() {
-    return IoTDBDescriptor.getInstance().getConfig().getWatermarkBitString();
-  }
-
-  @Override
-  public BaseConfig setWatermarkBitString(String watermarkBitString) {
-    IoTDBDescriptor.getInstance().getConfig().setWatermarkBitString(watermarkBitString);
-    return this;
-  }
-
-  @Override
-  public String getWatermarkMethod() {
-    return IoTDBDescriptor.getInstance().getConfig().getWatermarkMethod();
-  }
-
-  @Override
-  public BaseConfig setWatermarkMethod(String watermarkMethod) {
-    IoTDBDescriptor.getInstance().getConfig().setWatermarkMethod(watermarkMethod);
-    return this;
-  }
-
-  @Override
-  public boolean isEnableMQTTService() {
-    return IoTDBDescriptor.getInstance().getConfig().isEnableMQTTService();
-  }
-
-  @Override
-  public BaseConfig setEnableMQTTService(boolean enableMQTTService) {
-    IoTDBDescriptor.getInstance().getConfig().setEnableMQTTService(enableMQTTService);
-    return this;
-  }
-
-  @Override
-  public BaseConfig setSchemaEngineMode(String schemaEngineMode) {
-    IoTDBDescriptor.getInstance().getConfig().setSchemaEngineMode(schemaEngineMode);
-    return this;
-  }
-
-  @Override
-  public String getSchemaEngineMode() {
-    return IoTDBDescriptor.getInstance().getConfig().getSchemaEngineMode();
-  }
-
-  @Override
-  public BaseConfig setSelectIntoInsertTabletPlanRowLimit(int selectIntoInsertTabletPlanRowLimit) {
-    IoTDBDescriptor.getInstance()
-        .getConfig()
-        .setSelectIntoInsertTabletPlanRowLimit(selectIntoInsertTabletPlanRowLimit);
-    return this;
-  }
-
-  @Override
-  public int getSelectIntoInsertTabletPlanRowLimit() {
-    return IoTDBDescriptor.getInstance().getConfig().getSelectIntoInsertTabletPlanRowLimit();
-  }
-
-  @Override
-  public BaseConfig setQueryThreadCount(int queryThreadCount) {
-    if (queryThreadCount <= 0) {
-      queryThreadCount = Runtime.getRuntime().availableProcessors();
-    }
-    IoTDBDescriptor.getInstance().getConfig().setQueryThreadCount(queryThreadCount);
-    return this;
-  }
-
-  @Override
-  public int getQueryThreadCount() {
-    return IoTDBDescriptor.getInstance().getConfig().getQueryThreadCount();
-  }
-}
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/groupby/IOTDBGroupByIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/groupby/IOTDBGroupByIT.java
index 9d39292bb7..46c3be292d 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/groupby/IOTDBGroupByIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/groupby/IOTDBGroupByIT.java
@@ -19,7 +19,6 @@
 
 package org.apache.iotdb.db.it.groupby;
 
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -100,20 +99,17 @@ public class IOTDBGroupByIT {
         "flush"
       };
 
-  private static long prevPartitionInterval;
-
   @BeforeClass
   public static void setUp() throws Exception {
-    prevPartitionInterval = ConfigFactory.getConfig().getPartitionInterval();
-    ConfigFactory.getConfig().setPartitionInterval(1000);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().getConfig().getConfigNodeCommonConfig().setPartitionInterval(1000);
+    EnvFactory.getEnv().getConfig().getDataNodeCommonConfig().setPartitionInterval(1000);
+    EnvFactory.getEnv().initClusterEnvironment();
     prepareData(SQLs);
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig().setPartitionInterval(prevPartitionInterval);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/groupby/IoTDBGroupByNaturalMonthIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/groupby/IoTDBGroupByNaturalMonthIT.java
index 03f5e19307..acf6566f7a 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/groupby/IoTDBGroupByNaturalMonthIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/groupby/IoTDBGroupByNaturalMonthIT.java
@@ -66,13 +66,13 @@ public class IoTDBGroupByNaturalMonthIT {
   @BeforeClass
   public static void setUp() throws Exception {
     df.setTimeZone(TimeZone.getTimeZone("GMT+00:00"));
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
     prepareData(dataSet.toArray(new String[0]));
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   /**
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/groupby/IoTDBGroupByUnseqIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/groupby/IoTDBGroupByUnseqIT.java
index 866d47a9f3..9461f82205 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/groupby/IoTDBGroupByUnseqIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/groupby/IoTDBGroupByUnseqIT.java
@@ -18,14 +18,12 @@
  */
 package org.apache.iotdb.db.it.groupby;
 
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
 import org.apache.iotdb.itbase.category.LocalStandaloneIT;
 
 import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import org.junit.runner.RunWith;
@@ -74,19 +72,9 @@ public class IoTDBGroupByUnseqIT {
         "flush"
       };
 
-  private int maxNumberOfPointsInPage;
-
-  @Before
-  public void setUp() throws Exception {
-    maxNumberOfPointsInPage = ConfigFactory.getConfig().getMaxNumberOfPointsInPage();
-    ConfigFactory.getConfig().setMaxNumberOfPointsInPage(4);
-    EnvFactory.getEnv().initBeforeTest();
-  }
-
   @After
   public void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterTest();
-    ConfigFactory.getConfig().setMaxNumberOfPointsInPage(maxNumberOfPointsInPage);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   /**
@@ -96,6 +84,9 @@ public class IoTDBGroupByUnseqIT {
    */
   @Test
   public void test1() {
+    EnvFactory.getEnv().getConfig().getConfigNodeCommonConfig().setMaxNumberOfPointsInPage(4);
+    EnvFactory.getEnv().getConfig().getDataNodeCommonConfig().setMaxNumberOfPointsInPage(4);
+    EnvFactory.getEnv().initClusterEnvironment();
     String[] expectedHeader = new String[] {TIMESTAMP_STR, count("root.sg1.d1.s1")};
     String[] retArray =
         new String[] {
@@ -116,17 +107,22 @@ public class IoTDBGroupByUnseqIT {
    */
   @Test
   public void test2() {
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setMaxNumberOfPointsInPage(4)
+        .setAvgSeriesPointNumberThreshold(2);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setMaxNumberOfPointsInPage(4)
+        .setAvgSeriesPointNumberThreshold(2);
+    EnvFactory.getEnv().initClusterEnvironment();
     String[] expectedHeader = new String[] {TIMESTAMP_STR, count("root.sg2.d1.s1")};
     String[] retArray = new String[] {"5,1,", "10,1,", "15,2,", "20,0,", "25,1,"};
 
-    int preAvgSeriesPointNumberThreshold =
-        ConfigFactory.getConfig().getAvgSeriesPointNumberThreshold();
-    ConfigFactory.getConfig().setAvgSeriesPointNumberThreshold(2);
-
     prepareData(dataSet2);
     resultSetEqualTest(
         "select count(s1) from root.sg2.d1 group by ([5, 30), 5ms)", expectedHeader, retArray);
-
-    ConfigFactory.getConfig().setAvgSeriesPointNumberThreshold(preAvgSeriesPointNumberThreshold);
   }
 }
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/groupby/IoTDBHavingIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/groupby/IoTDBHavingIT.java
index 7cebecee12..075e628be8 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/groupby/IoTDBHavingIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/groupby/IoTDBHavingIT.java
@@ -19,7 +19,6 @@
 
 package org.apache.iotdb.db.it.groupby;
 
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -108,20 +107,17 @@ public class IoTDBHavingIT {
         "INSERT INTO root.test1.d1(timestamp, code, tem) values(1, '123', 345);",
       };
 
-  private static long prevPartitionInterval;
-
   @BeforeClass
   public static void setUp() throws Exception {
-    prevPartitionInterval = ConfigFactory.getConfig().getPartitionInterval();
-    ConfigFactory.getConfig().setPartitionInterval(1000);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().getConfig().getConfigNodeCommonConfig().setPartitionInterval(1000);
+    EnvFactory.getEnv().getConfig().getDataNodeCommonConfig().setPartitionInterval(1000);
+    EnvFactory.getEnv().initClusterEnvironment();
     prepareData(SQLs);
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig().setPartitionInterval(prevPartitionInterval);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/groupby/IoTDBLeftORightCIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/groupby/IoTDBLeftORightCIT.java
index befa114755..f8f9f3cd44 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/groupby/IoTDBLeftORightCIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/groupby/IoTDBLeftORightCIT.java
@@ -45,13 +45,13 @@ public class IoTDBLeftORightCIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
     prepareData(sqls);
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/last/IoTDBLastWithTTLIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/last/IoTDBLastWithTTLIT.java
index 3d9b6a75e0..7bcbb6f084 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/last/IoTDBLastWithTTLIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/last/IoTDBLastWithTTLIT.java
@@ -45,7 +45,7 @@ public class IoTDBLastWithTTLIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
     try (Connection connection = EnvFactory.getEnv().getConnection();
         Statement statement = connection.createStatement()) {
       statement.execute("insert into root.sg.d1(time, s1, s2) values(1, 1, 1)");
@@ -58,7 +58,7 @@ public class IoTDBLastWithTTLIT {
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/mqtt/IoTDBMQTTSinkIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/mqtt/IoTDBMQTTSinkIT.java
index d4c6bccf77..ae725ac28c 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/mqtt/IoTDBMQTTSinkIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/mqtt/IoTDBMQTTSinkIT.java
@@ -22,7 +22,6 @@ import org.apache.iotdb.commons.path.PartialPath;
 import org.apache.iotdb.db.engine.trigger.sink.mqtt.MQTTConfiguration;
 import org.apache.iotdb.db.engine.trigger.sink.mqtt.MQTTEvent;
 import org.apache.iotdb.db.engine.trigger.sink.mqtt.MQTTHandler;
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -51,20 +50,16 @@ import static org.junit.Assert.fail;
 @RunWith(IoTDBTestRunner.class)
 @Category({ClusterIT.class})
 public class IoTDBMQTTSinkIT {
-
-  private boolean enableMQTTService;
-
   @Before
   public void setUp() throws Exception {
-    enableMQTTService = ConfigFactory.getConfig().isEnableMQTTService();
-    ConfigFactory.getConfig().setEnableMQTTService(true);
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv().getConfig().getConfigNodeCommonConfig().setEnableMQTTService(true);
+    EnvFactory.getEnv().getConfig().getDataNodeCommonConfig().setEnableMQTTService(true);
+    EnvFactory.getEnv().initClusterEnvironment();
   }
 
   @After
   public void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterTest();
-    ConfigFactory.getConfig().setEnableMQTTService(enableMQTTService);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBAliasIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBAliasIT.java
index 0be9d5affb..0ddb6ea2f2 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBAliasIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBAliasIT.java
@@ -90,13 +90,13 @@ public class IoTDBAliasIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
     prepareData(SQLs);
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   // ---------------------------------- Use timeseries alias ---------------------------------
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBArithmeticIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBArithmeticIT.java
index 247c80cf16..8108e5684a 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBArithmeticIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBArithmeticIT.java
@@ -68,13 +68,13 @@ public class IoTDBArithmeticIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
     prepareData(INSERTION_SQLS);
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBFuzzyQueryIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBFuzzyQueryIT.java
index 9c4c34e7c7..a9e6e37dd5 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBFuzzyQueryIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBFuzzyQueryIT.java
@@ -51,14 +51,14 @@ public class IoTDBFuzzyQueryIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
     initCreateSQLStatement();
     insertData();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   private static void initCreateSQLStatement() {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBInIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBInIT.java
index 648ef3b0bf..a83db53570 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBInIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBInIT.java
@@ -78,14 +78,14 @@ public class IoTDBInIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
 
     importData();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   private static void importData() {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBNullOperandIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBNullOperandIT.java
index 73233b3242..9d2606fea6 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBNullOperandIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBNullOperandIT.java
@@ -19,7 +19,6 @@
 
 package org.apache.iotdb.db.it.query;
 
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -52,20 +51,17 @@ public class IoTDBNullOperandIT {
         "flush",
       };
 
-  private static long prevPartitionInterval;
-
   @BeforeClass
   public static void setUp() throws Exception {
-    prevPartitionInterval = ConfigFactory.getConfig().getPartitionInterval();
-    ConfigFactory.getConfig().setPartitionInterval(1000);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().getConfig().getConfigNodeCommonConfig().setPartitionInterval(1000);
+    EnvFactory.getEnv().getConfig().getDataNodeCommonConfig().setPartitionInterval(1000);
+    EnvFactory.getEnv().initClusterEnvironment();
     prepareData(SQLs);
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig().setPartitionInterval(prevPartitionInterval);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   /**
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBNullValueFillIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBNullValueFillIT.java
index 0346dcb0f8..cfcb590c26 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBNullValueFillIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBNullValueFillIT.java
@@ -109,13 +109,13 @@ public class IoTDBNullValueFillIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
     prepareData(sqls);
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBPaginationIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBPaginationIT.java
index 0afc36119b..9e069f0c11 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBPaginationIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBPaginationIT.java
@@ -19,7 +19,6 @@
 
 package org.apache.iotdb.db.it.query;
 
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -81,20 +80,17 @@ public class IoTDBPaginationIT {
         "insert into root.vehicle.d0(timestamp,s1) values(2000-01-01T08:00:00+08:00, 100)"
       };
 
-  private static int maxQueryDeduplicatedPathNum;
-
   @BeforeClass
   public static void setUp() throws InterruptedException {
-    maxQueryDeduplicatedPathNum = ConfigFactory.getConfig().getMaxQueryDeduplicatedPathNum();
-    ConfigFactory.getConfig().setMaxQueryDeduplicatedPathNum(2);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().getConfig().getConfigNodeCommonConfig().setMaxQueryDeduplicatedPathNum(2);
+    EnvFactory.getEnv().getConfig().getDataNodeCommonConfig().setMaxQueryDeduplicatedPathNum(2);
+    EnvFactory.getEnv().initClusterEnvironment();
     prepareData(SQLs);
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig().setMaxQueryDeduplicatedPathNum(maxQueryDeduplicatedPathNum);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBQueryDemoIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBQueryDemoIT.java
index c67d48e0e3..cb074e324a 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBQueryDemoIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBQueryDemoIT.java
@@ -121,14 +121,14 @@ public class IoTDBQueryDemoIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
 
     importData();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   private static void importData() {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBQueryWithComplexValueFilterIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBQueryWithComplexValueFilterIT.java
index 2772ea5205..db39f956e2 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBQueryWithComplexValueFilterIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBQueryWithComplexValueFilterIT.java
@@ -42,13 +42,13 @@ public class IoTDBQueryWithComplexValueFilterIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
     prepareData();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBResultSetIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBResultSetIT.java
index e64706983f..57e246c09f 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBResultSetIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBResultSetIT.java
@@ -67,13 +67,13 @@ public class IoTDBResultSetIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
     prepareData(SQLs);
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBSelectCompareExpressionIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBSelectCompareExpressionIT.java
index a8c551077a..942357ca2a 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBSelectCompareExpressionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBSelectCompareExpressionIT.java
@@ -89,7 +89,7 @@ public class IoTDBSelectCompareExpressionIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
     createTimeSeries();
     generateData();
   }
@@ -123,7 +123,7 @@ public class IoTDBSelectCompareExpressionIT {
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   /*
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBSelectSchemaIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBSelectSchemaIT.java
index a053c85e44..3fdf6f93d1 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBSelectSchemaIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/query/IoTDBSelectSchemaIT.java
@@ -58,7 +58,7 @@ public class IoTDBSelectSchemaIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
     createTimeSeries();
     generateData();
   }
@@ -74,7 +74,7 @@ public class IoTDBSelectSchemaIT {
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBAutoCreateSchemaIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBAutoCreateSchemaIT.java
index e94b12471a..cbfb9dc082 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBAutoCreateSchemaIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBAutoCreateSchemaIT.java
@@ -54,7 +54,7 @@ public class IoTDBAutoCreateSchemaIT {
 
   @Before
   public void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv().initClusterEnvironment();
 
     connection = EnvFactory.getEnv().getConnection();
     statement = connection.createStatement();
@@ -64,7 +64,7 @@ public class IoTDBAutoCreateSchemaIT {
   public void tearDown() throws Exception {
     statement.close();
     connection.close();
-    EnvFactory.getEnv().cleanAfterTest();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   /** create timeseries without setting database */
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBCreateAlignedTimeseriesIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBCreateAlignedTimeseriesIT.java
index 838c4ec03e..a26f58e799 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBCreateAlignedTimeseriesIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBCreateAlignedTimeseriesIT.java
@@ -48,7 +48,7 @@ public class IoTDBCreateAlignedTimeseriesIT {
 
   @Before
   public void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv().initClusterEnvironment();
 
     connection = EnvFactory.getEnv().getConnection();
     statement = connection.createStatement();
@@ -58,7 +58,7 @@ public class IoTDBCreateAlignedTimeseriesIT {
   public void tearDown() throws Exception {
     statement.close();
     connection.close();
-    EnvFactory.getEnv().cleanAfterTest();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBCreateStorageGroupIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBCreateStorageGroupIT.java
index cfebdadef8..b5a9cb9f80 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBCreateStorageGroupIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBCreateStorageGroupIT.java
@@ -55,7 +55,7 @@ public class IoTDBCreateStorageGroupIT {
 
   @Before
   public void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv().initClusterEnvironment();
 
     connection = EnvFactory.getEnv().getConnection();
     statement = connection.createStatement();
@@ -65,7 +65,7 @@ public class IoTDBCreateStorageGroupIT {
   public void tearDown() throws Exception {
     statement.close();
     connection.close();
-    EnvFactory.getEnv().cleanAfterTest();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   /** The test creates three databases */
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBCreateTimeseriesIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBCreateTimeseriesIT.java
index d4ed409d41..fc6348f8a1 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBCreateTimeseriesIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBCreateTimeseriesIT.java
@@ -51,12 +51,12 @@ public class IoTDBCreateTimeseriesIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   /** Test if creating a time series will cause the database with same name to disappear */
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeactivateTemplateIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeactivateTemplateIT.java
index ae1367bc23..44537ac0bd 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeactivateTemplateIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeactivateTemplateIT.java
@@ -46,7 +46,7 @@ public class IoTDBDeactivateTemplateIT {
 
   @Before
   public void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv().initClusterEnvironment();
     connection = EnvFactory.getEnv().getConnection();
     statement = connection.createStatement();
 
@@ -57,7 +57,7 @@ public class IoTDBDeactivateTemplateIT {
   public void tearDown() throws Exception {
     statement.close();
     connection.close();
-    EnvFactory.getEnv().cleanAfterTest();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   private void prepareTemplate() throws SQLException {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeleteAlignedTimeseriesIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeleteAlignedTimeseriesIT.java
index 09c8d07397..7a98d758fa 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeleteAlignedTimeseriesIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeleteAlignedTimeseriesIT.java
@@ -20,7 +20,6 @@
 package org.apache.iotdb.db.it.schema;
 
 import org.apache.iotdb.db.mpp.common.header.ColumnHeaderConstant;
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -46,17 +45,14 @@ import static org.junit.Assert.fail;
 @Category({ClusterIT.class})
 public class IoTDBDeleteAlignedTimeseriesIT {
 
-  private long memtableSizeThreshold;
-
   private Statement statement;
   private Connection connection;
 
   @Before
   public void setUp() throws ClassNotFoundException, SQLException, InterruptedException {
-    memtableSizeThreshold = ConfigFactory.getConfig().getMemtableSizeThreshold();
-    ConfigFactory.getConfig().setMemtableSizeThreshold(2);
-
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv().getConfig().getConfigNodeCommonConfig().setMemtableSizeThreshold(2);
+    EnvFactory.getEnv().getConfig().getDataNodeCommonConfig().setMemtableSizeThreshold(2);
+    EnvFactory.getEnv().initClusterEnvironment();
 
     connection = EnvFactory.getEnv().getConnection();
     statement = connection.createStatement();
@@ -66,8 +62,7 @@ public class IoTDBDeleteAlignedTimeseriesIT {
   public void tearDown() throws Exception {
     statement.close();
     connection.close();
-    EnvFactory.getEnv().cleanAfterTest();
-    ConfigFactory.getConfig().setMemtableSizeThreshold(memtableSizeThreshold);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeleteStorageGroupIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeleteStorageGroupIT.java
index 20fd9415e1..a243826445 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeleteStorageGroupIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeleteStorageGroupIT.java
@@ -46,12 +46,12 @@ public class IoTDBDeleteStorageGroupIT {
 
   @Before
   public void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv().initClusterEnvironment();
   }
 
   @After
   public void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterTest();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeleteTimeseriesIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeleteTimeseriesIT.java
index 5d31d5e313..692db31ec6 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeleteTimeseriesIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeleteTimeseriesIT.java
@@ -19,7 +19,6 @@
 
 package org.apache.iotdb.db.it.schema;
 
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -46,17 +45,15 @@ import static org.junit.Assert.fail;
 @Category({ClusterIT.class})
 public class IoTDBDeleteTimeseriesIT {
 
-  private long memtableSizeThreshold;
-
   private Statement statement;
   private Connection connection;
 
   @Before
   public void setUp() throws Exception {
-    memtableSizeThreshold = ConfigFactory.getConfig().getMemtableSizeThreshold();
-    ConfigFactory.getConfig().setMemtableSizeThreshold(2);
+    EnvFactory.getEnv().getConfig().getConfigNodeCommonConfig().setMemtableSizeThreshold(2);
+    EnvFactory.getEnv().getConfig().getDataNodeCommonConfig().setMemtableSizeThreshold(2);
 
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv().initClusterEnvironment();
 
     connection = EnvFactory.getEnv().getConnection();
     statement = connection.createStatement();
@@ -66,8 +63,7 @@ public class IoTDBDeleteTimeseriesIT {
   public void tearDown() throws Exception {
     statement.close();
     connection.close();
-    EnvFactory.getEnv().cleanAfterTest();
-    ConfigFactory.getConfig().setMemtableSizeThreshold(memtableSizeThreshold);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeleteTimeseriesSchemaFileIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeleteTimeseriesSchemaFileIT.java
index 830434db25..bc80c91768 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeleteTimeseriesSchemaFileIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeleteTimeseriesSchemaFileIT.java
@@ -18,7 +18,7 @@
  */
 package org.apache.iotdb.db.it.schema;
 
-import org.apache.iotdb.it.env.ConfigFactory;
+import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
 import org.apache.iotdb.itbase.category.LocalStandaloneIT;
@@ -32,18 +32,15 @@ import org.junit.runner.RunWith;
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBDeleteTimeseriesSchemaFileIT extends IoTDBDeleteTimeseriesIT {
 
-  protected static String schemaEngineMode;
-
   @Before
   public void setUp() throws Exception {
-    schemaEngineMode = ConfigFactory.getConfig().getSchemaEngineMode();
-    ConfigFactory.getConfig().setSchemaEngineMode("Schema_File");
+    EnvFactory.getEnv().getConfig().getConfigNodeCommonConfig().setSchemaEngineMode("Schema_File");
+    EnvFactory.getEnv().getConfig().getDataNodeCommonConfig().setSchemaEngineMode("Schema_File");
     super.setUp();
   }
 
   @After
   public void tearDown() throws Exception {
     super.tearDown();
-    ConfigFactory.getConfig().setSchemaEngineMode(schemaEngineMode);
   }
 }
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBMetadataFetchIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBMetadataFetchIT.java
index 530bfad679..fdc1a30612 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBMetadataFetchIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBMetadataFetchIT.java
@@ -85,14 +85,14 @@ public class IoTDBMetadataFetchIT {
 
   @Before
   public void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv().initClusterEnvironment();
 
     insertSQL();
   }
 
   @After
   public void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterTest();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBMetadataFetchSchemaFileIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBMetadataFetchSchemaFileIT.java
index 5740588b16..403468fdd0 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBMetadataFetchSchemaFileIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBMetadataFetchSchemaFileIT.java
@@ -18,7 +18,7 @@
  */
 package org.apache.iotdb.db.it.schema;
 
-import org.apache.iotdb.it.env.ConfigFactory;
+import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
 import org.apache.iotdb.itbase.category.LocalStandaloneIT;
@@ -36,18 +36,15 @@ import org.junit.runner.RunWith;
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBMetadataFetchSchemaFileIT extends IoTDBMetadataFetchIT {
 
-  protected static String schemaEngineMode;
-
   @Before
   public void setUp() throws Exception {
-    schemaEngineMode = ConfigFactory.getConfig().getSchemaEngineMode();
-    ConfigFactory.getConfig().setSchemaEngineMode("Schema_File");
+    EnvFactory.getEnv().getConfig().getConfigNodeCommonConfig().setSchemaEngineMode("Schema_File");
+    EnvFactory.getEnv().getConfig().getDataNodeCommonConfig().setSchemaEngineMode("Schema_File");
     super.setUp();
   }
 
   @After
   public void tearDown() throws Exception {
     super.tearDown();
-    ConfigFactory.getConfig().setSchemaEngineMode(schemaEngineMode);
   }
 }
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBSchemaTemplateIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBSchemaTemplateIT.java
index 34737d475a..99960f4781 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBSchemaTemplateIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBSchemaTemplateIT.java
@@ -53,7 +53,7 @@ public class IoTDBSchemaTemplateIT {
 
   @Before
   public void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv().initClusterEnvironment();
     connection = EnvFactory.getEnv().getConnection();
     statement = connection.createStatement();
 
@@ -64,7 +64,7 @@ public class IoTDBSchemaTemplateIT {
   public void tearDown() throws Exception {
     statement.close();
     connection.close();
-    EnvFactory.getEnv().cleanAfterTest();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBSortedShowTimeseriesIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBSortedShowTimeseriesIT.java
index 40cd34280d..4042aa110b 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBSortedShowTimeseriesIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBSortedShowTimeseriesIT.java
@@ -97,13 +97,13 @@ public class IoTDBSortedShowTimeseriesIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv().initClusterEnvironment();
     createSchema();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterTest();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagAlterIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagAlterIT.java
index d02b3502fe..91ab626fec 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagAlterIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagAlterIT.java
@@ -45,12 +45,12 @@ public class IoTDBTagAlterIT {
 
   @Before
   public void setUp() throws InterruptedException {
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv().initClusterEnvironment();
   }
 
   @After
   public void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterTest();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagIT.java
index b301ff1819..14ea0e659e 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBTagIT.java
@@ -49,12 +49,12 @@ public class IoTDBTagIT {
 
   @Before
   public void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv().initClusterEnvironment();
   }
 
   @After
   public void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterTest();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/selectinto/IoTDBSelectInto2IT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/selectinto/IoTDBSelectInto2IT.java
index 5a11ae1f8f..3895c92353 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/selectinto/IoTDBSelectInto2IT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/selectinto/IoTDBSelectInto2IT.java
@@ -19,7 +19,6 @@
 
 package org.apache.iotdb.db.it.selectinto;
 
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -38,23 +37,24 @@ public class IoTDBSelectInto2IT extends IoTDBSelectIntoIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    selectIntoInsertTabletPlanRowLimit =
-        ConfigFactory.getConfig().getSelectIntoInsertTabletPlanRowLimit();
-    numOfPointsPerPage = ConfigFactory.getConfig().getMaxNumberOfPointsInPage();
-    queryThreadCount = ConfigFactory.getConfig().getQueryThreadCount();
-    ConfigFactory.getConfig().setSelectIntoInsertTabletPlanRowLimit(8);
-    ConfigFactory.getConfig().setMaxNumberOfPointsInPage(5);
-    ConfigFactory.getConfig().setQueryThreadCount(1);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setSelectIntoInsertTabletPlanRowLimit(8)
+        .setMaxNumberOfPointsInPage(5)
+        .setQueryThreadCount(1);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setSelectIntoInsertTabletPlanRowLimit(8)
+        .setMaxNumberOfPointsInPage(5)
+        .setQueryThreadCount(1);
+    EnvFactory.getEnv().initClusterEnvironment();
     prepareData(SQLs);
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig()
-        .setSelectIntoInsertTabletPlanRowLimit(selectIntoInsertTabletPlanRowLimit);
-    ConfigFactory.getConfig().setMaxNumberOfPointsInPage(numOfPointsPerPage);
-    ConfigFactory.getConfig().setQueryThreadCount(queryThreadCount);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 }
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/selectinto/IoTDBSelectInto3IT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/selectinto/IoTDBSelectInto3IT.java
index f37e12b588..a4537c6054 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/selectinto/IoTDBSelectInto3IT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/selectinto/IoTDBSelectInto3IT.java
@@ -19,7 +19,6 @@
 
 package org.apache.iotdb.db.it.selectinto;
 
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -38,20 +37,22 @@ public class IoTDBSelectInto3IT extends IoTDBSelectIntoIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    selectIntoInsertTabletPlanRowLimit =
-        ConfigFactory.getConfig().getSelectIntoInsertTabletPlanRowLimit();
-    queryThreadCount = ConfigFactory.getConfig().getQueryThreadCount();
-    ConfigFactory.getConfig().setSelectIntoInsertTabletPlanRowLimit(5);
-    ConfigFactory.getConfig().setQueryThreadCount(1);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setSelectIntoInsertTabletPlanRowLimit(5)
+        .setQueryThreadCount(1);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setSelectIntoInsertTabletPlanRowLimit(5)
+        .setQueryThreadCount(1);
+    EnvFactory.getEnv().initClusterEnvironment();
     prepareData(SQLs);
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig()
-        .setSelectIntoInsertTabletPlanRowLimit(selectIntoInsertTabletPlanRowLimit);
-    ConfigFactory.getConfig().setQueryThreadCount(queryThreadCount);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 }
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/selectinto/IoTDBSelectIntoIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/selectinto/IoTDBSelectIntoIT.java
index 5102d43e63..e6b471ddb4 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/selectinto/IoTDBSelectIntoIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/selectinto/IoTDBSelectIntoIT.java
@@ -19,7 +19,6 @@
 
 package org.apache.iotdb.db.it.selectinto;
 
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -46,10 +45,6 @@ import static org.junit.Assert.fail;
 @Category({LocalStandaloneIT.class, ClusterIT.class})
 public class IoTDBSelectIntoIT {
 
-  protected static int selectIntoInsertTabletPlanRowLimit;
-  protected static int numOfPointsPerPage;
-  protected static int queryThreadCount;
-
   protected static final String[] SQLs =
       new String[] {
         "CREATE DATABASE root.sg",
@@ -108,16 +103,15 @@ public class IoTDBSelectIntoIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    queryThreadCount = ConfigFactory.getConfig().getQueryThreadCount();
-    ConfigFactory.getConfig().setQueryThreadCount(1);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().getConfig().getConfigNodeCommonConfig().setQueryThreadCount(1);
+    EnvFactory.getEnv().getConfig().getDataNodeCommonConfig().setQueryThreadCount(1);
+    EnvFactory.getEnv().initClusterEnvironment();
     prepareData(SQLs);
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig().setQueryThreadCount(queryThreadCount);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   // -------------------------------------- ALIGN BY TIME ---------------------------------------
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/sync/IoTDBPipeIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/sync/IoTDBPipeIT.java
index 6accf72c71..d2a02b5fcc 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/sync/IoTDBPipeIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/sync/IoTDBPipeIT.java
@@ -56,7 +56,7 @@ public class IoTDBPipeIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
     if (EnvFactory.getEnv().getDataNodeWrapperList() != null
         && EnvFactory.getEnv().getDataNodeWrapperList().size() > 0) {
       ip = EnvFactory.getEnv().getDataNodeWrapperList().get(0).getIp();
@@ -69,7 +69,7 @@ public class IoTDBPipeIT {
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/sync/IoTDBPipeSinkIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/sync/IoTDBPipeSinkIT.java
index 55dc2ba1d9..67093e6768 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/sync/IoTDBPipeSinkIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/sync/IoTDBPipeSinkIT.java
@@ -53,12 +53,12 @@ public class IoTDBPipeSinkIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/trigger/IoTDBTriggerExecutionIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/trigger/IoTDBTriggerExecutionIT.java
index 78aa550d92..137d58de9b 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/trigger/IoTDBTriggerExecutionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/trigger/IoTDBTriggerExecutionIT.java
@@ -72,7 +72,7 @@ public class IoTDBTriggerExecutionIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
     createTimeSeries();
     createTriggers();
   }
@@ -80,7 +80,7 @@ public class IoTDBTriggerExecutionIT {
   @AfterClass
   public static void tearDown() throws Exception {
     dropTriggers();
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   private static void createTimeSeries() {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/trigger/IoTDBTriggerManagementIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/trigger/IoTDBTriggerManagementIT.java
index 35801a05c7..fa52744fd4 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/trigger/IoTDBTriggerManagementIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/trigger/IoTDBTriggerManagementIT.java
@@ -85,13 +85,13 @@ public class IoTDBTriggerManagementIT {
 
   @Before
   public void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
     createTimeSeries();
   }
 
   @After
   public void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   private static void createTimeSeries() {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDFM4IT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDFM4IT.java
index 36b028f326..fb1fdce3cf 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDFM4IT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDFM4IT.java
@@ -18,7 +18,6 @@
  */
 package org.apache.iotdb.db.it.udf;
 
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -51,22 +50,16 @@ public class IoTDBUDFM4IT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    ConfigFactory.getConfig()
-        .setUdfCollectorMemoryBudgetInMB(5)
-        .setUdfTransformerMemoryBudgetInMB(5)
-        .setUdfReaderMemoryBudgetInMB(5);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().getConfig().getConfigNodeCommonConfig().setUdfMemoryBudgetInMB(5);
+    EnvFactory.getEnv().getConfig().getDataNodeCommonConfig().setUdfMemoryBudgetInMB(5);
+    EnvFactory.getEnv().initClusterEnvironment();
     createTimeSeries();
     generateData();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig()
-        .setUdfCollectorMemoryBudgetInMB(100)
-        .setUdfTransformerMemoryBudgetInMB(100)
-        .setUdfReaderMemoryBudgetInMB(100);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDFManagementIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDFManagementIT.java
index 2984e84e5e..2362af361f 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDFManagementIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDFManagementIT.java
@@ -56,12 +56,12 @@ public class IoTDBUDFManagementIT {
 
   @Before
   public void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv().initClusterEnvironment();
   }
 
   @After
   public void tearDown() {
-    EnvFactory.getEnv().cleanAfterTest();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDFOtherWindowQueryIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDFOtherWindowQueryIT.java
index 570886680e..db3a8d9692 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDFOtherWindowQueryIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDFOtherWindowQueryIT.java
@@ -19,7 +19,6 @@
 
 package org.apache.iotdb.db.it.udf;
 
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -48,23 +47,23 @@ public class IoTDBUDFOtherWindowQueryIT {
 
   protected static final int ITERATION_TIMES = 1000;
 
-  protected static boolean enableSeqSpaceCompaction;
-  protected static boolean enableUnseqSpaceCompaction;
-  protected static boolean enableCrossSpaceCompaction;
-
   @BeforeClass
   public static void setUp() throws Exception {
-    enableSeqSpaceCompaction = ConfigFactory.getConfig().isEnableSeqSpaceCompaction();
-    enableUnseqSpaceCompaction = ConfigFactory.getConfig().isEnableUnseqSpaceCompaction();
-    enableCrossSpaceCompaction = ConfigFactory.getConfig().isEnableCrossSpaceCompaction();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(false);
-    ConfigFactory.getConfig()
-        .setUdfCollectorMemoryBudgetInMB(5)
-        .setUdfTransformerMemoryBudgetInMB(5)
-        .setUdfReaderMemoryBudgetInMB(5);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setUdfMemoryBudgetInMB(5);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setUdfMemoryBudgetInMB(5);
+    EnvFactory.getEnv().initClusterEnvironment();
     createTimeSeries();
     generateData();
     registerUDF();
@@ -72,14 +71,7 @@ public class IoTDBUDFOtherWindowQueryIT {
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
-    ConfigFactory.getConfig()
-        .setUdfCollectorMemoryBudgetInMB(100)
-        .setUdfTransformerMemoryBudgetInMB(100)
-        .setUdfReaderMemoryBudgetInMB(100);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   private static void createTimeSeries() {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDFWindowQueryIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDFWindowQueryIT.java
index 6d14e5d47a..d233a07980 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDFWindowQueryIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDFWindowQueryIT.java
@@ -18,7 +18,6 @@
  */
 package org.apache.iotdb.db.it.udf;
 
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -48,23 +47,23 @@ public class IoTDBUDFWindowQueryIT {
 
   protected static final int ITERATION_TIMES = 10000;
 
-  protected static boolean enableSeqSpaceCompaction;
-  protected static boolean enableUnseqSpaceCompaction;
-  protected static boolean enableCrossSpaceCompaction;
-
   @BeforeClass
   public static void setUp() throws Exception {
-    enableSeqSpaceCompaction = ConfigFactory.getConfig().isEnableSeqSpaceCompaction();
-    enableUnseqSpaceCompaction = ConfigFactory.getConfig().isEnableUnseqSpaceCompaction();
-    enableCrossSpaceCompaction = ConfigFactory.getConfig().isEnableCrossSpaceCompaction();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(false);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(false);
-    ConfigFactory.getConfig()
-        .setUdfCollectorMemoryBudgetInMB(5)
-        .setUdfTransformerMemoryBudgetInMB(5)
-        .setUdfReaderMemoryBudgetInMB(5);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setUdfMemoryBudgetInMB(5);
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setEnableSeqSpaceCompaction(false)
+        .setEnableUnseqSpaceCompaction(false)
+        .setEnableCrossSpaceCompaction(false)
+        .setUdfMemoryBudgetInMB(5);
+    EnvFactory.getEnv().initClusterEnvironment();
     createTimeSeries();
     generateData();
     registerUDF();
@@ -72,14 +71,7 @@ public class IoTDBUDFWindowQueryIT {
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
-    ConfigFactory.getConfig()
-        .setUdfCollectorMemoryBudgetInMB(100)
-        .setUdfTransformerMemoryBudgetInMB(100)
-        .setUdfReaderMemoryBudgetInMB(100);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   private static void createTimeSeries() {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDTFAlignByTimeQueryIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDTFAlignByTimeQueryIT.java
index 8b530072ce..45f6b5ef83 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDTFAlignByTimeQueryIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDTFAlignByTimeQueryIT.java
@@ -18,7 +18,6 @@
  */
 package org.apache.iotdb.db.it.udf;
 
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -59,20 +58,11 @@ public class IoTDBUDTFAlignByTimeQueryIT {
   protected static final int SLIMIT = 10;
   protected static final int SOFFSET = 2;
 
-  protected static boolean enableSeqSpaceCompaction;
-  protected static boolean enableUnseqSpaceCompaction;
-  protected static boolean enableCrossSpaceCompaction;
-
   @BeforeClass
   public static void setUp() throws Exception {
-    enableSeqSpaceCompaction = ConfigFactory.getConfig().isEnableSeqSpaceCompaction();
-    enableUnseqSpaceCompaction = ConfigFactory.getConfig().isEnableUnseqSpaceCompaction();
-    enableCrossSpaceCompaction = ConfigFactory.getConfig().isEnableCrossSpaceCompaction();
-    ConfigFactory.getConfig()
-        .setUdfCollectorMemoryBudgetInMB(5)
-        .setUdfTransformerMemoryBudgetInMB(5)
-        .setUdfReaderMemoryBudgetInMB(5);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().getConfig().getConfigNodeCommonConfig().setUdfMemoryBudgetInMB(5);
+    EnvFactory.getEnv().getConfig().getDataNodeCommonConfig().setUdfMemoryBudgetInMB(5);
+    EnvFactory.getEnv().initClusterEnvironment();
     createTimeSeries();
     generateData();
     registerUDF();
@@ -80,14 +70,7 @@ public class IoTDBUDTFAlignByTimeQueryIT {
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig().setEnableSeqSpaceCompaction(enableSeqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableUnseqSpaceCompaction(enableUnseqSpaceCompaction);
-    ConfigFactory.getConfig().setEnableCrossSpaceCompaction(enableCrossSpaceCompaction);
-    ConfigFactory.getConfig()
-        .setUdfCollectorMemoryBudgetInMB(100)
-        .setUdfTransformerMemoryBudgetInMB(100)
-        .setUdfReaderMemoryBudgetInMB(100);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   private static void createTimeSeries() {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDTFBuiltinFunctionIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDTFBuiltinFunctionIT.java
index 104fba187e..33e2b1e54c 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDTFBuiltinFunctionIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDTFBuiltinFunctionIT.java
@@ -58,14 +58,14 @@ public class IoTDBUDTFBuiltinFunctionIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
     createTimeSeries();
     insertData();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   private static void createTimeSeries() {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDTFHybridQueryIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDTFHybridQueryIT.java
index d910aefd79..2d08ffff49 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDTFHybridQueryIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDTFHybridQueryIT.java
@@ -48,7 +48,7 @@ public class IoTDBUDTFHybridQueryIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
     createTimeSeries();
     generateData();
     registerUDF();
@@ -103,7 +103,7 @@ public class IoTDBUDTFHybridQueryIT {
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDTFNonAlignQueryIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDTFNonAlignQueryIT.java
index 91006dbf76..138224ccd2 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDTFNonAlignQueryIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/udf/IoTDBUDTFNonAlignQueryIT.java
@@ -18,7 +18,6 @@
  */
 package org.apache.iotdb.db.it.udf;
 
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -60,11 +59,9 @@ public class IoTDBUDTFNonAlignQueryIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    ConfigFactory.getConfig()
-        .setUdfCollectorMemoryBudgetInMB(5)
-        .setUdfTransformerMemoryBudgetInMB(5)
-        .setUdfReaderMemoryBudgetInMB(5);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().getConfig().getConfigNodeCommonConfig().setUdfMemoryBudgetInMB(5);
+    EnvFactory.getEnv().getConfig().getDataNodeCommonConfig().setUdfMemoryBudgetInMB(5);
+    EnvFactory.getEnv().initClusterEnvironment();
     createTimeSeries();
     generateData();
     registerUDF();
@@ -72,11 +69,7 @@ public class IoTDBUDTFNonAlignQueryIT {
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
-    ConfigFactory.getConfig()
-        .setUdfCollectorMemoryBudgetInMB(100)
-        .setUdfTransformerMemoryBudgetInMB(100)
-        .setUdfReaderMemoryBudgetInMB(100);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   private static void createTimeSeries() {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/watermark/IoTDBWatermarkIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/watermark/IoTDBWatermarkIT.java
index a1ffb38245..fe5d3bff51 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/watermark/IoTDBWatermarkIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/watermark/IoTDBWatermarkIT.java
@@ -19,7 +19,6 @@
 package org.apache.iotdb.db.it.watermark;
 
 import org.apache.iotdb.db.tools.watermark.WatermarkDetector;
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -57,32 +56,30 @@ public class IoTDBWatermarkIT {
   private static int embed_row_cycle = 5;
   private static int embed_lsb_num = 5;
 
-  private boolean originEnableWatermark;
-
-  private String originWatermarkSecretKey;
-
-  private String originWatermarkBitString;
-
-  private String originWatermarkMethod;
-
   @Before
   public void setUp() throws Exception {
-
-    originEnableWatermark = ConfigFactory.getConfig().isEnableWatermark();
-    originWatermarkSecretKey = ConfigFactory.getConfig().getWatermarkSecretKey();
-    originWatermarkBitString = ConfigFactory.getConfig().getWatermarkBitString();
-    originWatermarkMethod = ConfigFactory.getConfig().getWatermarkMethod();
-
-    ConfigFactory.getConfig().setEnableWatermark(true);
-    ConfigFactory.getConfig().setWatermarkSecretKey(secretKey);
-    ConfigFactory.getConfig().setWatermarkBitString(watermarkBitString);
-    ConfigFactory.getConfig()
+    EnvFactory.getEnv()
+        .getConfig()
+        .getConfigNodeCommonConfig()
+        .setEnableWatermark(true)
+        .setWatermarkSecretKey(secretKey)
+        .setWatermarkBitString(watermarkBitString)
+        .setWatermarkMethod(
+            String.format(
+                "GroupBasedLSBMethod" + "(embed_row_cycle=%d,embed_lsb_num=%d)",
+                embed_row_cycle, embed_lsb_num));
+    EnvFactory.getEnv()
+        .getConfig()
+        .getDataNodeCommonConfig()
+        .setEnableWatermark(true)
+        .setWatermarkSecretKey(secretKey)
+        .setWatermarkBitString(watermarkBitString)
         .setWatermarkMethod(
             String.format(
                 "GroupBasedLSBMethod" + "(embed_row_cycle=%d,embed_lsb_num=%d)",
                 embed_row_cycle, embed_lsb_num));
 
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv().initClusterEnvironment();
 
     insertData();
 
@@ -111,12 +108,7 @@ public class IoTDBWatermarkIT {
     if (file2.exists()) {
       file2.delete();
     }
-    EnvFactory.getEnv().cleanAfterTest();
-
-    ConfigFactory.getConfig().setEnableWatermark(originEnableWatermark);
-    ConfigFactory.getConfig().setWatermarkSecretKey(originWatermarkSecretKey);
-    ConfigFactory.getConfig().setWatermarkBitString(originWatermarkBitString);
-    ConfigFactory.getConfig().setWatermarkMethod(originWatermarkMethod);
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   private static void insertData() {
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/withoutNull/IoTDBWithoutAllNullIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/withoutNull/IoTDBWithoutAllNullIT.java
index 77903a841a..d88e497c16 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/withoutNull/IoTDBWithoutAllNullIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/withoutNull/IoTDBWithoutAllNullIT.java
@@ -64,7 +64,7 @@ public class IoTDBWithoutAllNullIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
     prepareData();
   }
 
@@ -83,7 +83,7 @@ public class IoTDBWithoutAllNullIT {
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/withoutNull/IoTDBWithoutAnyNullIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/withoutNull/IoTDBWithoutAnyNullIT.java
index df3d646ec9..02130d25f9 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/withoutNull/IoTDBWithoutAnyNullIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/withoutNull/IoTDBWithoutAnyNullIT.java
@@ -72,13 +72,13 @@ public class IoTDBWithoutAnyNullIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().initClusterEnvironment();
     prepareData();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/withoutNull/IoTDBWithoutNullAllFilterIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/withoutNull/IoTDBWithoutNullAllFilterIT.java
index 5f107fdde0..8a8cafa3ae 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/withoutNull/IoTDBWithoutNullAllFilterIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/withoutNull/IoTDBWithoutNullAllFilterIT.java
@@ -18,7 +18,6 @@
  */
 package org.apache.iotdb.db.it.withoutNull;
 
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.ClusterIT;
@@ -39,7 +38,6 @@ import java.sql.ResultSet;
 import java.sql.Statement;
 
 import static org.apache.iotdb.db.it.utils.TestUtils.resultSetEqualTest;
-import static org.apache.iotdb.itbase.constant.TestConstant.TIMESTAMP_STR;
 import static org.junit.Assert.fail;
 
 @RunWith(IoTDBTestRunner.class)
@@ -123,15 +121,15 @@ public class IoTDBWithoutNullAllFilterIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    ConfigFactory.getConfig().setPartitionInterval(1000);
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv().getConfig().getConfigNodeCommonConfig().setPartitionInterval(1000);
+    EnvFactory.getEnv().getConfig().getDataNodeCommonConfig().setPartitionInterval(1000);
+    EnvFactory.getEnv().initClusterEnvironment();
     prepareData();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    ConfigFactory.getConfig().setPartitionInterval(86400);
-    EnvFactory.getEnv().cleanAfterTest();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/withoutNull/IoTDBWithoutNullAnyFilterIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/withoutNull/IoTDBWithoutNullAnyFilterIT.java
index 6aabb9b2ed..5436381cc6 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/withoutNull/IoTDBWithoutNullAnyFilterIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/withoutNull/IoTDBWithoutNullAnyFilterIT.java
@@ -121,13 +121,13 @@ public class IoTDBWithoutNullAnyFilterIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    EnvFactory.getEnv().initBeforeTest();
+    EnvFactory.getEnv().initClusterEnvironment();
     prepareData();
   }
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterTest();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/libudf/it/anomaly/AnomalyIT.java b/integration-test/src/test/java/org/apache/iotdb/libudf/it/anomaly/AnomalyIT.java
index a52fc64ec7..93a8fbc009 100644
--- a/integration-test/src/test/java/org/apache/iotdb/libudf/it/anomaly/AnomalyIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/libudf/it/anomaly/AnomalyIT.java
@@ -19,7 +19,6 @@
 
 package org.apache.iotdb.libudf.it.anomaly;
 
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.LocalStandaloneIT;
@@ -45,11 +44,9 @@ public class AnomalyIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    ConfigFactory.getConfig()
-        .setUdfCollectorMemoryBudgetInMB(5)
-        .setUdfTransformerMemoryBudgetInMB(5)
-        .setUdfReaderMemoryBudgetInMB(5);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().getConfig().getConfigNodeCommonConfig().setUdfMemoryBudgetInMB(5);
+    EnvFactory.getEnv().getConfig().getDataNodeCommonConfig().setUdfMemoryBudgetInMB(5);
+    EnvFactory.getEnv().initClusterEnvironment();
     createTimeSeries();
     generateData();
     registerUDF();
@@ -524,7 +521,7 @@ public class AnomalyIT {
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Test
diff --git a/integration-test/src/test/java/org/apache/iotdb/libudf/it/dmatch/DMatchIT.java b/integration-test/src/test/java/org/apache/iotdb/libudf/it/dmatch/DMatchIT.java
index 9a7c63a5f0..c83d600324 100644
--- a/integration-test/src/test/java/org/apache/iotdb/libudf/it/dmatch/DMatchIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/libudf/it/dmatch/DMatchIT.java
@@ -19,7 +19,6 @@
 
 package org.apache.iotdb.libudf.it.dmatch;
 
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.LocalStandaloneIT;
@@ -44,11 +43,9 @@ import static org.junit.Assert.fail;
 public class DMatchIT {
   @BeforeClass
   public static void setUp() throws Exception {
-    ConfigFactory.getConfig()
-        .setUdfCollectorMemoryBudgetInMB(5)
-        .setUdfTransformerMemoryBudgetInMB(5)
-        .setUdfReaderMemoryBudgetInMB(5);
-    EnvFactory.getEnv().initBeforeClass();
+    EnvFactory.getEnv().getConfig().getConfigNodeCommonConfig().setUdfMemoryBudgetInMB(5);
+    EnvFactory.getEnv().getConfig().getDataNodeCommonConfig().setUdfMemoryBudgetInMB(5);
+    EnvFactory.getEnv().initClusterEnvironment();
     createTimeSeries();
     generateData();
     registerUDF();
@@ -380,7 +377,7 @@ public class DMatchIT {
 
   @AfterClass
   public static void tearDown() throws Exception {
-    EnvFactory.getEnv().cleanAfterClass();
+    EnvFactory.getEnv().cleanClusterEnvironment();
   }
 
   @Ignore // TODO: This test case failed, please check the function implementation
diff --git a/integration-test/src/test/java/org/apache/iotdb/libudf/it/dprofile/DProfileIT.java b/integration-test/src/test/java/org/apache/iotdb/libudf/it/dprofile/DProfileIT.java
index 160dbf8ac6..8a9f3dc1da 100644
--- a/integration-test/src/test/java/org/apache/iotdb/libudf/it/dprofile/DProfileIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/libudf/it/dprofile/DProfileIT.java
@@ -19,7 +19,6 @@
 
 package org.apache.iotdb.libudf.it.dprofile;
 
-import org.apache.iotdb.it.env.ConfigFactory;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
 import org.apache.iotdb.itbase.category.LocalStandaloneIT;
@@ -45,11 +44,9 @@ public class DProfileIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
-    ConfigFactory.getConfig()
-        .setUdfCollectorMemoryBudgetInMB(5)
... 583 lines suppressed ...