- 追加された行はこの色です。
- 削除された行はこの色です。
*Scalarisの分散環境用の設定方法 [#s48ecc3f]
Scalarisを複数のノードで動作させるための設定方法について説明します。
*想定する構成 [#t65d88be]
1台のbootサーバに対して、複数台のレギュラーノードが接続するための設定を行います。
bootサーバとレギュラーノードがそれぞれ異なるPCの場合用の設定を行います。
*設定ファイル [#zb13be8c]
分散環境用の設定ファイルとしてはbin/scalaris.local.cfgが使用されます。
デフォルトでは用意されていませんが、bin/scalaris.local.cfg.exampleというサンプルがあるのでコピーして使用すると良いでしょう。
# cd bin
# cp scalaris.local.cfg.example scalaris.local.cfg
# vi scalaris.local.cfg
scalaris.local.cfg.exampleの内容は以下のようになっています。
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Settings for distributed Erlang
% (see cs_send.erl to switch)
% {boot_host, {boot,'boot@foo.bar.com'}}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Settings for TCP mode.
% (see cs_send.erl to switch)
% Insert the appropriate IP-addresses for your setup
% as comma separated integers:
% IP Address, Port, and label of the boot server
{boot_host, {{127,0,0,1},14195,boot}}.
% IP Address, Port, and label of a node which is already in the system
{known_hosts, [{{127,0,0,1},14195, service_per_vm}]}.
%がコメントアウトになります。
なので実質設定されているのはboot_hostとknown_hostになります。
*bootサーバ用の設定 [#icc4ac59]
*分散環境用の設定 [#icc4ac59]
bootサーバになるPCのための設定としては、boot_hostを設定する必要があります。
boot_hostの127,0,0,1の部分を
例えば、bootサーバが192.168.0.1の場合は以下のようになります。
分散環境のための設定としては、bootサーバを指定する必要があります。
boot_hostとknown_hostsの127,0,0,1の部分を、外部から接続可能なアドレスに変更することで設定できます。例えば、bootサーバのIPアドレスが192.168.0.1で、ポート番号が14195番の場合は以下のようになります。
bootサーバになるホストでも、レギュラーノードになるホストでも、以下の内容になります。
(厳密には、bootサーバの場合はboot_hostの項目だけ編集すれば良いですが)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Settings for TCP mode.
% (see cs_send.erl to switch)
% Insert the appropriate IP-addresses for your setup
% as comma separated integers:
% IP Address, Port, and label of the boot server
{boot_host, {{192,168,0,1},14195,boot}}.
% IP Address, Port, and label of a node which is already in the system
{known_hosts, [{{127,0,0,1},14195, service_per_vm}]}.
{known_hosts, [{{192,168,0,1},14195, service_per_vm}]}.
以下作成中
IPアドレスの区切り文字が.ではなく,である点に注意してください。
ファイルを編集したら、bootサーバを起動します。
# ./boot.sh
同様にレギュラーノードも起動します。
# ./cs_local.sh