본문 바로가기
IT

우분투 리눅스에 오픈소스 RDBMS인 CUBRID 설치하기 - ubuntu linux open source rdbms install

by developer's warehouse 2024. 3. 11.

cubrid는 국내에서 서비스 중인 오픈소스 RDBMS입니다. 오픈소스로 공개된 후 오랫동안 서비스되고 있어서 테스트를 해 보고 싶어 졌습니다. 오늘은 우분투 리눅스에 cubrid dbms를 설치하는 법 알아보겠습니다.

우분투 리눅스에 CUBRID DBMS 설치하기 썸네일

CUBRID 소개

 

CUBRID는 오픈 소스 관계형 데이터베이스 관리 시스템(DBMS)입니다. CUBRID는 엔터프라이즈 시장에서 요구하는 대용량 데이터 처리 능력 및 성능, 안정성, 가용성, 관리 편의성을 제공하고 있습니다.

CUBRID의 다음과 같은 특징을 가지고 있습니다.

- 고성능: CUBRID는 OLTP에 최적화되어 있으며, 다른 데이터베이스 시스템보다 뛰어난 읽기 및 쓰기 성능을 제공한다고 합니다.
- 고가용성: CUBRID는 매우 정확하고 예측 가능한 자동 장애 복구 기술을 내장하고 있다고합니다.
- 확장성: CUBRID는 다중 볼륨 지원, 자동 볼륨 확장, 그리고 데이터베이스/테이블/인덱스의 수와 크기에 대한 제한이 없습니다.
- 국제화: CUBRID는 다양한 국제화(I18N) 및 지역화(L10N) 기능을 제공하며, IANA 시간대와 UCA 정렬을 지원합니다.

CUBRID는 DBMS 엔진 부분에 아파치 라이선스 2.0을, 인터페이스 부분에 BSD 라이선스를 채택하고 있습니다. 이로 인해 사용자는 CUBRID를 자유롭게 사용하고, 수정하고, 배포할 수 있습니다.

CUBRID는 2008년에 오픈소스 DBMS로 전환되었으며, 최신 안정화 버전은 CUBRID 11.0입니다. CUBRID는 국내외에서 많은 인기를 얻고 있으며, 다양한 시스템에서 사용되고 있습니다.

 

CUBRID 패키지 다운로드 하기

cubrid DBMS는 아래 링크에서 다운로드 할 수 있습니다.

https://www.cubrid.com/downloads

제가 테스트하는 2024년 3월을 기준으로 11.3 버전이 가장 최신 릴리즈 버전으로 되어있습니다.

저는 우분투 리눅스에서 테스트 할 계획이므로 Linux 64Bit 버전의 Download 버튼을 눌러서 다운로드를 합니다. 다운로드하여보니 용량은 약 160MB 정도 됩니다.

 

cubrid 계정 생성

root 계정으로 로그인해서 cubrid 계정을 생성합니다. 저는 이렇게 RDBMS 별로 따로 설치하는 것을 선호합니다. 그래야 관리도 잘 됩니다.

cubrid라는 계정을 만들고 비밀번호는 편한 암호로 설정합니다. 이때, root로 비밀번호를 설정하게되면 8 문자보다 짧은 문자도 설정가능합니다.

마지막으로 su (switch user) 명령을 통해서 계정을 cubrid로 전환하고 이 계정으로 설치를 진행합니다.

root:~# useradd -d /home/cubrid cubrid
root:~# passwd cubrid
새 암호:
잘못된 비밀번호: 암호는 8 개의 문자 보다 짧습니다
새 암호 다시 입력:
passwd: 암호를 성공적으로 업데이트했습니다

root:~# mkdir /home/cubrid
root:~# chown cubrid:cubrid /home/cubrid/
root:~# su - cubrid
$

 

sudo 권한 부여하기

cubrid 계정을 생성 후 cubrid 계정에 sudo 권한을 부여합니다. 중간에 설치과정에서 필요한 패키지들을 설치하기 위해서는 이 과정을 해주는 것이 좋습니다.

root 계정으로 로그인후 visudo 명령을 수행하고 해당 편집기 파일에서 아래 내용을 추가해 줍니다.

cubrid ALL=(ALL:ALL) ALL

cubrid 설치

cubrid 설치 파일 업로드

다운로드한 cubrid 설치 파일을 업로드합니다. 계정을 생성 후 해당 계정에서 직접 다운로드했다면 파일 업로드 과정은 skip 하셔도 무방합니다.

 

cubrid 설치 매뉴얼

cubrid 11.3 버전에 대한 설치 매뉴얼은 아래 링크에서 확인하실 수 있습니다.

설치와 실행 — CUBRID 11.3.0 documentation

 

cubrid 설치 전 확인사항

cubrid를 설치하기 전에 확인해야하는 사항으로 glibc 버전, OS cpu bit, 기타 라이브러리 설치여부, 그리고 hosts 명을 확인하라고 합니다.

그런데 매뉴얼에는 rpm을 기반으로만 작성되어있어서, 우분투에서 확인하기 위해서는 다른 명령을 사용하는 것이 좋습니다.

각각에 대해서 알아보겠습니다.

먼저 내 glibc 라이브러리가 몇 버전인지 확인해야합니다.

glibc 버전 확인

우분투에서는 rpm -q glibc 명령어 대신에 dpkg -l libc6 명령어를 사용하실 수 있습니다. 이 명령어는 glibc 패키지인 libc6의 버전 정보를 출력합니다.

~$ dpkg -l libc6
||/ 이름           버전            Architecture 설명
+++-==============-===============-============-=================================
ii  libc6:amd64    2.35-0ubuntu3.6 amd64        GNU C Library: Shared libraries
ii  libc6:i386     2.35-0ubuntu3.6 i386         GNU C Library: Shared libraries


위 명령어를 실행하면, libc6 패키지의 상세 정보가 출력됩니다. 저의 경우 2.35 버전이므로 cubrid 설치 요구사항인 2.3.4 이상을 넘었습니다. 사실 요즘 웬만한 glibc는 2.3.4는 훨씬 위의 버전입니다.

 

64비트인지 확인

64비트인지 확인하기 위한 uname -a 명령은 대부분의 리눅스에서 지원되므로 매뉴얼대로 수행하고 결과를 확인할 수 있습니다. 저의 경우에도 x86_64라고 나온 것을 확인할 수 있습니다.

 uname -a
Linux 6.5.0-14-generic #14~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Nov 20 18:15:30 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

 

추가로 필요한 라이브러리 확인

추가 라이브러리들에 대한 정보도 큐브리드 매뉴얼에는 rpm으로 나와있습니다. 우분투 등 데비안 계열에서는 dpkg를 이용하여 rpm 대신에 사용할 수 있습니다.

 

ncurses 5

제 우분투의 경우 dpkg -l libncurses 또는 dpkg -l libncurses5로 확인해 볼 수 있습니다. 큐브리드는 ncurses5를 사용한다고 하므로 dpkg를 통해 확인해 봅니다.

~$ dpkg -l libncurses5
희망상태=알수없음(U)/설치(I)/지우기(R)/깨끗이(P)/고정(H)
| 상태=아님(N)/설치(I)/설정(C)/풀림(U)/절반설정(F)/일부설치(H)/트리거대기(W)/
| /    트리거밀림(T)
|/ 오류?=(없음)/다시설치필요(R) (상태, 오류가 대문자=불량)
||/ 이름           버전         Architecture 설명
+++-==============-============-============-=================================
un  libncurses5    <none>       <none>       (설명 없음)

 

위와 같이 설치되지 않은 것으로 나옵니다. un이 알 수 없고 상태가 설치되지 않은 것으로 나옵니다.

이제 다음 명령을 통해 설치해 줍니다.

 

~$ sudo apt-get install libncurses5
[sudo] cubrid 암호:
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다... 완료
상태 정보를 읽는 중입니다... 완료
다음의 추가 패키지가 설치될 것입니다 :
  libtinfo5
다음 새 패키지를 설치할 것입니다:
  libncurses5 libtinfo5
0개 업그레이드, 2개 새로 설치, 0개 제거 및 107개 업그레이드 안 함.
207 k바이트 아카이브를 받아야 합니다.
이 작업 후 883 k바이트의 디스크 공간을 더 사용하게 됩니다.
계속 하시겠습니까? [Y/n] Y
받기:1 http://kr.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 libtinfo5 amd64 6.3-2ubuntu0.1 [100 kB]
받기:2 http://kr.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 libncurses5 amd64 6.3-2ubuntu0.1 [107 kB]
내려받기 207 k바이트, 소요시간 2초 (114 k바이트/초)
Selecting previously unselected package libtinfo5:amd64.
(데이터베이스 읽는중 ...현재 238493개의 파일과 디렉터리가 설치되어 있습니다.)
Preparing to unpack .../libtinfo5_6.3-2ubuntu0.1_amd64.deb ...
Unpacking libtinfo5:amd64 (6.3-2ubuntu0.1) ...
Selecting previously unselected package libncurses5:amd64.
Preparing to unpack .../libncurses5_6.3-2ubuntu0.1_amd64.deb ...
Unpacking libncurses5:amd64 (6.3-2ubuntu0.1) ...
libtinfo5:amd64 (6.3-2ubuntu0.1) 설정하는 중입니다 ...
libncurses5:amd64 (6.3-2ubuntu0.1) 설정하는 중입니다 ...
Processing triggers for libc-bin (2.35-0ubuntu3.6) ...

gcrypt Library (rpm -q libgcrypt) 설치 확인

gcrypt 라이브러리의 경우에도 dpkg 명령으로 확인합니다.

아래의 결과와 같이 우분투에서 libgcrypt는 20 버전입니다. 그리고 제일 앞부분 칼럼에 ii가 설치되었다는 의미입니다.

dpkg -l |grep libgcrypt
ii  libgcrypt20:amd64                          1.9.4-3ubuntu3                          amd64        LGPL Crypto library - runtime library
ii  libgcrypt20:i386                           1.9.4-3ubuntu3                          i386         LGPL Crypto library - runtime library

stdc++ Library (rpm -q libstdc++)

stdc++ 라이브러리는 대부분 설치되어 있을 텐데, 그래도 dpkg 명령으로 한번 더 확인합니다.

 dpkg -l |grep libstdc++
ii  libstdc++-11-dev:amd64                     11.4.0-1ubuntu1~22.04                   amd64        GNU Standard C++ Library v3 (development files)
ii  libstdc++-9-dev:amd64                      9.5.0-1ubuntu1~22.04                    amd64        GNU Standard C++ Library v3 (development files)
ii  libstdc++6:amd64                           12.3.0-1ubuntu1~22.04                   amd64        GNU Standard C++ Library v3
ii  libstdc++6:i386                            12.3.0-1ubuntu1~22.04                   i386         GNU Standard C++ Library v3

 

이제 설치 전에 필요한 사항들은 모두 만족하였으니 설치를 진행하면 됩니다.

 

CUBRID 설치

매뉴얼을 보면 아래와 같이 쉘 파일을 그냥 실행하면 설치되는 것으로 안내가 되어있습니다.

 

바로 실행해 보도록 하겠습니다.

 

라이선스 동의

제일 먼저 쉘 파일을 실행하면 라이선스가 나타나고 동의하겠는지 물어봅니다. 라이선스 내용은 한 번씩 읽어보셔도 좋을 것 같습니다.

저는 y를 눌러서 동의합니다.

~$ sh CUBRID-11.3-latest-Linux.x86_64.sh
CUBRID Installer Version: 11.3.0.1089-bd31bd5, Copyright (c) CUBRID Corporation
This is a self-extracting archive.
The archive will be extracted to: /home/cubrid

If you want to stop extracting, please press <ctrl-C>.
Copyright (C) 2008 Search Solution Corporation.
Copyright (C) 2016 CUBRID Corporation.
CUBRID is registered trademark of CUBRID Corporation.

This Software is released under Apache License 2.0 and BSD according to CUBRID components.
For brevity, CUBRID Server Engine is under Apache License 2.0 and CUBRID APIs and Connectors are under BSD License.
For details, please refer to the CUBRID License Page(http://www.cubrid.org/cubrid).

* CUBRID APIs and Connectors under BSD 3-Clause License(http://opensource.org/licenses/BSD-3-Clause)
--------------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
 - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
 - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution
.
 - Neither the name of Search Solution Coporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR T
ORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------

* CUBRID Server Engine under Apache License 2.0(http://www.apache.org/licenses/LICENSE-2.0)
--------------------------------------------------------------------------------
   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.
      ....
         9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS
--------------------------------------------------------------------------------


Do you accept the license? [yN]:

 

다음으로 설치 디렉터리를 확인하는데, 저는 계정도 새로 만들었으니 그냥 기본 디렉토리에 설치하면 됩니다. 역시 y를 눌러줍니다.

By default the CUBRID will be installed in:
  "/home/cubrid/CUBRID-11.3.0.1089-bd31bd5-Linux.x86_64"
Do you want to include the subdirectory CUBRID-11.3.0.1089-bd31bd5-Linux.x86_64?
Saying no will install in: "/home/cubrid" [Yn]:

 

다음으로 설치 디렉토리 안내와 아래와 같이 주의사항을 안내하고 설치를 계속하겠는지 물어봅니다.

#CUBRID 브로커와 서버 버전이 일치해야 하므로 별도의 머신에서 운영하는 경우 동일한 버전을 실행하고 있는지 확인하시기 바랍니다.
Using target directory: /home/cubrid/CUBRID-11.3.0.1089-bd31bd5-Linux.x86_64

Since CUBRID broker and server versions should match, please make sure that you are running the same version if you operate them in separate machines.
Do you want to continue? [Yn] :
y

위의 내용은 제가 아직 파악은 다 못했지만, cubrid는 브로커와 서버로 나뉘어서 동작하는 것 같습니다.

저는 한 장비에서 동일하게 실행할 것이어서 신경 안 쓰고 y를 눌러줍니다.

 

잠시 후에 설치 성공 메시지와 함께 프롬프트가 떨어집니다.

Extracting, please wait...

Unpacking finished successfully
Notification: /home/cubrid/.bash_profile is created
demodb has been successfully created.

If you want to use CUBRID, run the following command to set required environment variables.
  $ . /home/cubrid/.cubrid.sh

cubrid:~$

 

설치가 완료되면 path를 잡아주기위해서 다음의 명령을 한번 실행해주면 설치와 환경설정이 완료됩니다. 

cubrid:~$ ls -a
.   .bash_history  .cubrid.csh  .lesshst  CUBRID-11.3-latest-Linux.x86_64.sh       database
..  .bash_profile  .cubrid.sh   .viminfo  CUBRID-11.3.0.1089-bd31bd5-Linux.x86_64
cubrid:~$ . .cubrid.sh


이렇게 우분투 리눅스에 오픈소스 RDBMS인 큐브리드를 설치하는 법을 알아보았습니다.

다음 포스팅에서는 간략하게 사용하는 법을 알아보도록 하겠습니다.

facebook twitter kakaoTalk kakaostory naver band shareLink