[ 
https://issues.apache.org/jira/browse/IOTDB-5227?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xiangdong Huang reassigned IOTDB-5227:
--------------------------------------

    Assignee: changxue

> docker module improvement
> -------------------------
>
>                 Key: IOTDB-5227
>                 URL: https://issues.apache.org/jira/browse/IOTDB-5227
>             Project: Apache IoTDB
>          Issue Type: Improvement
>            Reporter: Xiangdong Huang
>            Assignee: changxue
>            Priority: Major
>
> in v1.0, current docker module has some issues:
>  
> 1. Readme.md file:
> 1.1 no instruction about "The definition of tag "latest""
> 1.2 How to build
> Normally, we do not create any temporary folder in the root path. 
> Therefore, please move "tmp" folder to target/tmp.
> Besides, readme should be a "step-by-step" instruction. So, we need to say 
> how to get release files first (mvn package -DskipTests. or download zip file 
> from the internet, which IMO is more suggestted, because in this way, we can 
> make sure the v1.0's docker image has no difference with the released 
> binaries, and that is why we download zip file from the internet in previous 
> dockerfile.), and then copy, and then give `docker build` command. 
> 1.3 How to run IoTDB
> "Since 1.0.0, see [offical 
> documents.|https://iotdb.apache.org/UserGuide/Master/QuickStart/WayToGetIoTDB.html]";
>  -> It is better to paste the simplest command here, and then give reference 
> for complex usage (like what we do now)
>  
>  
> 2. Website
> [https://iotdb.apache.org/UserGuide/Master/QuickStart/WayToGetIoTDB.html]
> {code:java}
> # get IoTDB official image
> docker pull apache/iotdb:1.0.0-1c1d
> # create docker bridge network
> docker network create --driver=bridge --subnet=172.18.0.0/16 
> --gateway=172.18.0.1 iotdb
> # create docker container
> docker run -d --name iotdb-service \
>               --hostname iotdb-service \
>               --network iotdb \
>               --ip 172.18.0.6 \
>               -p 26667:6667 \
>               -e cn_internal_address=iotdb-service \
>               -e cn_target_config_node_list=iotdb-service:22277 \
>               -e dn_rpc_address=iotdb-service \
>               -e dn_internal_address=iotdb-service \
>               -e dn_target_config_node_list=iotdb-service:22277 \
>               apache/iotdb:1.0.0-1c1d              
> # execute SQL
> docker exec -ti iotdb-service /iotdb/sbin/start-cli.sh -h iotdb-service {code}
>  
> a. Why use 26667 port? By default, we'd better keep it the same with port in 
> the container
> b. Why do we need set "network" and "ip" for this simple usage? If we do not 
> use the network and IP, is that possible to use the following command?
> {code:java}
> $IOTDB_HOME/sbin/start-cli.sh -h <IP Address/hostname> -p 26667 {code}
> Besides, which IP here it is? 172.18.0.6? or 127.0.0.1? (I mean, the hoster's 
> IP or the container's IP)
>  
> c. I notice that in our source code repo, Dockerfile-compose use 
> "172.20.0.6", why we use "172.18" here? If there is no reason, it is better 
> to keep consisent. Besides, why we use "*.*.0.6" ip?
>  
> d. If we need to store data, how to mount the volume? still `/iotdb/data` and 
> `/iotdb/logs` (for log) ?
>  
> 3. Website "Notice:The confignode service would fail when restarting this 
> container if the IP Adress of the container has been changed."
> Is this the reason that we have to claim the IP and network explicitly? If it 
> is, then put this sentence before the command.
>  
> 4. Website Docker-compose
> {code:java}
> # docker-compose-1c1d.yml
> version: "3"
> services:
>   iotdb-service:
>     image: apache/iotdb:1.0.0-1c1d
>     hostname: iotdb-service
>     container_name: iotdb-service
>     ports:
>       - "26667:6667"
>     environment:
>       - cn_internal_address=iotdb-service
>       - cn_target_config_node_list=iotdb-service:22277
>       - dn_rpc_address=iotdb-service
>       - dn_internal_address=iotdb-service
>       - dn_target_config_node_list=iotdb-service:22277
>     volumes:
>         - ./data:/iotdb/data
>         - ./logs:/iotdb/logs
>     networks:
>       iotdb:
>         ipv4_address: 172.18.0.6
> networks:
>   iotdb:
>     external: true {code}
> What is this for?
>  
> 5. Website dockercompose
> {code:java}
> version: "3"
> services:
>   iotdb-confignode:
>     image: apache/iotdb:1.0.0-confignode
>     container_name: iotdb-confignode
>     ports:
>       - "22277:22277"
>       - "22278:22278"
>     environment:
>       - cn_internal_address=iotdb-2
>       - cn_target_config_node_list=iotdb-1:22277
>       - schema_replication_factor=3
>       - 
> schema_region_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus
>       - 
> config_node_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus
>       - data_replication_factor=3
>       - 
> data_region_consensus_protocol_class=org.apache.iotdb.consensus.iot.IoTConsensus
>     volumes:
>       - /etc/hosts:/etc/hosts:ro
>       - ./data/confignode:/iotdb/data
>       - ./logs/confignode:/iotdb/logs
>     network_mode: "host"
>   iotdb-datanode:
>     image: apache/iotdb:1.0.0-datanode
>     container_name: iotdb-datanode
>     ports:
>       - "6667:6667"
>       - "8777:8777"
>       - "9003:9003"
>       - "50010:50010"
>       - "40010:40010"
>     environment:
>       - dn_rpc_address=iotdb-2
>       - dn_internal_address=iotdb-2
>       - dn_target_config_node_list=iotdb-1:22277
>       - data_replication_factor=3
>       - 
> data_region_consensus_protocol_class=org.apache.iotdb.consensus.iot.IoTConsensus
>        - schema_replication_factor=3
>       - 
> schema_region_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus
>       - 
> config_node_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus
>     volumes:
>       - /etc/hosts:/etc/hosts:ro
>       - ./data/datanode:/iotdb/data/
>       - ./logs/datanode:/iotdb/logs/
>     network_mode: "host" {code}
> Why we need to mount /etc/hosts? Besides, what is the meaning of ":ro"? give 
> the container write permission regarding to /etc/hosts? Is that safe?
>  
> For the datanode, we should expose all the ports that clients may use. (and 
> hide all posts that clients do not need)
>  
>  
> "Suppose that there are three computers of iotdb-1, iotdb-2 and iotdb-3. We 
> called them nodes. Here is the docker-compose file of iotdb-2, as the 
> sample:" 
> -> shoule be "as an example".
>  
> Besides, I am not familiar with docker compose. How about iotdb-1 and 
> iotdb-3? How to start them?
>  
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to