티스토리 뷰

안녕하세요~!!

서비스 구성도도 그렸고, 서버 준비도 완료를 하였습니다. 이제 컨트롤러 노드를 한번 설치해 볼까요?
이번에 컨트롤러 노드의 모든 서비스를 다 설치를 하지는 않을 것입니다. 왜냐하면 내용이 너무 많아서죠~!! 오늘은 지난 시간에 그렸던 서비스 구성도에서 아래 노란색깔로 표시해 놓은 써포팅 서비스와 네트워크 환경을 설정할 것입니다. 



그럼, 한번 시작해 볼까요~~~

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

서버를 준비하고 최신 우분투 서버를 설치했으면 이번에는 컨트롤러 노드를 설치하겠습니다. 컨트롤러 노드는 데이터베이스, 메시지 서비스, 오픈스택 기본 서비스, 필요에 따라 설치하는 옵션 서비스가 설치됩니다.

 

네트워크 인터페이스 설정

오픈스택을 설치하려면 가장 먼저 네트워크 IP를 설정해야 합니다. 모니터링과 관리를 위해 컨트롤러 노드에 설정할 IP는 네트워크 노드와 컴퓨트 노드의 서버 역할을 합니다.

 

1.     /etc/network/interfaces 파일을 vi 편집기로 열고 eth0 네트워크 IP를 설정합니다. 이때 설정할 네트워크 IP 정보는 앞서 그려본 시스템 구성도(xx쪽 참조)의 네트워크 IP를 입력합니다.

$ sudo vi /etc/network/interfaces

# The loopback network interface

auto lo

iface lo inet loopback

 

# The primary network interface

auto eth0

iface eth0 inet static

           address 10.10.15.11

           netmask 255.255.255.0

           gateway 10.10.15.1

 

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

$ sudo vi /etc/hosts

# controller

10.10.15.11       controller

# network

10.10.15.21       network

# compute1

10.10.15.31compute1

 

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

$ sudo service networking stop && sudo service networking start


*** 지난번 블로그에 포스팅한 내용을 보셨나요? Ubuntu Server 14.04 LTS 버전에서 오픈스택을 설치하시는 분이시라면 당연히 위와 같이 설정을 해 주어야 합니다. 그런데, 14.04 LTS 버전에서 네트워크 설정시 문제가 발생한다고 하였습니다. 저는 그래서, Ubuntu 12.04 LTS 버전에서 설치를 했었습니다. 해결 방법은 아래 블로그에 포스팅해 드렸으니 참조하시길 바랍니다.


 [Ubuntu] Ubuntu 14.04와 13.10에 대한 Networking 서비스 차이


NTP 설치

NTPNetwork Time Protocol로 서버와 서버간의 시간을 동기화하기 위해서 설치합니다. 컨트롤러 노드에는 NTP 서버를 설치하고 그 외 다른 노드에는 NTP 클라이언트를 설치합니다. NTP는 여러 노드를 사용하는 클라우드 시스템에서 자원을 예약하고 사용하고 삭제할 때의 시간을 기록하여 노드간의 시간을 동기화하는 중요한 역할을 합니다.


1.     apt-get을 이용해서 ntp를 설치합니다.

$ sudo apt-get install –y ntp

 

2.     ntp 설치가 완료되면 ntp.conf로컬 호스트를 나타내는 127.127.1.0을 추가해야 합니다. 이때 다음과 같이 sed 명령어를 이용해서 추가하는 방법과 vi 에디터로 직접 추가하는 방법이 있습니다.

$ sudo sed -i 's/server ntp.ubuntu.com/server ntp.ubuntu.com\nserver 127.127.1.0\n
fudge 127.127.1.0 stratum 10/g' /etc/ntp.conf


3.     ntp.conf 파일 수정이 완료되면 ntp 서버를 재시작합니다.

$ sudo service ntp restart
* Stopping NTP server ntpd                                                [ OK ]
 * Starting NTP server ntpd                                                 [ OK ]

 


 

데이터베이스 설치

오픈스택의 모든 서비스는 데이터베이스에 정보를 저장합니다. 그렇기 때문에 오픈스택 서비스를 설치하기 전에 데이터베이스를 먼저 설치해야 합니다. 오픈스택의 기본 데이터베이스는 mysql이며 아이스하우스 버전에서부터는 MariaDB도 설치 가능합니다. ** Juno 버전의 설치문서를 보시면 "apt-get install mariadb-server python-mysqldb"를 설치하도록 되어 있습니다. 이부분은 당연히 잘못된 부분이겠죠~!! 아래와 같이 설치하셔야 합니다.

 

1.     apt-get을 이용해서 python-mysqldbmysql-server를 설치합니다.

$ sudo apt-get install python-mysqldb mysql-server


2.     Mysql 서버를 설치하다 보면 root 패스워드를 입력하라는 창이 뜹니다. 사용하고자 하는 패스워드를 입력하고 엔터를 누릅니다. 


3.     다시 한번 패스워드를 확인하면 앞서 입력한 패스워드를 입력하고 엔터를 누릅니다. 


4.     Mysql 서버 설치가 완료되면 /etc/mysql/my.cnf bind-addresscharacter-setutf8로 설정합니다. 이때 bind-address는 컨트롤러 노드 IP를 입력합니다.

$ sudo vi /etc/mysql/my.cnf
[mysqld]
...
bind-address = 10.10.15.11
...
default-storage-engine = innodb
collation-server = utf8_general_ci
init-connect = 'SET NAMES utf8'
character-set-server = utf8

 

5.     환경설정이 완료되면 mysql 서버를 재시작합니다.

$ sudo service mysql restart

 

6.     서버를 재 시작한 후 mysql의 기본 데이터베이스 및 테이블 설치를 위해 mysql_install_db를 실행합니다. 이때 root 계정 패스워드를 입력하라고 메시지가 나오면 mysql 서버 설치 시 입력했던 패스워드를 입력합니다.

$ sudo mysql_install_db
Installing MySQL system tables...
140527 13:13:30 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is
 deprecated and will be removed in a future release. Please use the full name instead.
OK
Filling help tables...
140527 13:13:30 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is 
deprecated and will be removed in a future release. Please use the full name instead.
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 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 at http://bugs.mysql.com/


7.     Mysql 서버 설치 후에는 반드시 익명의 Anonymous 계정을 삭제해야 합니다. 이 계정을 삭제하지 않으면 데이터베이스 연결 문제가 발생합니다. 익명의 사용자 계정을 삭제하려면 mysql_secure_installation을 실행합니다.

$ sudo 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] y
... Success!
 
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...
ERROR 1008 (HY000) at line 1: Can't drop database 'test'; database doesn't exist
 ... Failed!  Not critical, keep moving...
 - 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 설치

간혹 오픈스택 버전 패키지를 설치하지 않아서 오픈스택이 제대로 설치되지 않고 에러가 종종 발생합니다. 그렇기 때문에 설치하고자 하는 버전의 패키지를 반드시 설치해야 합니다.

 

1.     apt-get을 이용해서 python-software-properties를 설치하고 레파지토리에 icehouse를 추가합니다.

$ sudo apt-get install python-software-properties
$ sudo add-apt-repository cloud-archive:icehouse

** "오픈스택을 다루는 기술"에서는 IceHouse 버전으로 오픈스택을 설치했습니다. 그러나 얼마전에 Juno가 릴리즈되었죠~!! Juno를 설치하시고 싶으신 분들은 클라우드 아카이브를 설정하실때 아래와 같이 juno로 설정하시면 됩니다.

$ sudo add-apt-repository cloud-archive:juno 


2.     패키지가 설치되면 시스템 업데이트 및 업그레이드를 실행합니다.

$ sudo apt-get update

$ sudo apt-get dist-upgrade

 

3.     이때 컨트롤러 노드의 우분투 버전이 12.04라면 다음과 같이 백포트된 리눅스 커널을 설치해야 합니다. 12.04에 설치된 리눅스 커널은 버전이 오래되었으므로 요즘 나오는 하드웨어를 운영하려면 아래와 같이 최신 리눅스 커널을 설치해야 합니다. 리눅스 커널은 최신 네트워크 드라이버를 사용하는 Neutron일 경우에는 최신 커널을 설치하는 것이 좋고, Nova-network를 사용하는 경우에는 설치하지 않아도 됩니다.

$ sudo apt-get install linux-image-generic-lts-saucy linux-headers-generic-lts-saucy

** 좋은게 좋은거라고 저 같은 경우는 ubuntu 12.04 버전에서 오픈스택을 설치하였기 때문에 이 부분도 그냥 설치했습니다. 


4.     패키지 설치와 시스템 업그레이드가 완료되면 시스템을 재부팅합니다.

$ sudo reboot

 

RabbitMQ 설치

이번에는 모든 서비스의 메시지를 주고 받는 서버를 설치하겠습니다. 오픈스택의 기본 메시지 서버는 RabbitMQ입니다.

 

1.     RabbitMQ Server를 설치합니다.

$ sudo apt-get install rabbitmq-server

 

2.     RabbitMQ Server 설치가 완료되면 패스워드를 변경합니다. 사용하고자 하는 패스워드를 입력해서 변경합니다.

$ sudo rabbitmqctl change_password guest rabbitpass
Changing password for user "guest" ...
...done.

 


이렇게 해서 컨트롤러 노드의 네트워크 환경설정과 반드시 설치해야만 하는 써포팅 서비스들을 설치해 보았습니다. 독자분들을 위하여 중간중간에 "오픈스택을 다루는 기술"에서 다루지 못한 부분을 추가하였습니다. 참고하시면 도움이 되실 듯 합니다. 


그럼 다음시간에는 인증 서비스인 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
글 보관함