LoginSignup
2
1

More than 5 years have passed since last update.

ElixirリモートアプリをObserverする

Last updated at Posted at 2018-04-10

リモートのElixirアプリケーションをローカルマシンのObserverで確認するための設定

SSH接続

リモートサーバへは、port forwardingを使用しsshで接続します。
ここでは、9001と4369のportを転送していますが、9001のほうは任意です。

ssh -L 9001:localhost:9001 -L 4369:localhost:4369 user@remote-server.com

アプリケーション起動

リモートサーバ側で、portを指定しElixirアプリケーションを立ち上げます。
- sshで転送設定した9001をlisten設定します。
- nameは、このノードの名前です。
- cookieの値は、ローカルから接続するためのパスワードのようなものなので、任意の値を設定します。

iex --name remote@127.0.0.1 --cookie xxxxxx --erl "-kernel inet_dist_listen_min 9001 inet_dist_listen_max 9001" -S mix

Observer起動

ローカル側で、iexを実行します。
- cookieの値は、リモートサーバ側で設定したものと合わせてください。

iex --name local@127.0.0.1 --cookie xxxxxx --erl "-run observer"

ObserverのGUIが立ち上がるので、メニューのNodesから、リモートサーバ側で設定したノードの名前を入力してください。この例ではremote@127.0.0.1です。

2
1
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
2
1