NosDB
Open-source Software
Database Management
Node Addition
Technology Tutorial

How to add second node in NosDB opensource?

Master System Design with Codemia

Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.

NosDB is a 100% native .NET open source NoSQL database that is highly scalable and distributed. Expanding your NosDB database by adding a second node is a critical step in scaling your database infrastructure to better handle increased load and provide redundancy. Here's a step-by-step guide to adding a second node in NosDB, as well as some important considerations and concepts.

Step 1: Prerequisites

Before you begin, ensure that you have the following:

  • Two or more servers or virtual machines running Windows (where NosDB is supported).
  • NosDB installed on both the primary and the new node.
  • Network connectivity between both nodes with necessary ports open (default is 9950-9953).

Step 2: Configure the New Node

On the new machine where NosDB is installed, you need to configure it to join your existing cluster.

  1. Edit Configuration: Locate the nosdb.config file in your NosDB installation directory, typically found under C:\Program Files\NosDB\.
  2. Change Cluster Settings: Specify the cluster connection string to point to the existing cluster. Set the Deployment and Reporting nodes to the address of the current primary node.

Example configuration might look like the following:

xml
1<configuration>
2  <cluster name="MyCluster">
3    <shard name="MainShard">
4      <servers>
5        <server name="PrimaryNode" address="192.168.1.1"/>
6        <server name="SecondaryNode" address="192.168.1.2" joining="true"/>
7      </servers>
8    </shard>
9  </cluster>
10</configuration>

Note: Change IP addresses according to your network setup.

Step 3: Start NosDB Service on New Node

After updating the configuration, start the NosDB service on the new node. Ensure that the service is running and has network access to the primary node. In Windows, you can manage this through the Services management console (services.msc).

Step 4: Add Node via Management Studio

Open NosDB Management Studio on your primary node or where it's accessible.

  1. Navigate to the Cluster: Go to the cluster management section.
  2. Add New Node: There should be an option to Add Node. Select the new node that you’ve configured. The Management Studio will communicate with the new node using the information provided and integrate it into the cluster.

Step 5: Synchronize and Verify

Once the node is added, the cluster will begin the synchronization process. This is critical as it ensures that the new node has all the data necessary to operate as part of the cluster.

  • Monitor the Synchronization: You can monitor this process in the NosDB Management Studio.
  • Check Logs: Ensure that there are no errors in the NosDB logs located typically in the logs directory of the installation path.

Key Considerations

Here are some points to keep in mind when adding a node to NosDB:

ConsiderationDescription
Network ConfigurationEnsure all nodes can communicate over the network; necessary ports are open.
Configuration SyncConfiguration files on all nodes need to be consistent, except the joining tag.
Data SynchronizationInitial sync might take time depending on the data size. Monitor the progress.
Cluster Health ChecksRegularly check the cluster health through NosDB Management Studio.

Conclusion

Adding a second node to NosDB is straightforward if the steps above are followed. Always ensure that your configuration files are correctly set up and that the network settings allow for seamless communication between nodes. Regular monitoring and maintenance of the cluster ensure its health and performance.

By approaching this process methodically, you ensure a robust setup that leverages NosDB’s capabilities for scalable, distributed data management. This addition not only improves the fault tolerance of your NosDB deployment but also enhances its performance through load distribution across multiple nodes.


Course illustration
Course illustration

All Rights Reserved.