CloudStack:クラスタ設計

7367 ワード

1.設備情報
管理ノード1:master 01.cloud.priv(centos6.9)(172.16.1.1)
cloudstack-management,DNSサーバ,NTPサーバ,MySQLサーバ
計算ノード1:node 01.cloud.priv(centos6.9)(172.16.2.1)
                    cloudstack-agent,KVM
計算ノード2:node 02.cloud.priv(centos6.9)(172.16.2.2)
                    cloudstack-agent,KVM
ストレージノード1:storage 01.cloud.priv(centos6.9)(172.16.3.1)
                    NFS
ストレージノード2:storage 02.cloud.priv(centos6.9)(172.16.3.2)
                    NFS
2.インストール構成
管理ノード1:
1.ネットワークの構成
hostsファイルを編集するには:
vi /etc/hosts

172.16.1.1 master01.cloud.priv
172.16.2.1 node01.cloud.priv
172.16.2.2 node02.cloud.priv
172.16.3.1 storage01.cloud.priv
172.16.3.2 storage01.cloud.priv

ネットワークプロファイルの編集
vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
HWADDR=52:54:00:B9:A6:C0
NM_CONTROLLED=no
ONBOOT=yes
BOOTPROTO=none
IPADDR=172.16.1.1
NETMASK=255.255.0.0
GATEWAY=172.16.0.1
DNS1=8.8.8.8
DNS2=8.8.4.4

2.ファイアウォールを閉じる
vi /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=permissive
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted

3.DNSサーバのインストール
yum install dnsmasq -y 

iptablesファイルを編集するには、次の手順に従います.
-A INPUT -p tcp -m tcp --dport 53 -j ACCEPT
-A INPUT -p udp -m udp --dport 53 -j ACCEPT

DNSサーバの起動
chkconfig dnsmasq on
service dnsmasq start

4.NTPサーバーのインストール
(1)ntpが存在するかどうかをまず決定し、存在しない場合は以下のコマンドでインストールする.
yum install ntp  

(2)プロファイルの変更
vim /etc/ntp.conf

挿入:
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
server 127.127.1.0
restrict 192.168.11.0 mask 255.255.255.0 nomodify notrap

注記リモートサーバを外し、ローカル用restrict管理権限nomodify-ユーザー側はntpサーバの時間パラメータnoqueryを変更できない-ユーザー側はntpq、ntpcなどのコマンドを使用してntpサーバnotrapをクエリーできない-trapリモートログインを提供しない
192.168.10.0/24-このセグメントのコンピュータにクロック同期を提供する
(3)ntpサービスを開始する
service ntpd restart
chkconfig ntpd on

5.CloudStackパッケージリポジトリの構成
vi /etc/yum.repos.d/cloudstack.repo

[cloudstack]
name=cloudstack
baseurl=http://cloudstack.apt-get.eu/centos/6/4.9/
enabled=1
gpgcheck=0

6.NFSストレージのインストール
yum install nfs-utils

nfsストレージディレクトリ構成の編集
vi /etc/exports

/export/secondary *(rw,async,no_root_squash,no_subtree_check)
/export/primary *(rw,async,no_root_squash,no_subtree_check)

1、2レベルのストレージディレクトリの作成
mkdir -p /export/primary
mkdir /export/secondary

nfsストレージポート構成の編集
vi /etc/sysconfig/nfs

LOCKD_TCPPORT=32803
LOCKD_UDPPORT=32769
MOUNTD_PORT=892
RQUOTAD_PORT=875
STATD_PORT=662
STATD_OUTGOING_PORT=2020

ファイアウォールポートの設定
vi /etc/sysconfig/iptables

-A INPUT -s 172.16.10.0/24 -m state --state NEW -p udp --dport 111 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -m state --state NEW -p tcp --dport 111 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -m state --state NEW -p tcp --dport 2049 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -m state --state NEW -p tcp --dport 32803 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -m state --state NEW -p udp --dport 32769 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -m state --state NEW -p tcp --dport 892 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -m state --state NEW -p udp --dport 892 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -m state --state NEW -p tcp --dport 875 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -m state --state NEW -p udp --dport 875 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -m state --state NEW -p tcp --dport 662 -j ACCEPT
-A INPUT -s 172.16.10.0/24 -m state --state NEW -p udp --dport 662 -j ACCEPT

NFSの起動
service iptables restart

service rpcbind start
service nfs start
chkconfig rpcbind on
chkconfig nfs on

6.CloudStack管理サーバのインストール
MySQLデータベースのインストール
yum -y install mysql-server

MySQLプロファイルの変更
vi /etc/my.cnf

 [mysqld]       :

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

MySQLサービスの起動
service mysqld start
chkconfig mysqld on

MySQLパッケージリポジトリの構成
vi /etc/yum.repos.d/mysql.repo

[mysql-connectors-community]
name=MySQL Community connectors
baseurl=http://repo.mysql.com/yum/mysql-connectors-community/el/$releasever/$basearch/
enabled=1
gpgcheck=1

MySQLからGPG公開鍵をインポートしmysql-connectorをインストールする
rpm --import http://repo.mysql.com/RPM-GPG-KEY-mysql
yum install mysql-connector-python

CloudStack管理サーバのインストール
yum -y install cloudstack-management

CloudStackデータベースpasswordをデータベースパスワードとして初期化
cloudstack-setup-databases cloud:password@localhost --deploy-as=root

CloudStack管理サーバの起動
cloudstack-setup-management

システムテンプレートのアップロード
/usr/share/cloudstack-common/scripts/storage/secondary/cloud-install-sys-tmplt \
-m /export/secondary \
-u http://cloudstack.apt-get.eu/systemvm/4.6/systemvm64template-4.6.0-kvm.qcow2.bz2 \
-h kvm -F

計算ノード1:
1.ネットワークの構成
hostsファイルを編集するには:
192.168.11.72 node01.cloud.priv

ネットワークプロファイルの編集
DEVICE=eth0
HWADDR=52:54:00:B9:A6:C0
NM_CONTROLLED=no
ONBOOT=yes
BOOTPROTO=none
IPADDR=192.168.11.71
NETMASK=255.255.255.0
GATEWAY=192.168.11.1
DNS1=8.8.8.8
DNS2=8.8.4.4

2.NTPサーバー
(1)ntpが存在するかどうかをまず決定し、存在しない場合は以下のコマンドでインストールする.
yum install ntp  

(2)プロファイルの変更
vim /etc/ntp.conf

リモート・サーバへのコメント、ローカル・ネットワーク・サーバへの設定
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
server 192.168.11.71
restrict 192.168.11.71 nomodify notrap noquery

(3)ntpサービスを開始する
ストレージノード1:
1.ネットワークの構成
hostsファイルを編集するには:
192.168.11.72 node01.cloud.priv

ネットワークプロファイルの編集
DEVICE=eth0
HWADDR=52:54:00:B9:A6:C0
NM_CONTROLLED=no
ONBOOT=yes
BOOTPROTO=none
IPADDR=192.168.11.71
NETMASK=255.255.255.0
GATEWAY=192.168.11.1
DNS1=8.8.8.8
DNS2=8.8.4.4

2.NTPサーバー
(1)ntpが存在するかどうかをまず決定し、存在しない場合は以下のコマンドでインストールする.
yum install ntp  

(2)プロファイルの変更
vim /etc/ntp.conf

リモート・サーバへのコメント、ローカル・ネットワーク・サーバへの設定
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
server 192.168.11.71
restrict 192.168.11.71 nomodify notrap noquery

(3)ntpサービスを開始する
service ntpd restart
chkconfig ntpd on

三、高級ネットワーク設計