This repository has been archived by the owner on Feb 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 40
Setting up Consul Cluster on 1 Node
Tanuja Shinde edited this page Jun 30, 2022
·
1 revision
sudo setenforce 0
sudo sed -i 's/^SELINUX=.*/SELINUX=permissive/g' /etc/selinux/config
sudo yum install -y wget unzip
export VER="1.6.2"
wget https://releases.hashicorp.com/consul/${VER}/consul_${VER}_linux_amd64.zip
unzip consul_${VER}_linux_amd64.zip
sudo mv consul /usr/local/bin/
# To verify Consul is properly installed, run consul -v on your system.
consul -v
consul --help
consul -autocomplete-install
complete -C /usr/local/bin/consul consul
sudo groupadd --system consul
sudo useradd -s /sbin/nologin --system -g consul consul
sudo mkdir -p /var/lib/consul /etc/consul.d
sudo chown -R consul:consul /var/lib/consul /etc/consul.d
sudo chmod -R 775 /var/lib/consul /etc/consul.d
$ sudo vi /etc/hosts
# Consul Cluster Servers
<eth-0-ip of node> <node-hostname> cortx-consul-server
# Example
10.230.241.63 ssc-vm-rhev4-2905.colo.seagate.com cortx-consul-server
# Consul systemd service unit file
[Unit]
Description=Consul Service Discovery Agent
Documentation=https://www.consul.io/
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=consul
Group=consul
ExecStart=/usr/local/bin/consul agent -server -ui \
-advertise=10.230.241.63 \
-bind=10.230.241.63 \
-data-dir=/var/lib/consul \
-node=cortx-consul-server \
-config-dir=/etc/consul.d
ExecReload=/bin/kill -HUP $MAINPID
KillSignal=SIGINT
TimeoutStopSec=5
Restart=on-failure
SyslogIdentifier=consul
[Install]
WantedBy=multi-user.target
Where:
10.230.241.63 is the eth0 IP address of the node -node: Consul Name of this node. Must be unique in the cluster.
# consul keygen
pzDVYxESgPSkPhBFudHU5w==
{
"advertise_addr": "10.230.241.63",
"bind_addr": "10.230.241.63",
"bootstrap_expect": 1,
"client_addr": "0.0.0.0",
"datacenter": "DC1",
"data_dir": "/var/lib/consul",
"domain": "consul",
"enable_script_checks": true,
"dns_config": {
"enable_truncate": true,
"only_passing": true
},
"enable_syslog": true,
"encrypt": "pzDVYxESgPSkPhBFudHU5w==",
"leave_on_terminate": true,
"log_level": "INFO",
"rejoin_after_leave": true,
"retry_join": [
"cortx-consul-server"
],
"server": true,
"start_join": [
"cortx-consul-server"
],
"ui": true
}
Note: Replace all occurrences of 10.230.241.63 with the correct eth0 IP address of the node and value of encrypt with your generated secret.
$ consul validate /etc/consul.d/config.json
Configuration is valid!
sudo systemctl start consul
sudo systemctl enable consul
consul members
systemctl status consul
You will be able to access consul URL using below endpoint:
http://cortx-consul-server:8500
For Confstore API consul endpoint would look like:
consul://cortx-consul-server:8500
-
Dev_Guide
-
Framework
-
Known-issues
-
Miscellaneous-Guides
-
Research
-
Setup-Guides
-
User-Guides
-
Alternative-method-for-removing-LVM-metadata-information-from-enclosure-volumes