SlideShare a Scribd company logo
わんくま同盟 名古屋勉強会 #40
st2でシステム管理
2016/12/17(土)
You&I
わんくま同盟 名古屋勉強会 #40
ジコ、ショウカイ。
• H/N: You&I(読み:ユーアンドアイ)
• SNS: @you_and_i
• 出身: 生まれも育ちも名古屋市
• 年齢: 30代後半
• 本職: 商学部出身の職業プログラマ
• 言語: C++, C#他
•所属: プロ生勉強会 名古屋支部
名古屋アジャイル勉強会
わんくま同盟 名古屋勉強会
わんくま同盟 名古屋勉強会 #40
AGENDA
1. st2の概要
2. st2の環境構築
3. st2のデモ
4. まとめ
わんくま同盟 名古屋勉強会 #40
1. st2の概要
st2でシステム管理
わんくま同盟 名古屋勉強会 #40
1. st2の概要
• st2(StackStormの略称)とは、簡単に言うと、
タスク自動化ツールです。
• Apache License V2.0で公開されているOSS。
Brocadeによる有償サポートもあります。
• オンプレミス環境で利用するツールです。
• Pythonで開発されています。設定ファイル
等はYAML形式で記述します。
わんくま同盟 名古屋勉強会 #40
1. st2の概要
• st2公式サイト
– https://stackstorm.com
– StackStorm (aka "IFTTT for Ops") is event-driven
automation commonly used for auto-remediation,
security responses, facilitated troubleshooting,
complex deployments, and more.
わんくま同盟 名古屋勉強会 #40
1. st2の概要
• st2の動作概要
SensorやActionは自作するかプラグインを導入
StackStorm
Sensor
Trigger
Sensor
Trigger
Action
Action
Action
Rule
Rule
Rule
Log
IoT
Twitter
Script/
Ansible
Cloud
わんくま同盟 名古屋勉強会 #40
1. st2の概要
https://docs.stackstorm.com/overview.html
わんくま同盟 名古屋勉強会 #40
1. st2の概要
• 処理の流れ
1. Events are aggregated (Push/Pull) from various services
via Sensors.
2. Events are compared against Triggers, and generate
Actions.
3. Processed actions from workflows are placed on message
que (RabbitMQ).
1. Mistral workflows are processed by the Mistral Services
(Optional).
2. Action reach out to various services to perform workflow actions.
4. Log and Audit History is pushed to database for storage
(MongoDB).
5. Processed Results are sent back to the rules engine for
further processing.
わんくま同盟 名古屋勉強会 #40
1. st2の概要
• 構成・技術要素
– Sensors
• Sensors are Python plugins for either inbound or outbound
integration that receives or watches for events respectively.
• When an event from external systems occurs and is
processed by a sensor, a StackStorm trigger will be emitted
into the system.
– Triggers
• Triggers are StackStorm representations of external events.
There are generic triggers (e.g. timers, webhooks) and
integration triggers (e.g. Sensu alert, JIRA issue updated).
• A new trigger type can be defined by writing a sensor plugin.
わんくま同盟 名古屋勉強会 #40
1. st2の概要
• 構成・技術要素
– Actions
• Actions are StackStorm outbound integrations.
• There are generic actions (SSH, REST call), integrations
(OpenStack, Docker, Puppet), or custom actions.
• Actions are either Python plugins, or any scripts,
consumed into StackStorm by adding a few lines of
metadata.
• Actions can be invoked directly by user via CLI or API, or
used and called as part of rules and workflows.
わんくま同盟 名古屋勉強会 #40
1. st2の概要
• 構成・技術要素
– Rules
• Rules map triggers to actions (or to workflows), applying
matching criteria and mapping trigger payload to action
inputs.
– Workflows
• Workflows stitch actions together into “uber-actions”,
defining the order, transition conditions, and passing the
data.
• Most automations are more than one-step and thus need
more than one action.
• Workflows, just like “atomic” actions, are available in the
Action library, can be invoked manually or triggered by rules.
わんくま同盟 名古屋勉強会 #40
1. st2の概要
• 構成・技術要素
– Packs
• Packs are the units of content deployment.
• They simplify the management and sharing of
StackStorm pluggable content by grouping integrations
(triggers and actions) and automations (rules and
workflows).
• A growing number of packs are available on StackStorm
community.
• User can create their own packs, share them on Github,
or submit to StackStorm community repo.
わんくま同盟 名古屋勉強会 #40
1. st2の概要
• 構成・技術要素
– Audit trail
• Audit trail of action executions, manual or automated,
is recorded and stored with full details of triggering
context and execution results.
• It is also captured in audit logs for integrating with
external logging and analytical tools: LogStash, Splunk,
statsd, syslog.
わんくま同盟 名古屋勉強会 #40
1. st2の概要
https://docs.stackstorm.com/install/overview.html
わんくま同盟 名古屋勉強会 #40
1. st2の概要
• 構成・技術要素
1. nginx
• HTTPサーバー。WebUI/リバースプロキシの提供。
2. RabbitMQ
• AMQPプロトコル。Message Queue。
3. MongoDB
• NoSQL-DB。動作ログや監査履歴の保存。
4. PostgresSQL
• Mistral Services情報(長時間実行処理)の保存。
5. LDAP (option)
• 認証
6. Redis/ZooKeeper (option)
• PolicesにおいてRules Engineの同期制御で利用。
わんくま同盟 名古屋勉強会 #40
2. st2の環境構築
st2でシステム管理
わんくま同盟 名古屋勉強会 #40
2. st2の環境構築
• 公式ドキュメントの通りにやります
– https://docs.stackstorm.com/install/index.html
– 今回はCentOS 7.3にセットアップ
– 事前準備
$ sudo yum install –y epel-release
$ sudo yum update –y
– セットアップ
$ sudo yum install –y curl
$ curl -sSL https://stackstorm.com/packages/install.sh |
bash -s -- --user=st2admin --password=パスワード
わんくま同盟 名古屋勉強会 #40
2. st2の環境構築
• WebUIへのログイン
– https://localhost.localdomain
• https://stackstorm.com/packages/install.sh
• 上記スクリプト実行時の引数に渡した情報がst2の
管理者とパスワードになります
– --user=st2admin, --password=パスワード
わんくま同盟 名古屋勉強会 #40
3. st2のデモ
st2でシステム管理
わんくま同盟 名古屋勉強会 #40
3. st2のデモ
• st2の利用ケース
– サービス間のプロキシとして利用するのが分かり
やすい?
例)わんくま同盟のサーバーの監視サービスがサーバー
が落ちた事を検知
– Twitterに投稿
– Facebook Messangerで通知
– slackに通知
– Twillioでわんくまサーバー管理者に電話をかける
サービス毎に異なるAPIとなっており監視サービスが色々な
サービスに通知を出す必要がある。
st2を利用すると監視サービスは監視だけに留めて、st2に検知
した異常を通知するのみ。
後は通知が来た場合のActionをst2で定義していくのみ。
わんくま同盟 名古屋勉強会 #40
3. st2のデモ
• st2の利用ケース
– サービス間のプロキシとして利用するのが分
かりやすい?
例)わんくま同盟のサーバーの監視サービスがサー
バーが落ちた事を検知
st2を利用する場合、監視サービスは監視だけに留めて、st2
に検知した異常を通知するのみ。
後はst2側で通知が来た場合のActionを定義していくのみ。
st2で定義したActionは、YAML形式のコードベースで保存さ
れるので、Infrastructure as Code(IaC)が実現される。
わんくま同盟 名古屋勉強会 #40
3. st2のデモ
• fail2banを利用して何かデモします
わんくま同盟 名古屋勉強会 #40
4. まとめ
st2でシステム管理
わんくま同盟 名古屋勉強会 #40
4. まとめ
• st2の特徴
– タスク自動化ツール
– サービス間をつなぐプロキシ
– 設定情報はYAML形式でありInfrastructure as
Code(IaC)が実現される
わんくま同盟 名古屋勉強会 #40
4. まとめ
• その他
– st2は、デプロイ等のビルドパイプライン用途
には向かない
– st2に何でもかんでも集約すると、st2が単一障
害点(SPOF)になってしまうので、ご利用は計
画的に。

More Related Content

PDF
エンタープライズアジャイル内製プロジェクトを立ち上げる前に考慮すべき3つのこと
Hiromasa Oka
 
PDF
「俺の背中について来い」アジャイルチームを一気に立ち上げる方法
Hiromasa Oka
 
PDF
Portfolio for JIRA で"全体計画にコミット"し続けるべし
Hiromasa Oka
 
PDF
アジャイルにモデリングは必要か
Hiromasa Oka
 
PDF
20161213_FinTech時代に求められるDB開発とセキュリティ by 株式会社インサイトテクノロジー 阿部健一
Insight Technology, Inc.
 
PDF
モダナイゼーションがもたらす未来
Hiromasa Oka
 
PDF
エクストリームエンジニア3
T-arts
 
PPTX
早稲田大学 理工メディアセンター 機械学習とAI セミナー: 機械学習中級編
Daiyu Hatakeyama
 
エンタープライズアジャイル内製プロジェクトを立ち上げる前に考慮すべき3つのこと
Hiromasa Oka
 
「俺の背中について来い」アジャイルチームを一気に立ち上げる方法
Hiromasa Oka
 
Portfolio for JIRA で"全体計画にコミット"し続けるべし
Hiromasa Oka
 
アジャイルにモデリングは必要か
Hiromasa Oka
 
20161213_FinTech時代に求められるDB開発とセキュリティ by 株式会社インサイトテクノロジー 阿部健一
Insight Technology, Inc.
 
モダナイゼーションがもたらす未来
Hiromasa Oka
 
エクストリームエンジニア3
T-arts
 
早稲田大学 理工メディアセンター 機械学習とAI セミナー: 機械学習中級編
Daiyu Hatakeyama
 

What's hot (20)

PPTX
キャリアコンサルタント向け「企業で求められるITスキルの実態」と実践スキル向上研修
Daiyu Hatakeyama
 
PDF
6製品1サービスの開発にPortfolio for JIRAを使ってみた
Hiroshi Ohnuki
 
PPTX
東北大学AIE - 機械学習入門編
Daiyu Hatakeyama
 
PPTX
Garraway7 Terakoya 前夜祭 プロトタイプのススメ
Daiyu Hatakeyama
 
PPTX
Chainer x Azure Machine Learning service - Hackathon
Daiyu Hatakeyama
 
PPTX
利用事例にみる AI技術活用のポイントと、Microsoft AI最新動向
Daiyu Hatakeyama
 
PPTX
リクルートライフスタイル全サービス横断のリアルタイムログ収集・可視化・分析基盤
Recruit Lifestyle Co., Ltd.
 
PPTX
技術としての機械学習を理解し、世の中に役に立つ事を考える基礎知識
Daiyu Hatakeyama
 
PDF
エクストリームエンジニア5
T-arts
 
PDF
分析手法のご紹介
Recruit Technologies
 
PDF
データサイエンス業務と「ツール」
The Japan DataScientist Society
 
PDF
共有、自動化、計測 - DevOps ツール考察 -
Chie Sasaki
 
PDF
リクルートライフスタイルにおける深層学習の活用とGCPでの実現方法
Recruit Lifestyle Co., Ltd.
 
PDF
深層学習の導入で抱える課題とユースケース実例
Hirono Jumpei
 
PDF
MISO20200530
陽平 山口
 
PDF
【17-E-4】GitHub Enterpriseユーザ企業登壇!企業文化にイノベーションを起こすモダンなソフトウェア開発環境とは?
Developers Summit
 
PDF
CET(Capture EveryThing)プロジェクトにおけるﰀ機械学 習・データマイニング最前線
Recruit Lifestyle Co., Ltd.
 
PPTX
IoTデバイスデータ収集の難しい点
Tetsutaro Watanabe
 
PDF
ウェアラブルカンファレンスの講演資料 - リクルートテクノロジーズ
Recruit Technologies
 
PPTX
Saga Smart Center: デジタル変革が及ぼす企業が考慮すべき未来の姿
Daiyu Hatakeyama
 
キャリアコンサルタント向け「企業で求められるITスキルの実態」と実践スキル向上研修
Daiyu Hatakeyama
 
6製品1サービスの開発にPortfolio for JIRAを使ってみた
Hiroshi Ohnuki
 
東北大学AIE - 機械学習入門編
Daiyu Hatakeyama
 
Garraway7 Terakoya 前夜祭 プロトタイプのススメ
Daiyu Hatakeyama
 
Chainer x Azure Machine Learning service - Hackathon
Daiyu Hatakeyama
 
利用事例にみる AI技術活用のポイントと、Microsoft AI最新動向
Daiyu Hatakeyama
 
リクルートライフスタイル全サービス横断のリアルタイムログ収集・可視化・分析基盤
Recruit Lifestyle Co., Ltd.
 
技術としての機械学習を理解し、世の中に役に立つ事を考える基礎知識
Daiyu Hatakeyama
 
エクストリームエンジニア5
T-arts
 
分析手法のご紹介
Recruit Technologies
 
データサイエンス業務と「ツール」
The Japan DataScientist Society
 
共有、自動化、計測 - DevOps ツール考察 -
Chie Sasaki
 
リクルートライフスタイルにおける深層学習の活用とGCPでの実現方法
Recruit Lifestyle Co., Ltd.
 
深層学習の導入で抱える課題とユースケース実例
Hirono Jumpei
 
MISO20200530
陽平 山口
 
【17-E-4】GitHub Enterpriseユーザ企業登壇!企業文化にイノベーションを起こすモダンなソフトウェア開発環境とは?
Developers Summit
 
CET(Capture EveryThing)プロジェクトにおけるﰀ機械学 習・データマイニング最前線
Recruit Lifestyle Co., Ltd.
 
IoTデバイスデータ収集の難しい点
Tetsutaro Watanabe
 
ウェアラブルカンファレンスの講演資料 - リクルートテクノロジーズ
Recruit Technologies
 
Saga Smart Center: デジタル変革が及ぼす企業が考慮すべき未来の姿
Daiyu Hatakeyama
 
Ad

Viewers also liked (19)

PDF
しょうぎアプリ
You&I
 
PDF
エクストリームエンジニア4
T-arts
 
PDF
レジリエンスで高める組織づくり
You&I
 
PDF
プロダクトマネジメント入門
You&I
 
PDF
Pfpws w22 事例紹介_ペアマインドマップ
nishikawa_makoto7
 
PDF
「Qaエンジニアのキャリアについて考える : 急(Q) ~ いろいろな組織でやったこと~」
久仁朗 山本(旧姓 村上)
 
PPTX
わんくま同盟 名古屋勉強会 #38 LT司会資料
You&I
 
PDF
めざせスクラムマスター
You&I
 
PDF
Coderetreat素振り会
You&I
 
PDF
あなたの知らないセキュリティ規格の話
You&I
 
PDF
Dev Woops!
You&I
 
PDF
課題駆動の勘所
You&I
 
PDF
伝える・見せる技術
You&I
 
PDF
ユーザーストーリーで学ぶスクラム
You&I
 
PDF
Ansibleは簡単なIT自動化
You&I
 
PDF
すぱこーに学ぶアプリ開発の第一歩
You&I
 
PDF
インセプションデッキ紹介
You&I
 
PDF
発見から納品へ
You&I
 
PDF
現場に持ち帰るまでがAgile japan!
nishikawa_makoto7
 
しょうぎアプリ
You&I
 
エクストリームエンジニア4
T-arts
 
レジリエンスで高める組織づくり
You&I
 
プロダクトマネジメント入門
You&I
 
Pfpws w22 事例紹介_ペアマインドマップ
nishikawa_makoto7
 
「Qaエンジニアのキャリアについて考える : 急(Q) ~ いろいろな組織でやったこと~」
久仁朗 山本(旧姓 村上)
 
わんくま同盟 名古屋勉強会 #38 LT司会資料
You&I
 
めざせスクラムマスター
You&I
 
Coderetreat素振り会
You&I
 
あなたの知らないセキュリティ規格の話
You&I
 
Dev Woops!
You&I
 
課題駆動の勘所
You&I
 
伝える・見せる技術
You&I
 
ユーザーストーリーで学ぶスクラム
You&I
 
Ansibleは簡単なIT自動化
You&I
 
すぱこーに学ぶアプリ開発の第一歩
You&I
 
インセプションデッキ紹介
You&I
 
発見から納品へ
You&I
 
現場に持ち帰るまでがAgile japan!
nishikawa_makoto7
 
Ad

Similar to st2でシステム管理 (20)

PDF
Twitterのリアルタイム分散処理システム「Storm」入門
AdvancedTechNight
 
PDF
デブサミ2014-Stormで実現するビッグデータのリアルタイム処理プラットフォーム ~ストリームデータ処理から機械学習まで~
Takanori Suzuki
 
PDF
Stormの注目の新機能TridentAPI
AdvancedTechNight
 
PPTX
FIWARE 概要 - FIWARE WednesdayWebinars
fisuda
 
PDF
StackStormを用いたネットワーク機器の制御
yskitagawa
 
PDF
本気で使うStack storm
tyamane
 
PPTX
StackStormを活用した運用自動化の実践
Shu Sugimoto
 
PDF
Hadoop Summit 2016 San Jose ストリーム処理関連の報告 #streamctjp
Yahoo!デベロッパーネットワーク
 
PDF
State of the art Stream Processing #hadoopreading
Yahoo!デベロッパーネットワーク
 
PDF
20190118-josug-open stack-community-goals
Akihiro Motoki
 
PPTX
Report of OpenStack ops mid cycle meetup at Philadelphia in Mar, 2015 (In Jap...
Toshikazu Ichikawa
 
PDF
Twitterのリアルタイム分散処理システム「Storm」入門 demo
AdvancedTechNight
 
PDF
20130319勉強会
Akira Yoshiyama
 
PDF
20201214 AWS Black Belt Online Seminar 2020 年 AWS re:Invent 速報 Part2
Amazon Web Services Japan
 
PPTX
StackStorm Workflowの設計
Shu Sugimoto
 
PDF
IoT時代におけるストリームデータ処理と急成長の Apache Flink
Takanori Suzuki
 
PPTX
LT.22 GitHub Actionsを触ってみた話
GIG inc.
 
PPTX
Interact 2019:Microsoft SDN v2 よもやま話
wind06106
 
PDF
WebRTC Rockstars Asian Tour 2017 (JP)
Lorenzo Miniero
 
PPTX
無料静的ホスティング × FaaSの話
Shinichi Ueno
 
Twitterのリアルタイム分散処理システム「Storm」入門
AdvancedTechNight
 
デブサミ2014-Stormで実現するビッグデータのリアルタイム処理プラットフォーム ~ストリームデータ処理から機械学習まで~
Takanori Suzuki
 
Stormの注目の新機能TridentAPI
AdvancedTechNight
 
FIWARE 概要 - FIWARE WednesdayWebinars
fisuda
 
StackStormを用いたネットワーク機器の制御
yskitagawa
 
本気で使うStack storm
tyamane
 
StackStormを活用した運用自動化の実践
Shu Sugimoto
 
Hadoop Summit 2016 San Jose ストリーム処理関連の報告 #streamctjp
Yahoo!デベロッパーネットワーク
 
State of the art Stream Processing #hadoopreading
Yahoo!デベロッパーネットワーク
 
20190118-josug-open stack-community-goals
Akihiro Motoki
 
Report of OpenStack ops mid cycle meetup at Philadelphia in Mar, 2015 (In Jap...
Toshikazu Ichikawa
 
Twitterのリアルタイム分散処理システム「Storm」入門 demo
AdvancedTechNight
 
20130319勉強会
Akira Yoshiyama
 
20201214 AWS Black Belt Online Seminar 2020 年 AWS re:Invent 速報 Part2
Amazon Web Services Japan
 
StackStorm Workflowの設計
Shu Sugimoto
 
IoT時代におけるストリームデータ処理と急成長の Apache Flink
Takanori Suzuki
 
LT.22 GitHub Actionsを触ってみた話
GIG inc.
 
Interact 2019:Microsoft SDN v2 よもやま話
wind06106
 
WebRTC Rockstars Asian Tour 2017 (JP)
Lorenzo Miniero
 
無料静的ホスティング × FaaSの話
Shinichi Ueno
 

st2でシステム管理

  • 2. わんくま同盟 名古屋勉強会 #40 ジコ、ショウカイ。 • H/N: You&I(読み:ユーアンドアイ) • SNS: @you_and_i • 出身: 生まれも育ちも名古屋市 • 年齢: 30代後半 • 本職: 商学部出身の職業プログラマ • 言語: C++, C#他 •所属: プロ生勉強会 名古屋支部 名古屋アジャイル勉強会 わんくま同盟 名古屋勉強会
  • 3. わんくま同盟 名古屋勉強会 #40 AGENDA 1. st2の概要 2. st2の環境構築 3. st2のデモ 4. まとめ
  • 4. わんくま同盟 名古屋勉強会 #40 1. st2の概要 st2でシステム管理
  • 5. わんくま同盟 名古屋勉強会 #40 1. st2の概要 • st2(StackStormの略称)とは、簡単に言うと、 タスク自動化ツールです。 • Apache License V2.0で公開されているOSS。 Brocadeによる有償サポートもあります。 • オンプレミス環境で利用するツールです。 • Pythonで開発されています。設定ファイル 等はYAML形式で記述します。
  • 6. わんくま同盟 名古屋勉強会 #40 1. st2の概要 • st2公式サイト – https://stackstorm.com – StackStorm (aka "IFTTT for Ops") is event-driven automation commonly used for auto-remediation, security responses, facilitated troubleshooting, complex deployments, and more.
  • 7. わんくま同盟 名古屋勉強会 #40 1. st2の概要 • st2の動作概要 SensorやActionは自作するかプラグインを導入 StackStorm Sensor Trigger Sensor Trigger Action Action Action Rule Rule Rule Log IoT Twitter Script/ Ansible Cloud
  • 8. わんくま同盟 名古屋勉強会 #40 1. st2の概要 https://docs.stackstorm.com/overview.html
  • 9. わんくま同盟 名古屋勉強会 #40 1. st2の概要 • 処理の流れ 1. Events are aggregated (Push/Pull) from various services via Sensors. 2. Events are compared against Triggers, and generate Actions. 3. Processed actions from workflows are placed on message que (RabbitMQ). 1. Mistral workflows are processed by the Mistral Services (Optional). 2. Action reach out to various services to perform workflow actions. 4. Log and Audit History is pushed to database for storage (MongoDB). 5. Processed Results are sent back to the rules engine for further processing.
  • 10. わんくま同盟 名古屋勉強会 #40 1. st2の概要 • 構成・技術要素 – Sensors • Sensors are Python plugins for either inbound or outbound integration that receives or watches for events respectively. • When an event from external systems occurs and is processed by a sensor, a StackStorm trigger will be emitted into the system. – Triggers • Triggers are StackStorm representations of external events. There are generic triggers (e.g. timers, webhooks) and integration triggers (e.g. Sensu alert, JIRA issue updated). • A new trigger type can be defined by writing a sensor plugin.
  • 11. わんくま同盟 名古屋勉強会 #40 1. st2の概要 • 構成・技術要素 – Actions • Actions are StackStorm outbound integrations. • There are generic actions (SSH, REST call), integrations (OpenStack, Docker, Puppet), or custom actions. • Actions are either Python plugins, or any scripts, consumed into StackStorm by adding a few lines of metadata. • Actions can be invoked directly by user via CLI or API, or used and called as part of rules and workflows.
  • 12. わんくま同盟 名古屋勉強会 #40 1. st2の概要 • 構成・技術要素 – Rules • Rules map triggers to actions (or to workflows), applying matching criteria and mapping trigger payload to action inputs. – Workflows • Workflows stitch actions together into “uber-actions”, defining the order, transition conditions, and passing the data. • Most automations are more than one-step and thus need more than one action. • Workflows, just like “atomic” actions, are available in the Action library, can be invoked manually or triggered by rules.
  • 13. わんくま同盟 名古屋勉強会 #40 1. st2の概要 • 構成・技術要素 – Packs • Packs are the units of content deployment. • They simplify the management and sharing of StackStorm pluggable content by grouping integrations (triggers and actions) and automations (rules and workflows). • A growing number of packs are available on StackStorm community. • User can create their own packs, share them on Github, or submit to StackStorm community repo.
  • 14. わんくま同盟 名古屋勉強会 #40 1. st2の概要 • 構成・技術要素 – Audit trail • Audit trail of action executions, manual or automated, is recorded and stored with full details of triggering context and execution results. • It is also captured in audit logs for integrating with external logging and analytical tools: LogStash, Splunk, statsd, syslog.
  • 15. わんくま同盟 名古屋勉強会 #40 1. st2の概要 https://docs.stackstorm.com/install/overview.html
  • 16. わんくま同盟 名古屋勉強会 #40 1. st2の概要 • 構成・技術要素 1. nginx • HTTPサーバー。WebUI/リバースプロキシの提供。 2. RabbitMQ • AMQPプロトコル。Message Queue。 3. MongoDB • NoSQL-DB。動作ログや監査履歴の保存。 4. PostgresSQL • Mistral Services情報(長時間実行処理)の保存。 5. LDAP (option) • 認証 6. Redis/ZooKeeper (option) • PolicesにおいてRules Engineの同期制御で利用。
  • 17. わんくま同盟 名古屋勉強会 #40 2. st2の環境構築 st2でシステム管理
  • 18. わんくま同盟 名古屋勉強会 #40 2. st2の環境構築 • 公式ドキュメントの通りにやります – https://docs.stackstorm.com/install/index.html – 今回はCentOS 7.3にセットアップ – 事前準備 $ sudo yum install –y epel-release $ sudo yum update –y – セットアップ $ sudo yum install –y curl $ curl -sSL https://stackstorm.com/packages/install.sh | bash -s -- --user=st2admin --password=パスワード
  • 19. わんくま同盟 名古屋勉強会 #40 2. st2の環境構築 • WebUIへのログイン – https://localhost.localdomain • https://stackstorm.com/packages/install.sh • 上記スクリプト実行時の引数に渡した情報がst2の 管理者とパスワードになります – --user=st2admin, --password=パスワード
  • 20. わんくま同盟 名古屋勉強会 #40 3. st2のデモ st2でシステム管理
  • 21. わんくま同盟 名古屋勉強会 #40 3. st2のデモ • st2の利用ケース – サービス間のプロキシとして利用するのが分かり やすい? 例)わんくま同盟のサーバーの監視サービスがサーバー が落ちた事を検知 – Twitterに投稿 – Facebook Messangerで通知 – slackに通知 – Twillioでわんくまサーバー管理者に電話をかける サービス毎に異なるAPIとなっており監視サービスが色々な サービスに通知を出す必要がある。 st2を利用すると監視サービスは監視だけに留めて、st2に検知 した異常を通知するのみ。 後は通知が来た場合のActionをst2で定義していくのみ。
  • 22. わんくま同盟 名古屋勉強会 #40 3. st2のデモ • st2の利用ケース – サービス間のプロキシとして利用するのが分 かりやすい? 例)わんくま同盟のサーバーの監視サービスがサー バーが落ちた事を検知 st2を利用する場合、監視サービスは監視だけに留めて、st2 に検知した異常を通知するのみ。 後はst2側で通知が来た場合のActionを定義していくのみ。 st2で定義したActionは、YAML形式のコードベースで保存さ れるので、Infrastructure as Code(IaC)が実現される。
  • 23. わんくま同盟 名古屋勉強会 #40 3. st2のデモ • fail2banを利用して何かデモします
  • 24. わんくま同盟 名古屋勉強会 #40 4. まとめ st2でシステム管理
  • 25. わんくま同盟 名古屋勉強会 #40 4. まとめ • st2の特徴 – タスク自動化ツール – サービス間をつなぐプロキシ – 設定情報はYAML形式でありInfrastructure as Code(IaC)が実現される
  • 26. わんくま同盟 名古屋勉強会 #40 4. まとめ • その他 – st2は、デプロイ等のビルドパイプライン用途 には向かない – st2に何でもかんでも集約すると、st2が単一障 害点(SPOF)になってしまうので、ご利用は計 画的に。