GNU/Linux >> Linux の 問題 >  >> Cent OS

CentosおよびRockyLinux上のHashicorpNomadCluster Lab

はじめに

私たちはかなり前からサーバーリソースを利用するための代替方法を探していましたが、今ではセットアップのための簡単なアプローチです。本番環境に対応していない可能性があります。開発用に設定する価値があることは間違いありません。私たちの生活を楽にするオーケストレーター。自動化管理ツールです。そのプロビジョニング、展開、トリガー、監視、測定、追跡、および組織内のロボットのセキュリティの確保。

そのため、KubernetesはGoogleによってコンテナ向けに作成されました。クラスタ管理、スケジューリング、サービスディスカバリ、モニタリング、シークレット管理など、Linuxコンテナアプリケーションのすべての機能を提供することを目的としています。Hashicorpnomadは、クラスタの管理とスケジューリングのみに焦点を当てており、スコープが小さいUnix哲学。サービス検出サービスメッシュおよびVaultリモート管理用のコンソール作成ツール。

さらに、Kubernetesは、完全な機能を備えた多くの相互運用サービスのコレクションです。コアでetcdによって提供されるストレージと調整。

さらに、状態は、スケジューラなどの高レベルのAPI機能を提供する他のサービスによって消費されるAPIコントローラーです。Kubernetesは、セットアップが複雑な操作の構成の高可用性をサポートします。

また、Nomadははるかにシンプルです。クライアントとサーバー用の単一のバイナリは、調整やストレージのための外部サービスを必要としません。軽量のマネージャーと洗練されたスケジューラーを組み合わせます。分散型で、可用性が高く、操作が簡単です。

それに加えて、ほとんどすべてのオペレーティングシステムでプリコンパイルされたバイナリとして利用できます。macOSの場合は、Homebrewから無料でオープンソースで入手できます。Windowsの場合は、chocolateyオープンソースパッケージマネージャーからインストールします。Linuxでは、 yum、dnf、またはaptを使用してパッケージをインストールします。

Hashicorpnomanddnfを使用したシステムへのインストール

そのため、Hashicorpは、リポジトリ上でパッケージを維持および署名します。

したがって、このファイルを/etc/yum.repos.d/hashicorp.repoに以下の内容で作成します。これをすべてのマスターノードとスレーブノードに実行していただけますか?

遊牧民–ドキュメントリンク

# 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

yumを使用したHashicorp遊牧民のインストール

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

Hashicorp nomad インストールを確認する

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

すべてのクライアントにもエージェントをインストールします

つまり、クラスターのサーバーリーダーを構成します

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

クライアントノードを構成する

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

選出された場合はリーダーを確認してください

[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

クライアントノードのステータスを確認する

[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

結論

このチュートリアルは、機能と代替ソリューションを比較することです。私たちはあなたが使用しているものに留まりたいと思うかもしれません。


Cent OS
  1. CentOS7にKubernetesクラスターをインストールする方法

  2. CentOS7にHashicorpVaultをインストールする方法

  3. CentOS7にPerconaXtraDBクラスターをインストールする方法

  1. CentOS7でRabbitMQクラスターを設定する方法

  2. CentOS7でRiakKVNoSQLデータベースクラスターをセットアップする方法

  3. CentOS7でCeph分散ストレージクラスターを構築する方法

  1. CentOS7でのCeph-dashを使用したCephクラスターのモニタリング

  2. CentOS7にMongoDBシャードクラスターをデプロイする方法

  3. CentOS7にMongoDBシャードクラスターをインストールする方法