Skip to content

Commit ba96917

Browse files
HTHoumzp0514
authored andcommitted
# This is a combination of 15 commits.
# This is the 1st commit message: Fix query one sensor in a vector from memtable (apache#3056) Fix query one sensor in a vector from memtable # This is the commit message apache#2: [IOTDB-1310] Enable docker, docker-compose and testcontainer for End to end test (apache#3024) * enable TestCongtainer for E2E test for (singleNode and cluster) * remove duplicated operations in integration-test phase * move spotless:apply to a profile `spotless`, which is enabled by default. Co-authored-by: xiangdong huang <[email protected]> # This is the commit message apache#3: add sink interface # This is the commit message apache#4: 3 new event sinks # This is the commit message apache#5: add ts sink # This is the commit message apache#6: add ts sink # This is the commit message apache#7: add mqtt sink # This is the commit message apache#8: refactor sink module # This is the commit message apache#9: init package sink.manager # This is the commit message apache#10: rename SinkException # This is the commit message apache#11: remove id in config # This is the commit message apache#12: fix doc # This is the commit message apache#13: add test framework # This is the commit message apache#14: add alertmanager sink & test & doc # This is the commit message apache#15: beautify the doc
1 parent 42a04ac commit ba96917

File tree

50 files changed

+2605
-72
lines changed

Some content is hidden

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

50 files changed

+2605
-72
lines changed

.github/workflows/e2e.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ jobs:
3939
restore-keys: ${{ runner.os }}-m2
4040

4141
- name: Build Distribution Zip
42-
run: ./mvnw.sh -B -DskipTests clean package
42+
run: ./mvnw.sh -B -DskipTests clean install
4343

4444
- name: Build Docker Image
4545
run: |
46-
docker build . -f docker/src/main/Dockerfile -t "iotdb:$GITHUB_SHA"
46+
docker build . -f docker/src/main/Dockerfile-single -t "iotdb:$GITHUB_SHA"
4747
docker images
4848
4949
- name: Run Test Case ${{ matrix.case }}
@@ -52,3 +52,7 @@ jobs:
5252
- name: Clean Up
5353
if: ${{ always() }}
5454
run: bash test/e2e/cases/${{ matrix.case }}/cleanup.sh
55+
56+
- name: TestContainer
57+
run: |
58+
mvn -B integration-test -pl testcontainer

cli/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@
9696
<phase>integration-test</phase>
9797
<goals>
9898
<goal>integration-test</goal>
99-
<goal>verify</goal>
10099
</goals>
101100
</execution>
102101
</executions>

cluster/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@
202202
<phase>integration-test</phase>
203203
<goals>
204204
<goal>integration-test</goal>
205-
<goal>verify</goal>
206205
</goals>
207206
</execution>
208207
</executions>

cluster/src/assembly/resources/conf/iotdb-cluster.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#-------------------------------------------IMPORTANT---------------------------------------------#
3030

3131
# used for communication between cluster nodes, eg heartbeat、raft logs and snapshots etc.
32+
# if this parameter is commented, then the IP that binded by the hostname will be used.
3233
internal_ip=127.0.0.1
3334

3435
# port for metadata service
@@ -51,7 +52,8 @@ internal_data_port=40010
5152
# nodes that already in the cluster, unnecessary to be the nodes that were used to build the
5253
# initial cluster by start-node.sh(.bat). Several nodes will be picked randomly to send the
5354
# request, the number of nodes picked depends on the number of retries.
54-
seed_nodes=127.0.0.1:9003,127.0.0.1:9005,127.0.0.1:9007
55+
#seed_nodes=127.0.0.1:9003,127.0.0.1:9005,127.0.0.1:9007
56+
seed_nodes=127.0.0.1:9003
5557

5658
# whether to use thrift compressed protocol for internal communications. If you want to change
5759
# compression settings for external clients, please modify 'rpc_thrift_compression_enable' in

cluster/src/main/java/org/apache/iotdb/cluster/ClusterMain.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ private static void startServerCheck() throws StartupException {
157157
config.getSeedNodeUrls().size(), quorum);
158158
throw new StartupException(metaServer.getMember().getName(), message);
159159
}
160+
160161
// assert not duplicated nodes
161162
Set<Node> seedNodes = new HashSet<>();
162163
for (String url : config.getSeedNodeUrls()) {

cluster/src/main/java/org/apache/iotdb/cluster/config/ClusterConfig.java

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,26 @@
2121
import org.apache.iotdb.cluster.utils.ClusterConsistent;
2222
import org.apache.iotdb.db.conf.IoTDBDescriptor;
2323

24+
import org.slf4j.Logger;
25+
import org.slf4j.LoggerFactory;
26+
27+
import java.net.InetAddress;
28+
import java.net.UnknownHostException;
2429
import java.util.Arrays;
2530
import java.util.List;
2631
import java.util.concurrent.TimeUnit;
2732

2833
public class ClusterConfig {
29-
34+
private static Logger logger = LoggerFactory.getLogger(ClusterConfig.class);
3035
static final String CONFIG_NAME = "iotdb-cluster.properties";
3136

32-
private String internalIp = "127.0.0.1";
37+
private String internalIp;
3338
private int internalMetaPort = 9003;
3439
private int internalDataPort = 40010;
3540
private int clusterRpcPort = IoTDBDescriptor.getInstance().getConfig().getRpcPort();
3641

3742
/** each one is a {internalIp | domain name}:{meta port} string tuple. */
38-
private List<String> seedNodeUrls =
39-
Arrays.asList(String.format("%s:%d", internalIp, internalMetaPort));
43+
private List<String> seedNodeUrls;
4044

4145
@ClusterConsistent private boolean isRpcThriftCompressionEnabled = false;
4246
private int maxConcurrentClientNum = 10000;
@@ -164,6 +168,21 @@ public class ClusterConfig {
164168

165169
private boolean openServerRpcPort = false;
166170

171+
/**
172+
* create a clusterConfig class. The internalIP will be set according to the server's hostname. If
173+
* there is something error for getting the ip of the hostname, then set the internalIp as
174+
* localhost.
175+
*/
176+
public ClusterConfig() {
177+
try {
178+
internalIp = InetAddress.getLocalHost().getHostAddress();
179+
} catch (UnknownHostException e) {
180+
logger.error(e.getMessage());
181+
internalIp = "127.0.0.1";
182+
}
183+
seedNodeUrls = Arrays.asList(String.format("%s:%d", internalIp, internalMetaPort));
184+
}
185+
167186
public int getSelectorNumOfClientPool() {
168187
return selectorNumOfClientPool;
169188
}

cross-tests/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@
7373
<phase>integration-test</phase>
7474
<goals>
7575
<goal>integration-test</goal>
76-
<goal>verify</goal>
7776
</goals>
7877
</execution>
7978
</executions>

docker/src/main/Dockerfile-cluster

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
# docker build context is the root path of the repository
21+
22+
FROM openjdk:11-jre-slim
23+
24+
ADD distribution/target/apache-iotdb-*-cluster-bin.zip /
25+
26+
RUN apt update \
27+
&& apt install lsof procps unzip -y \
28+
&& unzip /apache-iotdb-*-bin.zip -d / \
29+
&& rm /apache-iotdb-*-bin.zip \
30+
&& mv /apache-iotdb-* /iotdb \
31+
&& apt remove unzip -y \
32+
&& apt autoremove -y \
33+
&& apt purge --auto-remove -y \
34+
&& apt clean -y
35+
36+
EXPOSE 6667
37+
EXPOSE 31999
38+
EXPOSE 5555
39+
EXPOSE 8181
40+
VOLUME /iotdb/data
41+
VOLUME /iotdb/logs
42+
ENV PATH="/iotdb/sbin/:/iotdb/tools/:${PATH}"
43+
ENTRYPOINT ["/iotdb/sbin/start-node.sh"]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
FROM openjdk:11-jre-slim
2323

24-
ADD distribution/target/apache-iotdb-*-all-bin.zip /
24+
ADD distribution/target/apache-iotdb-*-server-bin.zip /
2525

2626
RUN apt update \
2727
&& apt install lsof procps unzip -y \

0 commit comments

Comments
 (0)