You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "Hisoka-X (via GitHub)" <gi...@apache.org> on 2024/09/06 12:21:32 UTC

Re: [PR] [Docs] add docker cluster guide [seatunnel]

Hisoka-X commented on code in PR #7532:
URL: https://github.com/apache/seatunnel/pull/7532#discussion_r1747032954


##########
docs/en/start-v2/docker/docker.md:
##########
@@ -139,3 +137,122 @@ docker run --rm -it apache/seatunnel bash -c '<YOUR_FLINK_HOME>/bin/start-cluste
 docker run --rm -it apache/seatunnel bash -c '<YOUR_FLINK_HOME>/bin/start-cluster.sh && ./bin/start-seatunnel-flink-15-connector-v2.sh -c config/v2.streaming.conf.template'
 ```
 
+
+
+# Set Up With Docker In Cluster Mode
+
+> docker cluster mode is only support zeta engine.
+
+In this part, we will use docker to set up SeaTunnel Cluster with 1 master node and 2 worker nodes.
+
+And there has 2 ways to create cluster within docker.
+
+## 1. Use Docker-compose
+`docker-compose.yaml` :
+```yaml
+version: '3.8'
+
+services:
+  master:
+    image: apache/seatunnel
+    container_name: seatunnel_master
+    environment:
+      - ST_DOCKER_MEMBER_LIST=172.16.0.2,172.16.0.3,172.16.0.4    
+    entrypoint: >
+      /bin/sh -c "
+      /opt/seatunnel/bin/seatunnel-cluster.sh -r master
+      "    
+    ports:
+      - "5801:5801"  
+    networks:
+      seatunnel_network:
+        ipv4_address: 172.16.0.2
+
+  worker1:
+    image: apache/seatunnel
+    container_name: seatunnel_worker_1
+    environment:
+      - ST_DOCKER_MEMBER_LIST=172.16.0.2,172.16.0.3,172.16.0.4
+    entrypoint: >
+      /bin/sh -c "
+      /opt/seatunnel/bin/seatunnel-cluster.sh -r worker
+      " 
+    depends_on:
+      - master
+    networks:
+      seatunnel_network:
+        ipv4_address: 172.16.0.3
+
+  worker2:
+    image: apache/seatunnel
+    container_name: seatunnel_worker_2
+    environment:
+      - ST_DOCKER_MEMBER_LIST=172.16.0.2,172.16.0.3,172.16.0.4
+    entrypoint: >
+      /bin/sh -c "
+      /opt/seatunnel/bin/seatunnel-cluster.sh -r worker
+      " 
+    depends_on:
+      - master
+    networks:
+      seatunnel_network:
+        ipv4_address: 172.16.0.4
+
+networks:
+  seatunnel_network:
+    driver: bridge
+    ipam:
+      config:
+        - subnet: 172.16.0.0/24
+
+```
+
+run `docker-compose up` command to start the cluster.
+
+## 2. Use Docker Directly
+
+1. create a network
+```shell
+docker network create seatunnel-network
+```
+
+2. get this network's Gateway IP
+```shell
+docker network inspect seatunnel-network
+```
+![docker-network-gateway.png](../../../images/docker-network-gateway.png)
+
+3. start the nodes
+```shell
+## start master and export 5801 port 
+docker run -d --name seatunnel_master \
+    --network seatunnel-network \
+    --rm \
+    -e ST_DOCKER_MEMBER_LIST=172.18.0.1:5801 \ # set to the Gateway IP

Review Comment:
   Can we use host ip?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org