시작하기전에
DevStack은 git master의 모든 최신 버전을 기반으로 완전한 OpenStack 환경을 빠르게 불러오는 데 사용되는 일련의 확장 가능한 스크립트입니다. 개발 환경과 OpenStack 프로젝트의 기능 테스트 대부분을 위한 기반으로 대화식으로 사용됩니다. 소스는 https://opendev.org/openstack/devstack 에서 사용할 수 있습니다 .
설치 환경
Ubuntu16.04, 18.04, 20.04 모두 구축을 진행하였다. 16.04, 18.04는 오류가 많아 진행에 어려움이 있었고, 20.04는 별도의 오류 없이 정상적으로 설치 완료를 했다. 오류를 해결하면서 진행하려면 16.04, 18.04로 경험을 하는것도 좋아보이나, 최종 목표가 DevStack 툴을 사용하지않고 OpenStack을 이용한 클라우드 환경 구축이라면 20.04를 통한 OpenStack 설치 후 맛만 보고 메인으로 넘어가는것을 추천한다.
Ubuntu 외에 Fedora, CentOS/RHEL, OpenSUSE 등 여러 환경에서 설치가 가능하다고하니 취향에 맞게 진행하면 된다.
Start with a clean and minimal install of a Linux system. DevStack attempts to support the two latest LTS releases of Ubuntu, the latest/current Fedora version, CentOS/RHEL 8, OpenSUSE and openEuler.
If you do not have a preference, Ubuntu 20.04 (Focal Fossa) is the most tested, and will probably go the smoothest.
설치전에
■ 1. stack 사용자 생성
$ sudo useradd -s /bin/bash -d /opt/stack -m stack
$ echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack
$ sudo su - stack
■ 2. DevStack 다운로드
$ git clone https://opendev.org/openstack/devstack
$ cd devstack
리포지토리에는 devstackOpenStack 및 구성 파일용 템플릿을 설치하는 스크립트가 포함되어 있다.
■ 3. local.conf 만들기
$ vi local.conf
[[local|localrc]]
ADMIN_PASSWORD=admin
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
HOST_IP=192.168.230.142
devstack git repo의 루트에 미리 설정된 4개의 비밀번호로 local.conf 파일을 만든다.
필자는 ADMIN_PASSWORD=admin 으로 설정하였으며, 다른 패스워드로 변경해도 상관없으며, 패스워드는 기억해두자.
HOST_IP는 본인의 IP를 확인 후 등록하면된다. ( $ ip addr )
■ 4. 설치 시작
$ ./stack.sh
이는 주로 인터넷 연결 속도에 따라 15~20분이 소요되며, 이 과정에서 많은 git tree와 패키지가 설치가 된다.
$ ./unstack.sh
설치 과정에서 오류가 발생하는 경우 ./unstack.sh를 통해 삭제 후 ./stack.sh를 통해 재설치를 진행하면된다.
설치가 정상적으로 완료되면 devstack은 keystone(인증), glance(이미지), nova(컴퓨트), placement(배포), cinder, neutron(네트워크) 및 horizon(대시보드)를 설치한것이며, Horizon(대시보드)에 접속하여 OpenStack에 대한 웹 인터페이스를 경험하고 vms, 네트워크, 볼륨 및 이미지를 관리할 수 있다.
■ 5. 대시보드 접속
본인의 HOST_IP(http://192.168.230.142)로 접근 후 admin/admin 접속
내용 정리 및 오류
■ Ubuntu vmtools 설치
ubuntu 20.04
$ sudo apt update
$ sudo apt install open-vm-tools
$ sudo apt install open-vm-tools-desktop
ubuntu 16.04
$ sudo apt-get install open-vm-tools-desktop
■ git 설치 시 에러
$ sudo get install git
E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
$ sudo rm /var/lib/apt/lists/lock
$ sudo rm /var/cache/apt/archives/lock
$ sudo rm /var/lib/dpkg/lock*
$ sudo dpkg --configure -a
$ sudo apt update
$ sudo get install git
■ git clone 시 에러
$ git clone https://opendev.org/openstack/devstack
fatal: unable to access 'https://git.openstack.org/openstack-dev/devstack/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
$ git config --global http.sslVerify false
--global : 전역 설정
http.sslVerify=false : [http] 섹션의 git의 sslVerify 옵션 비활성화
$ git clone https://opendev.org/openstack/devstack
■ 설치 진행 시 발생 에러
$ ./stack.sh
[ERROR] ./stack.sh:235 If you wish to run this script anyway run with FORCE=yes
/opt/stack/devstack/functions-common: line 299: /opt/stack/logs/error.log: No such file or directory
$ FORCE=yes ./stack.sh
■ 권한 에러
Exception:
Traceback (most recent call last):
File "/opt/stack/requirements/.venv/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/opt/stack/requirements/.venv/lib/python3.6/site-packages/pip/commands/install.py", line 342, in run
requirement_set.prepare_files(finder)
File "/opt/stack/requirements/.venv/lib/python3.6/site-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/opt/stack/requirements/.venv/lib/python3.6/site-packages/pip/req/req_set.py", line 554, in _prepare_file
require_hashes
File "/opt/stack/requirements/.venv/lib/python3.6/site-packages/pip/req/req_install.py", line 281, in populate_link
self.link = self._wheel_cache.cached_wheel(self.link, self.name)
File "/opt/stack/requirements/.venv/lib/python3.6/site-packages/pip/wheel.py", line 68, in cached_wheel
self._cache_dir, link, self._format_control, package_name)
File "/opt/stack/requirements/.venv/lib/python3.6/site-packages/pip/wheel.py", line 129, in cached_wheel
wheel_names = os.listdir(root)
PermissionError: [Errno 13] Permission denied: '/opt/stack/.cache/pip/wheels/25/af/b8/3407109267803f4015e1ee2ff23be0c8c19ce4008665931ee1'
$ sudo chown -R stack:stack /opt/stack
$ ./stack
■ function-common 파일 내 dead 에러
[ERROR] /opt/stack/devstack/functions-common:1194 failed to update apt repos, we're dead now
$ vi /opt/stack/devstack/functions-common
/dead (dead를 찾은후 300 -> 1000 변경 후 저장)
Reference
https://docs.openstack.org/devstack/latest/
'ETC' 카테고리의 다른 글
[WSL2] Windows Subsystem for Linux 2(WSL 2) 설치 방법 (2) | 2024.11.13 |
---|---|
[Python] pdf to enc 변환 코드 (0) | 2023.12.12 |
[Python] hwp to pdf 변환 코드 (0) | 2023.12.12 |
[PowerShell] 파워쉘 사용법 공부하기 (0) | 2023.10.17 |
[OpenStack] DevStack을 이용한 오픈스택 설치(1) (0) | 2022.02.07 |