GNU/Linux >> Belajar Linux >  >> Cent OS

Hashicorp Nomad Cluster Lab di Centos &RockyLinux

Pengantar

Kami telah mencari cara alternatif untuk memanfaatkan sumber daya server untuk beberapa waktu sekarang pendekatan lurus ke depan untuk setup. Ini mungkin tidak siap produksi, cukup yakin itu layak disiapkan untuk pengembangan. Orkestra yang membuat hidup kita lebih mudah. Ini adalah alat manajemen otomatisasi. Penyediaannya, menerapkan, memicu, memantau, mengukur, melacak, dan memastikan keamanan robot dalam organisasi.

Jadi Kubernetes dibuat untuk container oleh Google. Ia bermaksud untuk menyediakan semua fitur untuk aplikasi container Linux, termasuk manajemen cluster, penjadwalan, penemuan layanan, pemantauan, manajemen rahasia, dan banyak lagi. Hashicorp nomad hanya berfokus pada manajemen dan penjadwalan cluster dan dirancang dengan Filosofi Unix memiliki cakupan kecil. Alat penyusun konsol untuk jaring layanan penemuan layanan &manajemen jarak jauh Vault.

Selain itu, Kubernetes adalah kumpulan dari banyak layanan yang saling beroperasi dengan fungsionalitas penuh. Penyimpanan dan koordinasi disediakan oleh etcd pada intinya.

Selain itu, Status adalah pengontrol API yang digunakan oleh layanan lain yang menawarkan fitur API tingkat tinggi seperti penjadwal. Kubernetes mendukung ketersediaan tinggi untuk konfigurasi kompleks operasi yang akan disiapkan.

Nomad juga jauh lebih sederhana. Biner tunggal untuk klien dan server tidak memerlukan layanan eksternal untuk koordinasi atau penyimpanan. Menggabungkan manajer yang ringan dan dengan penjadwal yang canggih. didistribusikan, sangat tersedia, dan secara operasional sederhana.

Selain itu tersedia sebagai biner pra-kompilasi untuk hampir semua sistem operasi. Untuk macOS, Anda bisa mendapatkannya dari Homebrew secara gratis dan sumber terbuka. Untuk windows, instal dari manajer paket sumber terbuka cokelat. Dengan Linux, gunakan yum, dnf, atau apt untuk menginstal paket.

Instalasi Hashicorp nomand di sistem Anda menggunakan dnf

Jadi Hashicorp memelihara dan menandatangani paket untuk di repositori mereka.

Jadi Buat file ini di /etc/yum.repos.d/hashicorp.repo dengan konten di bawah ini.Maukah Anda melakukan ini untuk semua node master dan slave?

Nomad – Tautan dokumentasi

# 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

Instalasi nomad Hashicorp menggunakan 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 ~]#

Pengembara Hashicorp verifikasi pemasangan

# 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 ~]#

Instal agen ke semua klien juga

Jadi Sekarang Konfigurasikan Server Leader untuk 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 ~]#

Mengonfigurasi node klien

[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 ~]#

Sekarang periksa Pemimpin jika terpilih

[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

Periksa status node klien

[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

Kesimpulan

Tutorial ini untuk membandingkan kemampuan dan alternatif solusi. Kami mungkin ingin tetap menggunakan apa yang Anda gunakan.


Cent OS
  1. Cara Memasang Cluster Kubernetes di CentOS 7

  2. Cara Menginstal Hashicorp Vault di CentOS 7

  3. Cara Menginstal Percona XtraDB Cluster di CentOS 7

  1. Cara Mengatur Cluster RabbitMQ di CentOS 7

  2. Cara Setup Riak KV NoSQL Database Cluster di CentOS 7

  3. Cara membangun Cluster Penyimpanan Terdistribusi Ceph di CentOS 7

  1. Pemantauan Cluster Ceph dengan Ceph-dash di CentOS 7

  2. Cara Menyebarkan Cluster Sharded MongoDB di CentOS 7

  3. Cara Memasang Cluster Sharded MongoDB di CentOS 7