Cluster

    Enter the dnode_endpoint in hostname:port format. You can also specify the hostname and port as separate parameters.

    Create the dnode before starting the corresponding dnode process. The dnode can then join the cluster based on the value of the firstEp parameter. Each dnode is assigned an ID after it joins a cluster.

    View Dnodes

    The preceding SQL command shows all dnodes in the cluster with the ID, endpoint, and status.

    Delete a DNODE

    1. DROP DNODE {dnode_id | dnode_endpoint}

    You can delete a dnode by its ID or by its endpoint. Note that deleting a dnode does not stop its process. You must stop the process after the dnode is deleted.

    Modify Dnode Configuration

    1. ALTER DNODE dnode_id dnode_option
    2. ALTER ALL DNODES dnode_option
    3. dnode_option: {
    4. 'resetLog'
    5. | 'balance' 'value'
    6. | 'monitor' 'value'
    7. | 'debugFlag' 'value'
    8. | 'monDebugFlag' 'value'
    9. | 'vDebugFlag' 'value'
    10. | 'mDebugFlag' 'value'
    11. | 'httpDebugFlag' 'value'
    12. | 'qDebugflag' 'value'
    13. | 'sdbDebugFlag' 'value'
    14. | 'uDebugFlag' 'value'
    15. | 'tsdbDebugFlag' 'value'
    16. | 'sDebugflag' 'value'
    17. | 'rpcDebugFlag' 'value'
    18. | 'dDebugFlag' 'value'
    19. | 'wDebugFlag' 'value'
    20. | 'tmrDebugFlag' 'value'
    21. | 'cqDebugFlag' 'value'
    22. }

    is the value of the parameter, which needs to be in character format. For example, modify the log output level of dnode 1 to debug:

    1. CREATE MNODE ON DNODE dnode_id

    TDengine automatically creates an mnode on the firstEp node. You can use this statement to create more mnodes for higher system availability. A cluster can have a maximum of three mnodes. Each dnode can contain only one mnode.

    View Mnodes

    1. SHOW MNODES;

    This statement shows all mnodes in the cluster with the ID, dnode, and status.

    Delete an Mnode

    1. DROP MNODE ON DNODE dnode_id;

    This statement deletes the mnode located on the specified dnode.

    Create a Qnode

    1. SHOW QNODES;

    This statement shows all qnodes in the cluster with the ID and dnode.

    Delete a Qnode

    1. DROP QNODE ON DNODE dnode_id;

    This statement deletes the mnode located on the specified dnode. This does not affect the status of the dnode.

    Modify Client Configuration

    The client configuration can also be modified in a similar way to other cluster components.

    1. ALTER LOCAL local_option
    2. local_option: {
    3. 'resetLog'
    4. | 'rpcDebugFlag' 'value'
    5. | 'tmrDebugFlag' 'value'
    6. | 'cDebugFlag' 'value'
    7. | 'uDebugFlag' 'value'
    8. }

    The parameters that you can modify through this statement are the same as those located in the client configuration file. Modifications that you make through this statement take effect immediately, while modifications to the configuration file take effect when the client restarts.

    View Client Configuration