jixuan1989 opened a new pull request #69: Enable docker image
URL: https://github.com/apache/incubator-iotdb/pull/69
 
 
   Now a Dockerfile has been written at ROOT/docker/Dockerfile on the branch 
enable_docker_image.
   
   1. You can build a docker image by: 
   ```
   $ docker build -t iotdb:base 
https://github.com/apache/incubator-iotdb#enable_docker_image:docker
   ```
   Or:
   ```
   $ git clone https://github.com/apache/incubator-iotdb
   $ cd incubator-iotdb
   $ git checkout -b enable_docker_image origin/enable_docker_image
   $ docker build -t iotdb:base .
   ```
   Once the docker image has been built locally (the tag is iotdb:base in this 
example), you are almost done!
   
   2. create docker volume for data files and logs:
   ```
   $ docker volume create mydata
   $ docker volume create mylogs
   ```
   3. run a docker container:
   ```shell
   $ docker run -p 6667:6667 -v mydata:/iotdb/data -v mylogs:/iotdb/logs -d 
iotdb:base /iotdb/bin/start-server.sh
   ```
   If success, you can run `docker ps`, and get something like the following:
   ```
   CONTAINER ID        IMAGE               COMMAND                  CREATED     
        STATUS              PORTS                               NAMES
   2a68b6944cb5        iotdb:base          "/iotdb/bin/start-se…"   4 minutes 
ago       Up 5 minutes        0.0.0.0:6667->6667/tcp              
laughing_meitner
   ```
   You can use the above command to get the container ID: 
   ```
   $ docker container ls
   ```
   suppose the ID is <C_ID>.
   
   And get the docker IP by:
   ```
   $ docker inspect --format='{{.NetworkSettings.IPAddress}}' <C_ID>
   ```
   suppose the IP is <C_IP>.
   
   4. If you just want to have a try by using iotdb-cli, you can:
   ```
   $ docker exec -it /bin/bash  <C_ID>
   $ (now you have enter the container): /cli/bin/start-client.sh -h localhost 
-p 6667 -u root -pw root
   ```
   
   Or,  run a new docker container as the client:
   ```
   $ docker run -it iotdb:base /cli/bin/start-client.sh -h <C_IP> -p 6667 -u 
root -pw root
   ```
   Or,  if you have a iotdb-cli locally (e.g., you have compiled the source 
code by `mvn package`), and suppose your work_dir is cli/bin, then you can just 
run:
   ```
   $ start-client.sh -h localhost -p 6667 -u root -pw root
   ```
   5. If you want to write codes to insert data and query data, please add the 
following dependence:
   ```xml
           <dependency>
               <groupId>org.apache.iotdb</groupId>
               <artifactId>iotdb-jdbc</artifactId>
               <version>0.8.0-SNAPSHOT</version>
           </dependency>
   ```
   Some example about how to use IoTDB with IoTDB-JDBC can be found at: 
https://github.com/apache/incubator-iotdb/tree/master/jdbc/src/test/java/org/apache/iotdb/jdbc/demo
   
   (Notice that because we have not published Apache IoTDB version 0.8.0 now, 
you have to compile the source code by `mvn install -DskipTests` to install the 
dependence into your local maven repository)
   
   6. Now enjoy it!
   
   Things TODO:
   
   1. A Grafana service is not installed now. If installed and configured, you 
can visualize time series by Grafana.
   2. A Kubernetes files is not provided now.
   3. JMX port and postback module port are not exposed now.
   4. Change the number of the max open files.  
   5. Using docker parameters to set more configurations of IoTDB (e.g., port, 
ip, user password, memory limit etc..).
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to