Scalarisの分散環境用の設定方法

Scalarisを複数のノードで動作させるための設定方法について説明します。

想定する構成

1台のbootサーバに対して、複数台のレギュラーノードが接続するための設定を行います。 bootサーバとレギュラーノードがそれぞれ異なるPCの場合用の設定を行います。

設定ファイル

分散環境用の設定ファイルとしては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サーバを指定する必要があります。 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, [{{192,168,0,1},14195, service_per_vm}]}.

IPアドレスの区切り文字が.ではなく,である点に注意してください。 ファイルを編集したら、bootサーバを起動します。

# ./boot.sh

同様にレギュラーノードも起動します。

# ./cs_local.sh

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2010-04-29 (木) 09:58:19 (5109d)