LoginSignup
5
10

More than 5 years have passed since last update.

【Docker】RancherOSで本格的な自宅サーバーを構築しよう(3) ~ rancher-agentを構築しよう ~

Last updated at Posted at 2016-06-07

rancher-agentを構築しよう

rancher-docker.png

関連記事

rancher-agentとなるサーバーにも同様にrancherOSをインストールしておく

rancher-agentをrun

  • 以下はrancher-serverの管理画面で操作する
  • 管理画面のADMINタブ -> SETTING

    • Host Registration URL -> something else

      http://{rancher-serverのprivateIP}:8080
      

Screen Shot 2016-06-07 at 10.19.05.png

  • INFRASTRUCTURE -> HOSTS -> Add Host

    • type

      custom
      
    • 5 Copy, paste, and run the command below to register the host with Rancher:

      言われたとうりコピーする
      それぞれrancher-agentに貼り付けてコマンドを実行する
      
    • 5 Click close below. The new host should pop up on the Hosts screen within a minute.

      INFRASTRUCTURE -> HOSTS
      しばらく眺めてたらhostの画面が現れる!
      editから名前を変更しておく"agent01""agent02"とか
      

      Screen Shot 2016-06-07 at 10.18.18.png

Screen Shot 2016-06-07 at 10.20.33.png

一通り完了

サービスが展開できる用意が整った

  • rancher/server
  • rancher/agent
  • haproxy

  • CATALOG でぽちぽちやると適当なサービスを運用することができる

試しにwordpressを動かしてみる

Screen Shot 2016-06-07 at 10.26.44.png

Screen Shot 2016-06-07 at 10.27.38.png

  • Launchを押すとコンテナが作られて、wpを見れるようになる!!

今後の課題

  • コンテナが消えるとデータも消える -> NFSをつくってmysqlのデータを永続化
  • ポートが重なるとコンテナが上がらなくなる -> ロードバランサをつくってurlで分ける
  • ローカルで開発したdocker imageを本番環境でデプロイ -> registryを使ってみよう
5
10
0

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
5
10