LoginSignup
7
7

More than 5 years have passed since last update.

Serf - Getting Started ~ ドキュメントを読んでみます

Last updated at Posted at 2014-12-14

こんばんは、cloudpack@dz_ こと大平かづみです。

Prologue - はじめに

Code the Clouds Mix-up Vol.2」に参加し、拝聴できたLTで、運用ツール Serf に興味を持ちました!
Serf / Consul 入門 ~仕事を楽しくしよう~」 by @zembutsu さん

実際に触ってみたいので、ドキュメントをどんどん読みます!
まとめ記事「Serf はじめての運用ツール 〜 インストールとエージェント起動」を作る過程で訳した箇所を、以下に備忘録として記録していきます。

Serf について読んでみる

https://serfdom.io/ をどんどん読んでいきます。

Serf is a decentralized solution for cluster membership, failure detection, and orchestration. Lightweight and highly available.

"Serfは、クラスタのメンバーシップ、障害検知、オーケストレーションのための集中管理をしないソリューションです。軽量で高可用性があります。"

GOSSIPプロトコルを用いたノード管理

GOSSIP-BASED MEMBERSHIP
Serf relies on an efficient and lightweight gossip protocol to communicate with nodes. The Serf agents periodically exchange messages with each other in much the same way that a zombie apocalypse would occur: it starts with one zombie but soon infects everyone. In practice, the gossip is very fast and extremely efficient.

"Serfは、ノード間の通信のために、効率的で軽量な GOSSIP プロトコルに依存しています。
Serfエージェントは、定期的にメッセージを互いに交換します。それはまるで、ひとりだったゾンビがすぐに全員に感染するというゾンビの黙示録が起こったかのように。この GOSSIP はとても素早く非常に効率的です。"
(シミュレータ「Convergence Simulator - Serf by HashiCorp」 が用意されています。)

障害検知

FAILURE DETECTION
Serf is able to quickly detect failed members and notify the rest of the cluster. This failure detection is built into the heart of the gossip protocol used by Serf. Like humans in a zombie apocalypse, everybody checks their peers for infection and quickly alerts the other living humans. Serf relies on a random probing technique which is proven to efficiently scale to clusters of any size.

"Serfは、障害を起こしたメンバーを素早く検知し、残りのクラスタに通知します。この障害検知は、Serfによって、gossipプロトコルの中心部に構成されています。ゾンビの黙示録の渦中の人間のように、全員が仲間の感染を見張り、すぐさまほかの生存している人間たちに警告を出します。Serfは、実績があるランダムで厳密な方法を利用して、どんなサイズのクラスタにも効率的にスケールします。"

カスタムイベントの利用

CUSTOM EVENTS
In addition to managing membership, Serf can broadcast custom events and queries. These can be used to trigger deploys, restart processes, spread tales of human heroism, and anything else you may want. The event system is flexible and lightweight, making it easy for application developers and sysadmins alike to leverage.

"メンバーシップの管理に加え、Serfはカスタムしたイベントやくクエリをブロードキャストすることができます。これはデプロイやプロセスのリスタートや、人間の英雄伝説を広めたり(笑)など任意のトリガとして利用できます。このイベントシステムは、フレキシブルで軽量であり、アプリケーション開発者やシステム管理者でも、てこの様に簡単に利用できます。"

Serf: Intro (一部訳)

次に Introduction を読んでみます。
https://serfdom.io/intro/index.html

Serfとは?

What is Serf?
(略)
Serf runs on every major platform: Linux, Mac OS X, and Windows. It is extremely lightweight: it uses 5 to 10 MB of resident memory and primarily communicates using infrequent UDP messages.

"Serf は主要なプラットフォームで動作します: Linux, Mac OS X Windows. 超軽量で、常駐メモリは 5 ~ 10MB程度で、プライマリの通信手段は不定期のUDPメッセージです。"

Serf uses an efficient gossip protocol to solve three major problems: Membership, Failure detection and recovery, Custom event propagation

"Serf は、メンバーシップ管理、障害検知、カスタムイベントの伝搬とう 3つのよくある問題を解決するために、効率的な gossip プロトコル を利用します。"

メンバーシップ

Membership:
Serf maintains cluster membership lists and is able to execute custom handler scripts when that membership changes. For example, Serf can maintain the list of web servers for a load balancer and notify that load balancer whenever a node comes online or goes offline.

"Serfはクラスタのメンバーシップのリストを管理しており、メンバーシップに変更があったとき、カスタムハンドラーのスクリプトを実行することができます。たとえば、Serfは、ロードバランサーのためにウェブサーバのリストを管理することができ、オフラインになったときにロードバランサーに通知することができます。"

障害検知とリカバリ

Failure detection and recovery:
Serf automatically detects failed nodes within seconds, notifies the rest of the cluster, and executes handler scripts allowing you to handle these events. Serf will attempt to recover failed nodes by reconnecting to them periodically.

Serf は、数秒以内で障害が発生したノードを自動的に検知し、クラスタのほかのノードに知らせ、これらのイベントをハンドルできるようハンドラースクリプトを実行します。Serfは定期的に再接続しに行くことで、障害を起こしたノードをリカバリしようと試みます。

カスタムイベントの伝搬

Custom event propagation:
(略) Events are simply fire-and-forget broadcast, and Serf makes a best effort to deliver messages in the face of offline nodes or network partitions. Queries provide a simple realtime request/response mechanism.

"(Serfが扱う)イベントは、シンプルで、ブロードキャストに発行されるが、その後の応答を待つことはしないので、Serfは、オフラインのノードやネットワークの分割に直面しても、ベストエフォートでメッセージを配信することができます。
クエリはシンプルなリアルタイムのリクエスト/レスポンスの仕組みです。"

参考ページ

Epilogue - おわりに

ひとまず、Serf がどんなものかはわかった気がします!
英語の製品はユーモアが効いていて、訳していて楽しいです♪

最近は、Amazon Lambda のドキュメントも読み進めています。
こちらで記事書いているのでもしご興味あればどうぞ!
大平 かづみ の記事一覧

7
7
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
7