GNU/Linux >> Linux Esercitazione >  >> Cent OS

Hashicorp Nomad Cluster Lab su Centos e RockyLinux

Introduzione

Abbiamo cercato modi alternativi per utilizzare le risorse del server per un po' di tempo, un approccio semplice per l'installazione. Potrebbe non essere pronto per la produzione, abbastanza sicuro che valga la pena configurarlo per lo sviluppo. Un orchestratore che ci semplifica la vita. È uno strumento di gestione dell'automazione. La sua fornitura, distribuzione, attivazione, monitoraggio, misurazione, monitoraggio e garanzia della sicurezza del robot nell'organizzazione.

Quindi Kubernetes realizzato per i container da Google. Intende fornire tutte le funzionalità per le applicazioni container Linux, tra cui gestione dei cluster, pianificazione, rilevamento dei servizi, monitoraggio, gestione dei segreti e altro ancora. Hashicorp nomad si concentra solo sulla gestione e pianificazione dei cluster ed è progettato con Filosofia Unix con una portata ridotta. Strumenti di composizione della console per la mesh del servizio di rilevamento dei servizi e la gestione remota del Vault.

Inoltre, Kubernetes è una raccolta di molti servizi interoperativi con funzionalità complete. Archiviazione e coordinamento forniti da etcd al centro.

Inoltre, lo stato è costituito dai controller API utilizzati da altri servizi che offrono funzionalità API di alto livello come scheduler.Kubernetes supporta l'elevata disponibilità per la configurazione di operazioni complesse da configurare.

Anche Nomad è molto più semplice. Un singolo binario per client e server non richiede servizi esterni per il coordinamento o l'archiviazione. Combina un gestore leggero e uno scheduler sofisticato. distribuito, altamente disponibile e operativamente semplice.

Inoltre è disponibile come binario precompilato per quasi tutti i sistemi operativi. Per macOS, puoi ottenerlo da Homebrew gratuitamente e open source. Per Windows, installa il dal cioccolatoso gestore di pacchetti open source. Con Linux, usa yum, dnf o apt per installare il pacchetto.

Installazione Hashicorp nomand nel tuo sistema utilizzando dnf

Quindi Hashicorp mantiene e firma i pacchetti per il proprio repository.

Quindi crea questo file su /etc/yum.repos.d/hashicorp.repo con il contenuto seguente. Lo faresti per favore a tutti i nodi master e slave?

Nomad – Collegamento alla documentazione

# vi /etc/yum.repos.d/hashicorp.repo
[hashicorp]
name=Hashicorp Stable - $basearch
baseurl=https://rpm.releases.hashicorp.com/RHEL/$releasever/$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://rpm.releases.hashicorp.com/gpg

[hashicorp-test]
name=Hashicorp Test - $basearch
baseurl=https://rpm.releases.hashicorp.com/RHEL/$releasever/$basearch/test
enabled=0
gpgcheck=1
gpgkey=https://rpm.releases.hashicorp.com/gpg

Installazione nomade Hashicorp utilizzando yum

# dnf -y install nomad 
Last metadata expiration check: 0:11:47 ago on Sat 10 Jul 2021 07:10:43 AM UTC.
Dependencies resolved.
================================================================================================================ Package
          Architecture             Version                     Repository                   Size
================================================================================================================Installing:
 nomad                   x86_64                   1.1.2-1                     hashicorp                    26 M
 consul                       x86_64                       1.10.0-1                       hashicorp                        29 M

Transaction Summary
================================================================================================================Install  1 Pack
age

Total download size: 26 M
Installed size: 82 M
Downloading Packages:
nomad-1.1.2-1.x86_64.rpm                                                                       1.6 MB/s |  26 MB 
    00:15

-------------------------------------------------------------------------------------------------------------------------------
Total                                                                                          1.6 MB/s |  55 MB     00:15
warning: /var/cache/dnf/hashicorp-164999f2fbadbd87/packages/nomad-1.1.2-1.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID a3
219f7b: NOKEY
Hashicorp Stable - x86_64                                                                      666  B/s | 3.1 kB     00:04
Importing GPG key 0xA3219F7B:
 Userid     : "HashiCorp Security (HashiCorp Package Signing) <[email protected]>"
 Fingerprint: E8A0 32E0 94D8 EB4E A189 D270 DA41 8C88 A321 9F7B
 From       : https://rpm.releases.hashicorp.com/gpg
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                       1/2
  Running scriptlet: nomad-1.1.2-1.x86_64                                                                                  2/2
Running scriptlet: consul-1.10.0-1.x86_64                                                                                  1/2
  Installing       : nomad-1.1.2-1.x86_64                                                                                  2/2
Installing       : consul-1.10.0-1.x86_64                                                                                  1/2
  Running scriptlet: nomad-1.1.2-1.x86_64                                                                                  2/2
  Verifying        : nomad-1.1.2-1.x86_64                                                                                1/2
Verifying        : consul-1.10.0-1.x86_64                                                                                2/2

Installed:
  nomad-1.1.2-1.x86_64    consul.x86_64

Complete!
[root@master8 ~]#

Nomade Hashicorp verifica l'installazione

# nomad
Usage: nomad [-version] [-help] [-autocomplete-(un)install] <command> [args]

Common commands:
    run         Run a new job or update an existing job
    stop        Stop a running job
    status      Display the status output for a resource
    alloc       Interact with allocations
    job         Interact with jobs
    node        Interact with nodes
    agent       Runs a Nomad agent

Other commands:
    acl                 Interact with ACL policies and tokens
    agent-info          Display status information about the local agent
    deployment          Interact with deployments
    eval                Interact with evaluations
    exec                Execute commands in task
    license             Interact with Nomad Enterprise License
    monitor             Stream logs from a Nomad agent
    namespace           Interact with namespaces
    operator            Provides cluster-level tools for Nomad operators
    plugin              Inspect plugins
    quota               Interact with quotas
    recommendation      Interact with the Nomad recommendation endpoint
    scaling             Interact with the Nomad scaling endpoint
    sentinel            Interact with Sentinel policies
    server              Interact with servers
    system              Interact with the system API
    ui                  Open the Nomad Web UI
    version             Prints the Nomad version
    volume              Interact with volumes
[root@master8 ~]#

Installa l'agente anche su tutti i client

Quindi ora configura il server Leader per il cluster

[root@master ~]# cat /etc/nomad.d/nomad.hcl
# Full configuration options can be found at https://www.nomadproject.io/docs/configuration

data_dir = "/opt/nomad/data"
datacenter = "antipolo"

server {
  enabled = true
  bootstrap_expect = 1
}

[root@master ~]#

Configura i nodi client

[root@worker1 ~]# cat /etc/nomad.d/nomad.hcl
# Full configuration options can be found at https://www.nomadproject.io/docs/configuration

data_dir = "/opt/nomad/data"
datacenter = "antipolo"

client {
  enabled = true
  servers = ["192.168.56.101"]
}

[root@worker1 ~]#

[root@worker2 ~]# cat /etc/nomad.d/nomad.hcl
# Full configuration options can be found at https://www.nomadproject.io/docs/configuration

data_dir = "/opt/nomad/data"
datacenter = "antipolo"

client {
  enabled = true
  servers = ["192.168.56.101"]
}

[root@worker2 ~]#

Ora controlla il Leader se eletto

[root@master ~]# nomad server members
Name                       Address         Port  Status  Leader  Protocol  Build  Datacenter  Region
master.example.com.global  192.168.56.101  4648  alive   true    2         1.1.2  antipolo    global

Controlla lo stato dei nodi client

[root@worker1 ~]# nomad node status
ID        DC        Name                 Class   Drain  Eligibility  Status
522508a4  antipolo  worker2.example.com  <none>  false  eligible     ready
7a357baa  antipolo  worker1.example.com  <none>  false  eligible     ready

Conclusione

Questo tutorial serve a confrontare le capacità e le soluzioni alternative. Potremmo voler rimanere su ciò che stai usando.


Cent OS
  1. Come installare un cluster Kubernetes su CentOS 7

  2. Come installare Hashicorp Vault su CentOS 7

  3. Come configurare il cluster RabbitMQ su CentOS 7

  4. Come configurare il cluster di database Riak KV NoSQL su CentOS 7

  5. Come installare il cluster Percona XtraDB su CentOS 7

Come configurare il cluster ad alta disponibilità su CentOS 7 / RHEL 7

Come installare Openldap su RockyLinux o Centos 8 Passo dopo passo

Installa Proftpd su Centos e Rockylinux 8

Configura VCS su CentOS 8 | RHEL 8 passo dopo passo

Come configurare un cluster Redis in CentOS 8 – Parte 3

Come installare il cluster Kubernetes su CentOS 8