CentOSでのMyPLCインストール

CentOSで、MyPLCを構築するためのメモです。
yumが使用出来れば、他のディストリビューションでも同じようにできると思われます。
ちなみにCentOS5.5での作業メモです。

■準備・インストール編

selinuxを無効にする

selinuxが有効だと、MyPLCのサービスが起動しなかったりと
挙動に影響が出るので無効にしておきます。
具体的には、空パスが設定されるところに、違うパスワードが設定されたりします。

/etc/sysconfig/selinuxを編集。
SELINUX=enforcingSELINUX=disabled に変更します。

yum用のファイルの作成

MyPLCをyumで入手するために、レポジトリの設定ファイルを作成します。
/etc/yum.repo/myplc.repoなどの名前で保存します。

[myplc]
name= MyPLC
baseurl=http://build.planet-lab.org/planetlab/centos5/planetlab-centos5-i386-5.0-rc10/RPMS/
enabled=1
gpgcheck=0

baseurlのURL部分は、使いたいバージョンや
PLC用ホストのOS等に合わせて変更します。

作成後、yumでmyplcをインストールします。

# yum install myplc

MyPLC本体を含めて、必要なパッケージが一通りインストールされます。
・・・のはずだったんですが、build.planet-lab.orgが落ちていたり
依存関係が解決できなくてエラーが出たりしてるので
今回はyumの必要ないRPMを使用しています。

・設定・起動

plc-config-ttyというコマンドが用意されており
インタラクティブに各項目を設定できます。
DNS以外は、基本的に自分自身のIPアドレスを入力すればOKです。
ただし、127.0.0.1などを指定してはいけません。
ここで指定したアドレスはインストーラで使用されるので
少なくとも、インストールするノードから到達性のあるアドレスを指定します。

DNSについてはPLCから利用するDNSサーバを指定します。

一通り入力した後、コマンドを入力できます。
wで設定を反映させた後、rでサービスを再起動

-bash-3.2# plc-config-tty
Enter command (u for usual changes, w to save, ? for help) u
== PLC_NAME : [PlanetLab Test] PlanetLab on OpenNebula
== PLC_SLICE_PREFIX : [pl]
== PLC_ROOT_USER : [root@localhost.localdomain] nanodayo@nanodayo.org
== PLC_ROOT_PASSWORD : [root]
== PLC_MAIL_ENABLED : [false]
== PLC_MAIL_SUPPORT_ADDRESS : [root+support@localhost.localdomain] nanodayo@nanodayo.org
== PLC_DB_HOST : [localhost.localdomain] 192.168.122.219
== PLC_API_HOST : [localhost.localdomain] 192.168.122.219
== PLC_WWW_HOST : [localhost.localdomain] 192.168.122.219
== PLC_BOOT_HOST : [localhost.localdomain] 192.168.122.219
== PLC_NET_DNS1 : [127.0.0.1] 192.168.122.1
== PLC_NET_DNS2 : [None]
Enter command (u for usual changes, w to save, ? for help) w
Wrote /etc/planetlab/configs/site.xml
Merged
/etc/planetlab/default_config.xml
and /etc/planetlab/configs/site.xml
into /etc/planetlab/plc_config.xml
+ service plc reload
You might want to type 'r' (restart plc) or 'q' (quit)
Enter command (u for usual changes, w to save, ? for help) r
==================== Stopping plc
PLC: Stopping crond: [ OK ]
PLC: Reverting /etc/resolv.conf and /etc/hosts: PLC: Stoppi[ OK ]erver:
[ OK ]
PLC: Stopping web server: [ OK ]
PLC: Stopping database server: [ OK ]
PLC: Stopping mail server: [ OK ]
PLC: Shutting down system logger: [ OK ]
[ OK ]
==================== Starting plc
PLC: Generating network files: [ OK ]
PLC: Starting system logger: [ OK ]
PLC: Starting database server: [ OK ]
PLC: Generating SSL certificates: [ OK ]
PLC: Configuring the API: [ OK ]
PLC: Updating GPG keys: [ OK ]
PLC: Generating SSH keys: [ OK ]
PLC: Starting web server: [ OK ]
PLC: Bootstrapping the database: [ OK ]
PLC: Starting DNS server: PLC: Configuring resolv.conf: [ OK ]
PLC: Starting crond: [ OK ]
PLC: Rebuilding Boot CD: [ OK ]
PLC: Rebuilding Boot Manager: [ OK ]
PLC: Signing and indexing node packages: [ OK ]
Enter command (u for usual changes, w to save, ? for help) q

一通りのサービスがOKとでれば完了です。