[M/W] RockyLinux 9 환경에서 OpenSearch 구성 및 테스트 - I - Docker Compose
페이지 정보
작성자 꿈꾸는여행자 작성일 25-12-09 17:49 조회 287 댓글 0본문
안녕하세요.
꿈꾸는여행자입니다.
최근 ElasticSearch 관련 사항들이 많이 대두되고 있고,
ElasticSearch는 라이센스 이슈로 못사용하는 것이 많아지고 있습니다.
이에 OpenSearch 관련하여 검토하여 이를 구성하는 방법을 알아보고자 합니다.
이번 항목에서는
Docker Compose 구성 관련 사항입니다.
상세 내역은 아래와 같습니다.
감사합니다.
> 아래
________________
목차
III. OpenSearch
1. Docker
1.1. Docker 설치
1.2. Docker Compose 설치
상세
III. OpenSearch
1. Docker
1.1. Docker 설치
RockyLinux 에서 Docker 및 Docker Compose를 사용하여 `docker-compose.yml` 파일을 실행하기 위해 필요한 사전 준비 과정은 다음과 같습니다.
먼저, Docker를 설치해야 합니다.
* 기존 버전 제거 (있을 경우)
sudo dnf remove docker docker-common docker-selinux docker-engine
[root@opensearch ~]# sudo dnf remove docker docker-common docker-selinux docker-engine
No match for argument: docker
No match for argument: docker-common
No match for argument: docker-engine
Dependencies resolved.
==========================================================================================================
Package Architecture Version Repository Size
==========================================================================================================
Removing:
container-selinux noarch 4:2.235.0-2.el9_6 @AppStream 72 k
Removing dependent packages:
flatpak-selinux noarch 1.12.9-4.el9_6 @AppStream 13 k
passt-selinux noarch 0^20250217.ga1e48a0-1.el9 @AppStream 289 k
selinux-policy noarch 38.1.53-5.el9_6 @anaconda 25 k
selinux-policy-targeted noarch 38.1.53-5.el9_6 @anaconda 18 M
Removing unused dependencies:
rpm-plugin-selinux x86_64 4.16.1.3-37.el9 @anaconda 16 k
Transaction Summary
==========================================================================================================
Remove 6 Packages
Freed space: 19 M
Is this ok [y/N]: y
Running transaction check
]Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Erasing : container-selinux-4:2.235.0-2.el9_6.noarch 1/6
Running scriptlet: container-selinux-4:2.235.0-2.el9_6.noarch 1/6
Erasing : flatpak-selinux-1.12.9-4.el9_6.noarch 2/6
Running scriptlet: flatpak-selinux-1.12.9-4.el9_6.noarch 2/6
Erasing : passt-selinux-0^20250217.ga1e48a0-1.el9.noarch 3/6
Running scriptlet: passt-selinux-0^20250217.ga1e48a0-1.el9.noarch 3/6
Erasing : rpm-plugin-selinux-4.16.1.3-37.el9.x86_64 4/6
Running scriptlet: selinux-policy-38.1.53-5.el9_6.noarch 5/6
Erasing : selinux-policy-38.1.53-5.el9_6.noarch 5/6
Running scriptlet: selinux-policy-38.1.53-5.el9_6.noarch 5/6
Erasing : selinux-policy-targeted-38.1.53-5.el9_6.noarch 6/6
Running scriptlet: selinux-policy-targeted-38.1.53-5.el9_6.noarch 6/6
Verifying : container-selinux-4:2.235.0-2.el9_6.noarch 1/6
Verifying : flatpak-selinux-1.12.9-4.el9_6.noarch 2/6
Verifying : passt-selinux-0^20250217.ga1e48a0-1.el9.noarch 3/6
Verifying : rpm-plugin-selinux-4.16.1.3-37.el9.x86_64 4/6
Verifying : selinux-policy-38.1.53-5.el9_6.noarch 5/6
Verifying : selinux-policy-targeted-38.1.53-5.el9_6.noarch 6/6
Removed:
container-selinux-4:2.235.0-2.el9_6.noarch flatpak-selinux-1.12.9-4.el9_6.noarch
passt-selinux-0^20250217.ga1e48a0-1.el9.noarch rpm-plugin-selinux-4.16.1.3-37.el9.x86_64
selinux-policy-38.1.53-5.el9_6.noarch selinux-policy-targeted-38.1.53-5.el9_6.noarch
Complete!
[root@opensearch ~]#
* Docker 설치를 위한 리포지토리 설정
sudo dnf install -y yum-utils
sudo yum-config-manager --add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
[root@opensearch ~]# sudo dnf install -y yum-utils
Rocky Linux 9 - BaseOS 2.5 MB/s | 2.5 MB 00:00
Rocky Linux 9 - AppStream 8.6 MB/s | 9.5 MB 00:01
Rocky Linux 9 - Extras 21 kB/s | 17 kB 00:00
Dependencies resolved.
==========================================================================================================
Package Architecture Version Repository Size
==========================================================================================================
Installing:
yum-utils noarch 4.3.0-20.el9 baseos 35 k
Transaction Summary
==========================================================================================================
Install 1 Package
Total download size: 35 k
Installed size: 23 k
Downloading Packages:
yum-utils-4.3.0-20.el9.noarch.rpm 347 kB/s | 35 kB 00:00
----------------------------------------------------------------------------------------------------------
Total 54 kB/s | 35 kB 00:00
Rocky Linux 9 - BaseOS 1.7 MB/s | 1.7 kB 00:00
Importing GPG key 0x350D275D:
Userid : "Rocky Enterprise Software Foundation - Release key 2022 <releng@rockylinux.org>"
Fingerprint: 21CB 256A E16F C54C 6E65 2949 702D 426D 350D 275D
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : yum-utils-4.3.0-20.el9.noarch 1/1
Running scriptlet: yum-utils-4.3.0-20.el9.noarch 1/1
Verifying : yum-utils-4.3.0-20.el9.noarch 1/1
Installed:
yum-utils-4.3.0-20.el9.noarch
Complete!
[root@opensearch ~]# sudo yum-config-manager --add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
Adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
[root@opensearch ~]#
* Docker 설치
sudo dnf install -y docker-ce docker-ce-cli containerd.io
[root@opensearch ~]# sudo dnf install -y docker-ce docker-ce-cli containerd.io
Docker CE Stable - x86_64 322 kB/s | 54 kB 00:00
Dependencies resolved.
==========================================================================================================
Package Architecture Version Repository Size
==========================================================================================================
Installing:
containerd.io x86_64 1.7.27-3.1.el9 docker-ce-stable 44 M
docker-ce x86_64 3:28.4.0-1.el9 docker-ce-stable 21 M
docker-ce-cli x86_64 1:28.4.0-1.el9 docker-ce-stable 8.6 M
Installing dependencies:
container-selinux noarch 4:2.237.0-1.el9_6 appstream 58 k
mcstrans x86_64 3.6-1.el9 baseos 141 k
policycoreutils-newrole x86_64 3.6-2.1.el9 baseos 25 k
rpm-plugin-selinux x86_64 4.16.1.3-37.el9 baseos 16 k
selinux-policy noarch 38.1.53-5.el9_6 baseos 44 k
selinux-policy-mls noarch 38.1.53-5.el9_6 baseos 4.2 M
Installing weak dependencies:
docker-buildx-plugin x86_64 0.27.0-1.el9 docker-ce-stable 17 M
docker-ce-rootless-extras x86_64 28.4.0-1.el9 docker-ce-stable 3.4 M
docker-compose-plugin x86_64 2.39.2-1.el9 docker-ce-stable 15 M
Transaction Summary
==========================================================================================================
Install 12 Packages
Total download size: 113 M
Installed size: 446 M
Downloading Packages:
…
Installed:
container-selinux-4:2.237.0-1.el9_6.noarch containerd.io-1.7.27-3.1.el9.x86_64
docker-buildx-plugin-0.27.0-1.el9.x86_64 docker-ce-3:28.4.0-1.el9.x86_64
docker-ce-cli-1:28.4.0-1.el9.x86_64 docker-ce-rootless-extras-28.4.0-1.el9.x86_64
docker-compose-plugin-2.39.2-1.el9.x86_64 mcstrans-3.6-1.el9.x86_64
policycoreutils-newrole-3.6-2.1.el9.x86_64 rpm-plugin-selinux-4.16.1.3-37.el9.x86_64
selinux-policy-38.1.53-5.el9_6.noarch selinux-policy-mls-38.1.53-5.el9_6.noarch
Complete!
[root@opensearch ~]#
* Docker 서비스 시작 및 부팅 시 자동 시작 설정
sudo systemctl start docker
sudo systemctl enable docker
docker version
[root@opensearch ~]# sudo systemctl start docker
[root@opensearch ~]# sudo systemctl enable docker
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /usr/lib/systemd/system/docker.service.
[root@opensearch ~]# docker version
Client: Docker Engine - Community
Version: 28.4.0
API version: 1.51
Go version: go1.24.7
Git commit: d8eb465
Built: Wed Sep 3 21:00:35 2025
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 28.4.0
API version: 1.51 (minimum version 1.24)
Go version: go1.24.7
Git commit: 249d679
Built: Wed Sep 3 20:57:19 2025
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.7.27
GitCommit: 05044ec0a9a75232cad458027ca83437aae3f4da
runc:
Version: 1.2.5
GitCommit: v1.2.5-0-g59923ef
docker-init:
Version: 0.19.0
GitCommit: de40ad0
[root@opensearch ~]#
* 현재 사용자를 Docker 그룹에 추가 (선택 사항, 필요한 경우 sudo 없이 Docker를 사용 가능하게 함)
sudo usermod -aG docker $USER
sudo usermod -aG docker lds
[root@opensearch ~]# sudo usermod -aG docker lds
[root@opensearch ~]#
이후, 시스템에 다시 로그인하거나 `newgrp docker` 명령어를 사용하여 그룹 변경을 적용합니다.
1.2. Docker Compose 설치
Docker Compose는 Docker Compose 파일을 사용하여 다중 컨테이너 Docker 애플리케이션을 정의하고 실행할 수 있게 합니다.
* Docker Engine 기반한 docker-compose version 확인
* https://github.com/docker/compose/releases
* https://github.com/docker/compose/releases/tag/v2.39.2
* Dependencies
* Build(deps): bump github.com/docker/cli from 28.3.2+incompatible to 28.3.3+incompatible by @dependabot[bot] in #13116
* Build(deps): bump github.com/docker/docker from 28.3.2+incompatible to 28.3.3+incompatible by @dependabot[bot] in #13115
* Docker Compose 바이너리 다운로드
sudo curl -L "https://github.com/docker/compose/releases/download/v2.39.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
[root@opensearch ~]# sudo curl -L "https://github.com/docker/compose/releases/download/v2.39.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 72.1M 100 72.1M 0 0 39.1M 0 0:00:01 0:00:01 --:--:-- 53.2M
[root@opensearch ~]#
* 바이너리에 실행 권한 추가
sudo chmod +x /usr/local/bin/docker-compose
[root@opensearch ~]# sudo chmod +x /usr/local/bin/docker-compose
[root@opensearch ~]#
* 버전 확인
docker-compose --version
[root@opensearch ~]# docker-compose --version
Docker Compose version v2.39.2
[root@opensearch ~]#
________________
댓글목록 0
등록된 댓글이 없습니다.
