Weitere ähnliche Inhalte
Ähnlich wie CoreOSってなんですか (20)
Mehr von Keisuke Izumiya (10)
Kürzlich hochgeladen (11)
CoreOSってなんですか
- 2. 自己紹介
• 名前 泉谷圭祐
• 所属
• TIS株式会社 IT基盤サービス企画室
• eXcale(https://www.excale.net/)の中の人
• SNS等
• Twitter @syguer
• Facebook https://www.facebook.com/keisuke.izumiya
• ブログ http://syguer.hatenablog.com/
- 17. クラスタリングしてみる
$num_instances=3 # 1 => 3
!
$expose_docker_tcp=2375 #コメントアウト
・config.rbの下記箇所を編集
・user-dataのcoreos -> etcd -> discoveryを編集
#cloud-config
!
coreos:
etcd:
#generate a new token for each unique cluster from https://discovery.etcd.io/new
discovery: https://discovery.etcd.io/<key> #↑のリンクでkeyを取得して貼り付け
設定を変えたら仮想マシン上げ直し
- 18. クラスタリングしてみる
# fleet
$ git clone https://github.com/coreos/fleet.git
$ cd fleet
$ ./build
!
# 環境変数設定
$ export FLEETCTL_ENDPOINT=http://<クラスタのどれか>:4001
!
# クラスタが見えるかチェック
$ bin/fleetctl list-machines -l
MACHINE IP METADATA
5bc026ef05e74d968bd93033dc9b820c 172.17.8.103 -
d510bda5b2144065ab5115e612d0d7c6 172.17.8.102 -
ec71fb2ae57243ed831d1e96276ed815 172.17.8.101 -
・ローカル(ホストOS)にfleetを入れる
- 19. クラスタリングしてみる
!
$ bin/fleetctl submit examples/hello.service #サンプルを実行
!
$ bin/fleetctl start hello.service
Job hello.service launched on ec71fb2a…/172.17.8.101
!
$ bin/fleetctl list-units
UNIT STATE LOAD ACTIVE SUB DESC MACHINE
hello.service launched loaded active running Hello World ec71fb2a.../
172.17.8.101
・fleetでアプリケーションを起動