Enable Consul Server and GUI Dashboard

How To Install Consul by HashiCorp on Ubuntu 20.04 LTS

Posted on

Be taught the instructions to put in Consul by HashiCorp on Ubuntu 20.04 LTS Focal Fossa utilizing the terminal to resolve the networking and safety challenges of working microservices.

Consul is an open-source multi-networking software that provides a fully-featured service mesh answer that solves the networking and safety challenges of working microservices and cloud infrastructure (multi-cloud and hybrid cloud).

Consul manages companies and nodes within the type of a “listing service”, i.e. within the type of what runs the place? Entry is by way of DNS or HTTP(s). Consul operates in both Server or Agent mode. The servers retailer the information, if a number of are used, the information is robotically synchronized.

The info may be accessed immediately on the servers by way of DNS or HTTP(s) or by way of the required agent anyway. Any node or host logs on to Consul by way of the agent and is registered as a node. Providers may also be registered. An internet server, for instance, registers as a brand new cluster member to an current service. As well as, tags may also be set, which then show themselves as aliases by way of DNS question.

Steps to Set up Consul on Ubuntu 20.04 Server

The command given right here can be utilized for different working methods primarily based on Ubuntu or Debian comparable to Linux Mint, POP OS, and extra…

1. Replace the server

Entry your command terminal immediately or utilizing SSH. After that run the system replace command to verify it’s in its newest state.

sudo apt replace && sudo apt improve

2. Add Hashicorp GPG Key

To fetch and set up the packages of the Consul, we’d like a GPG key utilized by the Hashicorp builders to signal the packages of the Consul. The general public key helps our system to make sure the packages we’re getting are as they had been launched.

wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg

3. Add Consul repository in Ubuntu 20.04

The packages to put in Consul on Ubuntu 20.04 Linux aren’t obtainable to obtain utilizing the default system repository. Therefore, add the one offered formally by the Hashicorp to put in the Consul.

echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) predominant" | sudo tee /and so on/apt/sources.checklist.d/hashicorp.checklist

Rebuild APT packages index cache:

sudo apt replace

4. Set up Consul on Ubuntu 20.04

After you have adopted the all above given steps, we are able to simply set up the Consul utilizing the APT package deal supervisor like some other software. Right here is the command:

sudo apt set up consul

5. Confirm the set up

To examine the set up is finished efficiently on the system, let’s examine the model of Consul utilizing its command line software.

consul model

Different Consul choices:

[email protected]: consul
Utilization: consul [--version] [--help] <command> [<args>]

Accessible instructions are:
acl          Work together with Consul's ACLs
agent        Runs a Consul agent
catalog      Work together with the catalog
config       Work together with Consul's Centralized Configurations
join      Work together with Consul Join
debug        Data a debugging archive for operators
occasion        Hearth a brand new occasion
exec         Executes a command on Consul nodes
force-leave  Forces a member of the cluster to enter the "left" state
data         Supplies debugging data for operators.
intention    Work together with Join service intentions
be part of         Inform Consul agent to affix cluster
keygen       Generates a brand new encryption key
keyring      Manages gossip layer encryption keys
kv           Work together with the key-value retailer
go away        Gracefully leaves the Consul cluster and shuts down
lock         Execute a command holding a lock
login        Login to Consul utilizing an auth methodology
logout       Destroy a Consul token created with login
maint        Controls node or service upkeep mode
members      Lists the members of a Consul cluster
monitor        Stream logs from a Consul agent
operator      Supplies cluster-level instruments for Consul operators
reload         Triggers the agent to reload configuration information
rtt                 Estimates community spherical journey time between nodes
companies      Work together with companies
snapshot     Saves, restores and inspects snapshots of Consul server state
tls                Builtin helpers for creating CAs and certificates
validate      Validate config information/directories
model       Prints the Consul model
watch         Look ahead to adjustments in Consul

6. Allow Server and GUI Dashboard

If you wish to entry the GUI Dashboard of the Consul then we have to allow the identical in its configuration file. Additionally, those that need to use the Consul in server and agent structure can allow that as effectively utilizing the identical file.

Simply edit:

sudo nano /and so on/consul.d/consul.hcl

Scroll and  take away the # tags from the next traces:

ui_config{
enabled = true
}
server = true
Enable Consul Server and GUI Dashboard

Save the file utilizing Ctrl+O, hit the Enter key, after which exit the editor utilizing Ctrl+X.

Now, restart the service of the Consul:

sudo systemctl restart consul

To entry the Dashboard, open your browser and level it to:

Word: For localhost solely

http://127.0.0.01:8500

Entry Remotely

To entry Consul Dashboard utilizing another system that may entry the Ip-address of the server the place you might have put in the Consul, create a configuration file for that:

sudo nano /and so on/consul.d/ui.json

Add the next traces:

{
"addresses": {
"http": "0.0.0.0"
}
}

Save the file.

Restart the Consul service:

sudo systemctl restart consul

Now, use the server IP deal with and port to entry the Dashboard:

http://server-ip:8500

Should you’re utilizing UFW or some other firewall then don’t neglect to open port 8500. Nevertheless, UFW customers can use:

ufw permit 8500/tcp

For extra data discuss with the official documentation:

Install Consul by HashiCorp on Ubuntu 20.04 LTS

The best way to replace

Sooner or later, to replace the put in consul software, the customers simply must run the system replace command. It’s as a result of we’ve used the packages repository to put in it.

sudo apt replace && sudo apt improve

Take away or uninstall Consul

In case resulting from some causes you need to utterly take away the Consul out of your Ubuntu 20.04 LTS system, then right here is the command to try this.

sudo apt autoremove --purge consul

Take away GPG key and repository, if wanted:

sudo rm /usr/share/keyrings/hashicorp-archive-keyring.gpg /and so on/apt/sources.checklist.d/hashicorp.checklist

Different Articles:

How to install Zabbix Agent on Debian 11 Bullseye
Install Sensu Go Monitoring on Ubuntu 22.04 or 20.04 LTS
Install Checkmk on Ubuntu 20.04 Server (Linux Nagios Monitoring)- Tutorial
How to Install Checkmk on Ubuntu 22.04 LTS Jammy Linux
Install Puppet Server & Agent on Rocky Linux or AlmaLinux 8

offshore vps