Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deploy DolphinDB Cluster in Docker

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article is about how to deploy DolphinDB clusters in Docker. I think it is very practical, so I share it with you. I hope you can get something after reading this article. Let's take a look at it.

Docker is an open source engine that can easily create a lightweight, portable, self-sufficient container for any application. DolphinDB database provides a docker-based distributed cluster deployment package, which allows users to deploy DolphinDB distributed clusters easily and quickly.

The goal of this tutorial is to build a 5-node multi-machine cluster with 4 centos containers. The final cluster is as follows:

When deploying a distributed cluster, you need to configure the network IP and ports of the controller node (controller), the agent node (agent), and the data node (datanode), respectively. The deployment package provided in this tutorial builds a virtual subnet between docker containers and assigns four containers four fixed IP addresses from 10.5.0.2 to 10.5.0.5. The configuration file containing this information has been built into the deployment package, and users no longer need to specify them manually. The built-in network IP and port assignments are as follows:

Controller.cfg:

LocalSite=10.5.0.5:8888:master

Agent1.cfg:

Mode=agentlocalSite=10.5.0.2:8710:P1-agent,agentcontrollerSite=10.5.0.5:8888:master

Cluster.nodes:

LocalSite,mode10.5.0.2:8710:P1-agent,agent10.5.0.2:8711:P1-node1,datanode10.5.0.2:8712:P1-node2,datanode10.5.0.3:8810:P2-agent,agent10.5.0.3:8811:P2-node1,datanode10.5.0.3:8812:P2-node2,datanode10.5.0.4:8910:P3-agent,agent10.5.0.4:8911:P3-node1,datanode

Because the UDP protocol does not work properly in the docker virtual network environment, you need to add the configuration item lanCluster=0 to agent.cfg and cluster.cfg, which has been added by default in the configuration file in the deployment package.

Before deploying the cluster, you need to build a docker environment. For more information, please refer to the docker installation tutorial and docker-compose installation tutorial.

1. Download and compile the DolphinDB docker cluster deployment package

Download the DolphinDB docker deployment package from https://github.com/dolphindb/Tutorials_CN/blob/master/docker/DolphinDB-Docker-Compose.zip.

Use the following steps to get an image file containing the latest version of DolphinDB server:

Cd. / DolphinDB-Docker-Compose/Dockerbuilddocker build-t ddb:latest. /

When the compilation is complete, use docker images to view:

$docker imagesREPOSITORY TAG IMAGE ID CREATED SIZEddb latest 4268ac618977 5 seconds ago 420MB2. Replace the license file in the deployment package

The license file in the Community Edition cannot support the deployment of 5 data nodes and 1 control node, so you need to apply for an Enterprise license that supports more than 6 nodes and place the Enterprise license file dolphindb.lic in the. / cfg file directory.

3. Create the required containers for controller and agent, and start the container

The default startup script in the container automatically starts the control node and the agent node.

Cd. / DolphinDB-Docker-Composedocker-compose up-d

The output after execution is as follows:

$docker-compose up-dCreating network "20190121-dolphindb-docker-compose_dbnet" with driver "bridge" Creating ddbcontroller... DoneCreating ddbagent2... DoneCreating ddbagent3... DoneCreating ddbagent1... Done4. View Cluster

Through the above steps, the creation, startup and initialization of the distributed cluster have been completed. Visit the address http://localhost:8888 to access the web page of cluster management. Start all data nodes in Web, and the final interface is as follows:

The above is how to deploy DolphinDB clusters in Docker. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report