티스토리 뷰

안녕하세요~!!

지난시간에 이어 오늘은 CentOS6.5를 설치하고 거기에 컨트롤러 노드와 컴퓨트 노드를 설치해 보도록 하겠습니다.
이번 시간에는 컨트롤러 노드의 기본 패키지들을 설치해 볼 예정입니다. 앞에서 Ubuntu에서 설치할 때와 같은 내용이 설치되며, 바뀌는 것이 있다면 OS와 설치명령어가 바뀔뿐입니다. 

그럼, 지금부터 컨트롤러 노드를 설치해 볼까요~!!

컨트롤러 노드를 설치해 보자

앞에서 우리는 오픈스택을 설치하기 위한 시스템 구성도를 그려보았습니다. 먼저 컨트롤러 노드에 데이터베이스, 메시지 서비스, 오픈스택 기본 서비스와 인스턴스의 가상 디스크를 관리하는 블록 스토리지 서비스를 설치하겠습니다.

네트워크 인터페이스 설정

CentOS를 설치하면 네트워킹을 위한 IP를 설정해야 합니다. 우분투 서버와 다르게 /etc/sysconfig/network-scripts 디렉터리에 들어가면 각각의 이더넷 카드에 해당하는 환경 설정 파일이 존재합니다. 그럼 지금부터 IP를 설정하겠습니다.

 

1.     /etc/sysconfig/network-scripts/ifcfg-eth0 파일을 vi 편집기로 열어 다음과 같이 편집합니다. no로 되어 있는 ONBOOT 값을 yes로 변경하고, dhcp로 되어 있는 BOOTPROTOnone로 변경합니다. 그리고 IPADDR, NETMASK, GATEWAY, DNS1을 설정합니다.

# vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0

HWADDR=08:00:27:EC:43:E0

TYPE=Ethernet

UUID=84a27f42-ea7d-4f11-a965-2d735f9560e3

ONBOOT=yes

NM_CONTROLLED=yes

BOOTPROTO=none

IPADDR=10.10.15.11

NETMASK=255.255.255.0

GATEWAY=10.10.15.1

DNS1=8.8.8.8

 

2.     /etc/hosts 파일을 열어 다음과 같이 컨트롤러 노드, 컴퓨트 노드의 IP 정보를 등록합니다.

# vi /etc/hosts

# controller

10.10.15.11       controller

# compute

10.10.15.21       compute

 

3.     네트워크 인터페이스 설정이 완료되면 시스템에 적용될 수 있도록 네트워크 서비스를 재시작합니다.

# service network restart

 

NTP 설치

NTPNetwork Time Protocol의 약자로 서버와 서버 간 시간을 동기화하는 프로토콜입니다. 컨트롤러 노드에는 NTP 서버를, 그 외 노드에는 NTP 클라이언트를 설치하고 NTP 서버의 시각으로 동기화합니다.

 

1.     yum install을 이용해서 ntp를 설치합니다.

# yum install ntp

Loaded plugins: fastestmirror, security

base                                                                                       | 3.7 kB     00:00    

base/primary_db                                                                            …

Setting up Install Process

Package ntp-4.2.6p5-1.el6.centos.x86_64 already installed and latest version

Nothing to do

 

2.     ntp 설치가 완료되면 ntp.conf에 자신을 나타내는 127.127.1.0을 추가해야 합니다. 이때 기존에 설정되어 있는 server들은 모두 주석 처리합니다.

# vi /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

 

3.     ntp.conf 파일 수정이 완료되면 ntp 서버를 시작합니다. 그리고 부팅 시 ntp 서비스가 자동으로 실행될 수 있도록 설정합니다.

# service ntpd start
Starting ntpd:                                             [  OK  ]
# chkconfig ntpd on

 

4.     ntp 시각이 동기화 되었는지 확인합니다.

# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
===========================================================
*LOCAL(0)        .LOCL.           5 l   43   64  377    0.000    0.000   0.004

 

 

Database 설치

NTP 서버를 설치했으면 이번에는 데이터베이스 서비스를 설치해야 합니다. 오픈스택의 기본 데이터베이스는 MySQL이며, IceHouse 버전이 릴리즈되면서 mariaDB도 설치가 가능합니다.

 

1.     Mysql-servermysql python 모듈을 설치합니다. 중간에 총 다운로드 사이즈가 11M인데 계속 설치하겠느냐는 메시지가 나오면 y를 입력하고 엔터를 누릅니다.

# yum install mysql mysql-server MySQL-python

Total download size: 11 M

Is this ok [y/N]: y

 

2.     Mysql 서버 설치가 완료되면 /etc/my.cnf 파일을 열어 다음과 같이 bind-address storage-engine, character-set을 설정합니다. 이때 bind-address는 컨트롤러 노드 IP를 입력합니다.

# vi /etc/my.cnf

[mysqld]

bind-address = 10.10.15.11

default-storage-engine = innodb

innodb_file_per_table

collation-server = utf8_general_ci

init-connect = 'SET NAMES utf8'

character-set-server = utf8

 

3.     환경설정이 끝나면 mysql 서비스를 시작합니다. 그리고 chkconfig를 이용해서 재부팅 시에도 mysql이 자동으로 실행될 수 있도록 다음과 같이 mysqldon을 설정합니다.

# service mysqld start

# chkconfig mysqld on


4.     이번에는 MySQL root 사용자 패스워드를 다음과 같은 명령어로 설정합니다. 여기서는 Mysqlroot 패스워드를 openstack이라고 설정했습니다.

# mysqladmin -u root password ‘openstack’

 

5.     mysql의 기본 데이터베이스 및 테이블 설치를 위하여 mysql_install_db를 실행합니다.

# mysql_install_db

WARNING: The host 'controller.openstack' could not be looked up with resolveip.

This probably means that your libc libraries are not 100 % compatible

with this binary MySQL version. The MySQL daemon, mysqld, should work

normally with the exception that host name resolving will not work.

This means that you should use IP addresses instead of hostnames

when specifying MySQL privileges !

Installing MySQL system tables...

OK

Filling help tables...

OK

 

To start mysqld at boot time you have to copy

support-files/mysql.server to the right place for your system

 

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !

To do so, start the server, then issue the following commands:

 

/usr/bin/mysqladmin -u root password 'new-password'

/usr/bin/mysqladmin -u root -h controller.openstack password 'new-password'

 

Alternatively you can run:

/usr/bin/mysql_secure_installation

 

which will also give you the option of removing the test

databases and anonymous user created by default.  This is

strongly recommended for production servers.

 

See the manual for more instructions.

 

You can start the MySQL daemon with:

cd /usr ; /usr/bin/mysqld_safe &

 

You can test the MySQL daemon with mysql-test-run.pl

cd /usr/mysql-test ; perl mysql-test-run.pl

 

Please report any problems with the /usr/bin/mysqlbug script!

 

6.     Mysql 테이블 생성 후에는 익명의 Anonymous 계정을 삭제해야 합니다. 익명의 사용자 계정을 삭제하려면 다음과 같이 mysql_secure_installation을 실행합니다.

# mysql_secure_installation

 

 

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL

      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

 

 

In order to log into MySQL to secure it, we'll need the current

password for the root user.  If you've just installed MySQL, and

you haven't set the root password yet, the password will be blank,

so you should just press enter here.

 

Enter current password for root (enter for none): ********

OK, successfully used password, moving on...

 

Setting the root password ensures that nobody can log into the MySQL

root user without the proper authorisation.

 

You already have a root password set, so you can safely answer 'n'.

 

Change the root password? [Y/n] n

 ... skipping.

 

By default, a MySQL installation has an anonymous user, allowing anyone

to log into MySQL without having to have a user account created for

them.  This is intended only for testing, and to make the installation

go a bit smoother.  You should remove them before moving into a

production environment.

 

Remove anonymous users? [Y/n] y

 ... Success!

 

Normally, root should only be allowed to connect from 'localhost'.  This

ensures that someone cannot guess at the root password from the network.

 

Disallow root login remotely? [Y/n] n

 ... skipping.

 

By default, MySQL comes with a database named 'test' that anyone can

access.  This is also intended only for testing, and should be removed

before moving into a production environment.

 

Remove test database and access to it? [Y/n] y

 - Dropping test database...

 ... Success!

 - Removing privileges on test database...

 ... Success!

 

Reloading the privilege tables will ensure that all changes made so far

will take effect immediately.

 

Reload privilege tables now? [Y/n] y

 ... Success!

 

Cleaning up...

 

 

 

All done!  If you've completed all of the above steps, your MySQL

installation should now be secure.

 

Thanks for using MySQL!

 

Packages 설치

데이터베이스 설치가 완료되면 최신 버전의 오픈스택 패키지를 설치해야 합니다. CentOS6.5 버전에서 설치할 수 있는 버전이 IceHouse이므로 IceHouse를 설치하기 위한 패키지를 설치하겠습니다.

 

1.     Yum install을 이용해서 RDO 레파지토리를 사용하기 위한 yum-plugin-priorities를 설치합니다.

# yum install yum-plugin-priorities

 

2.     이번에는 다음과 같은 명령어로 rdo-release-icehouse 내려 받고 설치합니다.

# yum install http://repos.fedorapeople.org/repos/openstack/openstack-icehouse/rdo-release-icehouse-4.noarch.rpm

 

3.     EPEL 패키지는 패키지 서명 및 저장소 정보에 대한 GPG(GNU Privacy Guard) 키가 포함되어 있습니다. EPEL 패키지는 레드햇, CentOS에 설치되어야 하며 설치 방법은 다음과 같습니다.

# yum install http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

 

4.     이번에는 Openstack-utils를 설치합니다. Openstack-utlis에는 설치 및 시스템 구성을 쉽게 할 수 있는 유틸리티 프로그램이 포함되어 있습니다.

# yum install openstack-utils

 

5.     OpenStack-selinux 패키지는 RHEL CentOS에 대한 OpenStack 설치 과정에서 SELinux를 구성하는 데 필요한 정책 파일이 포함되어 있습니다.

# yum install openstack-selinux


6.     패키지 설치가 모두 완료되면 시스템을 업그레이드합니다.

# yum upgrade

 

7.     업그레이드가 완료되면 시스템을 재부팅합니다.

# reboot

 

Qpid 설치

우분투 서버에서 메시지 서비스로 RabbitMQ를 설치했다면 레드햇이나 CentOS에서는 Qpid를 설치해 보겠습니다. 우분투 서버와 달리 레드햇이나 CentOS에서는 RabbitMQ보다 Qpid를 더 많이 지원합니다.

 

1.     Yum install을 이용해서 Qpid를 설치합니다.

# yum install qpid-cpp-server

 

2.     오픈스택을 쉽게 설치하기 위해 인증을 사용하지 않도록 /etc/qpidd.conf 파일을 열어 다음과 같이 설정합니다.

# vi /etc/qpidd.conf
auth=no

 

3.     Qpid 서버를 시작하고 부팅 시 Qpid 서비스가 자동 시작될 수 있도록 다음과 같이 설정합니다.

# service qpidd start
Starting Qpid AMQP daemon:                                 [  OK  ]
# chkconfig qpidd on

 

이렇게 해서 필수 컴포너트들을 설치해 보았습니다. 다음시간에는 Keystone을 설치해 보도록 하겠습니다.

그럼, 다음시간에 다시 만나요~!!

최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/03   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
글 보관함