Skip to content

Commit

Permalink
Merge pull request #293 from gravitl/NET-948
Browse files Browse the repository at this point in the history
Net 948
  • Loading branch information
abhishek9686 authored Mar 28, 2024
2 parents 3ef887a + c424cd5 commit ae21ae0
Showing 1 changed file with 0 additions and 77 deletions.
77 changes: 0 additions & 77 deletions server-installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,6 @@ Restart netmaker.
Restart mosquitto.
You can check the status of caddy, mosquitto, and netmaker with ``journalctl -fu <ONE_OF_THOSE_THREE>`` to make sure everything is working.



.. _KubeInstall:

Kubernetes Install
Expand Down Expand Up @@ -776,81 +774,6 @@ Values

To view all options for the chart, please visit the README in the code repo `here <https://github.com/gravitl/netmaker/tree/master/kube/helm#values>`_ .

Highly Available Installation (VMs/Bare Metal)
==================================================

For a professional Netmaker installation, you will need a server that is highly available, to ensure redundant WireGuard routing when any server goes down. To do this, you will need:

1. A load balancer
2. 3+ Netmaker server instances
3. rqlite or PostgreSQL as the backing database

These documents outline general HA installation guidelines. Netmaker is highly customizable to meet a wide range of professional environments. If you would like support with a professional-grade Netmaker installation, you can `schedule a consultation here <https://gravitl.com/book>`_ .

The main consideration for this document is how to configure rqlite. Most other settings and procedures match the standardized way of making applications HA: Load balancing to multiple instances, and sharing a DB. In our case, the DB (rqlite) is distributed, making HA data more easily achievable.

If using PostgreSQL, follow their documentation for `installing in HA mode <https://www.postgresql.org/docs/14/high-availability.html>`_ and skip step #2.

1. Load Balancer Setup
------------------------

Your load balancer of choice will send requests to the Netmaker servers. Setup is similar to the various guides we have created for Nginx, Caddy, and Traefik. SSL certificates must also be configured and handled by the LB.

2. rqlite Setup
------------------

rqlite is the included distributed datastore for an HA Netmaker installation. If you have a different corporate database you wish to integrate, Netmaker is easily extended to other DB's. If this is a requirement, please contact us.

Assuming you use rqlite, you must run it on each Netmaker server VM, or alongside that VM as a container. Setup a config.json for database credentials (password supports BCRYPT HASHING) and mount in working directory of rqlite and specify with `-auth config.json` :

.. code-block::
[{
"username": "netmaker",
"password": "<YOUR_DB_PASSWORD>",
"perms": ["all"]
}]
Once your servers are set up with rqlite, the first instance must be started normally, and then additional nodes must be added with the "join" command. For instance, here is the first server node:

.. code-block::
sudo docker run -d -p 4001:4001 -p 4002:4002 rqlite/rqlite -node-id 1 -http-addr 0.0.0.0:4001 -raft-addr 0.0.0.0:4002 -http-adv-addr 1.2.3.4:4001 -raft-adv-addr 1.2.3.4:4002 -auth config.json
And here is a joining node:

.. code-block::
sudo docker run -d -p 4001:4001 -p 4002:4002 rqlite/rqlite -node-id 2 -http-addr 0.0.0.0:4001 -raft-addr 0.0.0.0:4002 -http-adv-addr 2.3.4.5:4001 -raft-adv-addr 2.3.4.5:4002 -join https://netmaker:<YOUR_DB_PASSWORD>@1.2.3.4:4001
- reference for rqlite setup: https://github.com/rqlite/rqlite/blob/master/DOC/CLUSTER_MGMT.md#creating-a-cluster
- reference for rqlite security: https://github.com/rqlite/rqlite/blob/master/DOC/SECURITY.md

Once rqlite instances have been configured, the Netmaker servers can be deployed.

3. Netmaker Setup
------------------

Netmaker will be started on each node with default settings, except with DATABASE=rqlite (or DATABASE=postgress) and SQL_CONN set appropriately to reach the local rqlite instance. rqlite will maintain consistency with each Netmaker backend.

If deploying HA with PostgreSQL, you will connect with the following settings:

.. code-block::
SQL_HOST = <sql host>
SQL_PORT = <port>
SQL_DB = <designated sql DB>
SQL_USER = <your user>
SQL_PASS = <your password>
DATABASE = postgres
4. Other Considerations
------------------------

This is enough to get a functioning HA installation of Netmaker. However, you may also want to make the Netmaker UI or the CoreDNS server HA as well. The Netmaker UI can simply be added to the same servers and load balanced appropriately. For some load balancers, you may be able to do this with CoreDNS as well.

Security Settings
==================

Expand Down

0 comments on commit ae21ae0

Please sign in to comment.