Getting Started

Cluster Configuration

A cluster should be properly configured before being started.

Note: The number of nodes, IP address, and port number in the following example are for illustration only. You can adjust the settings according to your actual deployment needs.

  • controller.cfg (configuration file for the controller): Set the port number of the controller to 8900 and enable the performance monitoring.

    mode=controller
    logFile=ctl.log
    localSite=localhost:8900:ctl8900
    perfMonitoring=1
  • agent.cfg (configuration file for the agent): Set the port number of the agent to 8988 and specify the controller (port number: 8900).

    mode=agent
    localSite=localhost:8988:agent
    controllerSite=localhost:8900:ctl8900
  • cluster.nodes (configuration file for nodes within the cluster): Specify the agent (port number: 8988) of the cluster, a data node (port number: 8811), and a compute node (port number: 8812).

    localSite,mode
    localhost:8988:agent,agent
    localhost:8811:DFS_NODE1,datanode
    localhost:8812:DFS_NODE2,computenode

Login

  • In standalone mode, after starting the DolphinDB server, enter the URL in the browser (default: http://localhost:8848) to access the web interface.

  • In cluster mode, enter the URL and port number of the controller in the browser to access.

If you fail to access the web interface, make sure that:

  • The DolphinDB server license is not expired;

  • The port of the node is not blocked by the firewall;

  • The web directory is under the server directory.

In the Linux environment, if the port is blocked, try the following commands:

  1. Query the firewall zones active for every network interface in your system.

    firewall-cmd --get-active-zones
    // output
    public
    interfaces: eth1
  2. Add the TCP port 8848 to the "public" firewall zone with permanent validity.

    sudo firewall-cmd --zone=public --permanent --add-port=8848/tcp

    If the command returns success, it indicates that port 8848 is open and ready for network communication.

You can use the DolphinDB Web client without logging in, but some functions, such as viewing databases/ tables and creating distributed databases/tables, can only be used after logging in.

To require users to log in before executing any script, add webLoginRequired=true to server/dolphindb.cfg in standalone mode and to controller.cfg and cluster.cfg in cluster mode.

After successful login, the username will be displayed in the upper right corner of the interface. If no command is executed for 10 minutes, the account will automatically log out.

Cluster Startup

Linux

  • Method 1

    Navigate to /DolphinDB/server and execute the following Shell command (file permissions need to be modified upon the first startup):

    chmod +x dolphindb

    Navigate to /DolphinDB/server/clusterDemo and execute the following Shell command to start the controller:

    sh startController.sh

    Start the agent:

    sh startAgent.sh

    Execute the following command to check whether the node starts successfully:

    ps aux|grep dolphindb
  • Method 2

    Open a command line window in the foreground mode and execute the following script to start the controller:

    ./dolphindb -mode controller -home data -config config/controller.cfg -clusterConfig config/cluster.cfg -logFile log/controller.log -nodesFile config/cluster.nodes

    Open another command line window and execute the following script to start the agent:

    nohup ./dolphindb -console 0 -mode agent -home data -config config/agent.cfg -logFile log/agent.log &
  • Method 3

    Open a command line window in the background mode and execute the following script to start the controller:

    nohup ./dolphindb -console 0 -mode controller -home data -config config/controller.cfg -clusterConfig config/cluster.cfg -logFile log/controller.log -nodesFile config/cluster.nodes &

    Open another command line window and execute the following script to start the agent:

    nohup ./dolphindb -console 0 -mode agent -home data -config config/agent.cfg -logFile log/agent.log &

Windows

  • Method 1

    To start the controller and the agent in the foreground, double-click startController.bat and startAgent.bat under C:\DolphinDB\server\clusterDemo.

  • Method 2

    To start the controller and the agent in the background, double-click backgroundStartController.vbs and backgroundStartAgent.vbs under C:\DolphinDB\server\clusterDemo.

  • Method 3

    Open a command prompt and execute the following script to start the controller:

    dolphindb.exe -mode controller -home data -script config/dolphindb.dos -config config/controller.cfg -logFile log/controller.log -nodesFile config/nodes.cfg -clusterConfig config/cluster.cfg

    Open another command line window and execute the following script to start the agent:

    dolphindb.exe -mode agent -home data -script config/dolphindb.dos -config config/agent.cfg -logFile log/agent.log

Node Startup

In the web interface, you can start or stop data nodes and compute nodes and modify cluster configurations. Start the controller and the agent, and enter <Host IP>:<Port> of the controller (which is configured in controller.cfg) in the address bar of the browser.

For details about how to start nodes in the cluster mode, see Cluster.

Note: If the status of nodes doesn't refresh after clicking 🔁, you can manually refresh the web page (Shift + F5) or check the system logs in the Log tab to identify the specific reasons, such as:

  • expired license

  • node port occupied by other processes

  • metadata recovery in progress

  • license-specified maximum node count exceeded