5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

RaspberryPi2でプライベートクラウド(3)--cloudstack-managementのインストール--

Posted at

前回までにCloudStackをインストールするためのレポジトリの設定が完了しました。
今回はそのまま同じRpi2にCloudStack-managementをインストールします。

インストールの前にいくつかRpi2の設定を変更する必要があります。

・hostname,hostsの変更をします。インストール時にFQDNでのアクセスが必要になるので設定します。
1行目の「ubuntu」をお好きなFQDNに変更してください。

/etc/hostname
manager.linsys.local

6行目の「ubuntu」の箇所を先ほど変更したFQDNと同じ内容に変更します。

/etc/hosts
127.0.1.1       manager.linsys.local

・ネットワークのアドレスをstaticに設定します。
10行目以降を次のように書き換えます。(IPアドレスは適宜変更してください。)

/etc/network/interfaces
allow-hotplug eth0
iface eth0 inet dhcp
↓
# allow-hotplug eth0
auto eth0
iface eth0 inet static
address 192.168.234.201
netmask 255.255.255.0
gateway 192.168.234.1

・DNSを引けるように/etc/resolvconf/resolv.conf.dディレクトリにあるbaseファイルを修正します。

/etc/resolvconf/resolv.conf/d/base
nameserver 8.8.8.8

ここで一旦リブートして設定を反映させます。
次もrootで作業をします。

・apt-getでインストールできるようにsources.listを追加します。/etc/apt/sources.list.dフォルダにcloudstack.listを以下の内容で新規作成します。その後apt-get updateしておきます。

/etc/apt/sources.list.d/cloudstack.list
deb http://192.168.234.201/cloudstack ./

・CloudStack-managementとmysql-serverをインストールします。

console
root@manager:/# apt-get install cloudstack-management mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  augeas-lenses augeas-tools cloudstack-common jsvc libaio1 libaugeas0
  libcommons-daemon-java libdbd-mysql-perl libdbi-perl libevent-2.0-5
  libgssglue1 libhtml-template-perl libmysql-java libnfsidmap2
  libterm-readkey-perl libtirpc1 mysql-client-5.5 mysql-client-core-5.5
  mysql-server-5.5 mysql-server-core-5.5 nfs-common python-crypto
  python-paramiko rpcbind
Suggested packages:
  augeas-doc java-virtual-machine libclone-perl libmldbm-perl
  libnet-daemon-perl libplrpc-perl libsql-statement-perl
  libipc-sharedcache-perl tinyca mailx open-iscsi watchdog python-crypto-dbg
  python-crypto-doc
The following NEW packages will be installed:
  augeas-lenses augeas-tools cloudstack-common cloudstack-management jsvc
  libaio1 libaugeas0 libcommons-daemon-java libdbd-mysql-perl libdbi-perl
  libevent-2.0-5 libgssglue1 libhtml-template-perl libmysql-java libnfsidmap2
  libterm-readkey-perl libtirpc1 mysql-client-5.5 mysql-client-core-5.5
  mysql-server mysql-server-5.5 mysql-server-core-5.5 nfs-common python-crypto
  python-paramiko rpcbind
0 upgraded, 26 newly installed, 0 to remove and 1 not upgraded.
Need to get 208 MB of archives.
After this operation, 306 MB of additional disk space will be used.
Do you want to continue? [Y/n]
WARNING: The following packages cannot be authenticated!
  cloudstack-common cloudstack-management
Install these packages without verification? [y/N] y
・
・
・
root@manager:/#

途中で認証されていないと表示されますが、「y」を選択してください。

・my.cnfに設定を追加してから、mysql-serverを再起動します。

/etc/mysql/my.cnf
[mysqld]セクションの最後に追加(110行目以降)

innodb_rollback_on_timeout=1
innodb_lock_wait_timeout=600
max_connections=350
log-bin=mysql-bin
binlog-format = 'ROW'

・CloudStack-managementのtomcat6の設定を変更します。JAVA_HOME、JAVA_OPTSを変更します。

/etc/cloudstack/management/tomcat6.conf
31行目
JAVA_HOME="/usr/lib/jvm/java-7-openjdk-armhf"

44行目(-Xmx,-XX:PermSize,-XX:MaxPermSizeの設定値を変更しています。)
JAVA_OPTS="-Djava.awt.headless=true -Dcom.sun.management.jmxremote=false -Xmx512m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/log/cloudstack/management/ -XX:PermSize=256M -XX:MaxPermSize=512m"

もしかするとメモリはもっと効率のいい設定があるかもしれませんが、上記の設定で動作することは確認しています。

・続いてDBのセットアップになりますが、そのままだと途中でエラーが発生するのでスクリプトを修正します。修正するのは「/usr/share/cloudstack-management/setup/create-schema-premium.sql」です。

/usr/share/cloudstack-management/setup/create-schema-premium.sql
285行目に追加します。
USE cloud;

・DBのセットアップを実行します。

console
root@manager:~# cloudstack-setup-databases cloud:[パスワード]@localhost --deploy-as=root:[mysqlのrootパスワード]
Mysql user name:cloud                                                           [ OK ]
Mysql user password:******                                                      [ OK ]
Mysql server ip:localhost                                                       [ OK ]
Mysql server port:3306                                                          [ OK ]
Mysql root user name:root                                                       [ OK ]
Mysql root user password:******                                                 [ OK ]
・
・
・
CloudStack has successfully initialized database, you can check your database configuration in /etc/cloudstack/management/db.properties

root@manager:~#

・cloudstack-managementを起動します。ただし、ブラウザでログインできるようになるまで10分ほどかかります。

console
root@manager:~# cloudstack-setup-management
Starting to configure CloudStack Management Server:
Configure sudoers ...         [OK]
Configure Firewall ...        [OK]
Configure CloudStack Management Server ...[OK]
CloudStack Management Server setup is Done!
root@manager:~#

・ブラウザでcloudstack UIにアクセスします。アドレスは「http://[Rpi2のアドレス」:8080/client」です。
 日本語表示も問題ありません。ユーザー名/パスワードは「admin/password」です。
 表示されてしまうと意外に快適に動作しています。

cloudstack.PNG cloudstack2.PNG

今回はここまでです。

次回はcloudstac-agentのインストールです。ただし現状ではRpi2で動作しません。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?