티스토리 뷰


데브스택을 이용해 오픈스택을 설치해보자

오픈스택을 처음 설치하는 사람이라면 데브스택(DevStack)을 이용한 설치 방법을 권장합니다. 다른 설치 방법에 비해 간단하고 환경설정만으로도 다양한 방법의 설치 및 설정이 가능합니다. 데브스택은 http://docs.openstack.org/developer/devstack/ 사이트에 방문하면 해당 스크립트에 대한 정보를 얻을 수 있습니다. 오픈스택을 처음 입문하는 사람들을 위한 설치 스크립트로써 설치는 쉽지만 서버를 재부팅하면 서비스를 재설치해야 한다는 단점이 있습니다. 한마디로 기존 데이터가 모두 초기화되는 것이죠.  

 

데브스택을 이용한 오픈스택 설치 전 준비

 

1.     데브스택으로 오픈스택을 설치하기 전에 네트워크 환경을 먼저 설정해 보도록 하겠습니다. 우선, /etc/network/interfaces 파일을 vi를 이용해 열어서 보면 아래와 같이 설정이 되어 있는 것을 확인 할 수 있습니다. 기존에는 네트워크 디바이스명이 eth로 시작을 하였으나 최근에는 enp로 시작합니다.

nalee@ubuntu:~$ sudo vi /etc/network/interfaces

# This file describes the network interfaces available on your system

# and how to activate them. For more information, see interfaces(5).

 

source /etc/network/interfaces.d/*

 

# The loopback network interface

auto lo

iface lo inet loopback

 

# The primary network interface

auto enp0s3

iface enp0s3 inet dhcp

 

2.     그럼, 네트워크 인터페이스를 본인의 네트워크 환경에 맞추어 설정을 합니다. 저와 같은 경우에는 아래와 같이 설정을 하였습니다. enp0s3는 퍼블릭 IP를 연결할 게이트웨이로 사용할 예정이고, enp0s8dhcp로 설정을 하여 관리용 IP로 사용할 예정입니다.

nalee@ubuntu:~$ sudo vi /etc/network/interfaces

# This file describes the network interfaces available on your system

# and how to activate them. For more information, see interfaces(5).

 

source /etc/network/interfaces.d/*

 

# The loopback network interface

auto lo

iface lo inet loopback

 

# The primary network interface

auto enp0s3

iface enp0s3 inet static

  address 192.168.0.19

  netmask 255.255.255.0

  gateway 192.168.0.1

  dns-nameservers 8.8.8.8

 

auto enp0s8

iface enp0s8 inet dhcp

 

3.     네트워크 설정이 끝나면 아래와 같은 명령어를 이용하여 설정한 IP를 적용합니다.

nalee@ubuntu:~$ sudo systemctl restart networking

 

4.     이제 설정한 IP가 제대로 적용이 되었는지 ifconfig 명령을 통해 확인을 합니다. Dhcp를 통해 할당받은 IP 192.168.56.101로 설정이 되어있는것을 확인할 수 있습니다.

nalee@ubuntu:~$ ifconfig

enp0s3    Link encap:Ethernet  HWaddr 08:00:27:59:25:a1 

          inet addr:192.168.0.19  Bcast:192.168.0.255  Mask:255.255.255.0

          inet6 addr: fe80::a00:27ff:fe59:25a1/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:7891 errors:0 dropped:0 overruns:0 frame:0

          TX packets:4004 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:8446937 (8.4 MB)  TX bytes:448434 (448.4 KB)

 

enp0s8    Link encap:Ethernet  HWaddr 08:00:27:3a:72:f2 

          inet addr:192.168.56.101  Bcast:192.168.56.255  Mask:255.255.255.0

          inet6 addr: fe80::a00:27ff:fe3a:72f2/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:1453 errors:0 dropped:0 overruns:0 frame:0

          TX packets:1317 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:107024 (107.0 KB)  TX bytes:232428 (232.4 KB)

 

lo        Link encap:Local Loopback 

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:65536  Metric:1

          RX packets:160 errors:0 dropped:0 overruns:0 frame:0

          TX packets:160 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1

          RX bytes:11840 (11.8 KB)  TX bytes:11840 (11.8 KB)

 

virbr0    Link encap:Ethernet  HWaddr 52:54:00:3d:28:2f 

          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

 

5.     데브스택을 설치하려면 stack이라는 사용자 계정이 필요합니다. stack 사용자 계정을 추가하려면 root 계정에서 추가해야 하므로 다음과 같이 root 계정 패스워드를 설정합니다.

nalee@ubuntu:~$ sudo passwd root

Enter new UNIX password:

Retype new UNIX password:

passwd: password updated successfully

nalee@ubuntu:~$

 

6.     패스워드가 설정되면 root 계정으로 전환한 뒤 stack 사용자 계정을 추가합니다. sudo를 패스워드 없이 사용할 수 있는 권한을 stack 계정에 설정합니다. 그리고 stack 계정 로그인을 위해서 패스워드를 설정합니다.

root@ubuntu:~# useradd -U -G sudo -s /bin/bash -m stack

root@ubuntu:~# echo "stack ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers

root@ubuntu:~# passwd stack

Enter new UNIX password:

Retype new UNIX password:

passwd: password updated successfully

root@ubuntu:~#

 

7.     stack 계정이 추가되면 root 계정에서 stack 계정으로 사용자를 전환합니다.

root@ubuntu:~# su stack

To run a command as administrator (user "root"), use "sudo <command>".

See "man sudo_root" for details.

 

stack@ubuntu:/root$ cd

stack@ubuntu:~$

 

최근에 올라온 글
최근에 달린 댓글
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
글 보관함