Linux에서의 설치와 실행

설치 시 확인 사항

Linux 버전의 CUBRID 데이터베이스를 설치하기 전에 다음 사항을 점검한다.

구분

내용

운영체제 버전

운영체제 버전에 상관 없이 glibc 2.3.4 버전 이상만 지원한다. glibc 버전은 다음과 같은 방법으로 확인한다.
%rpm -q glibc

64비트 여부

CUBRID 2008 R2.0 버전부터 32비트 버전과 64비트 버전을 각각 지원한다. Linux버전은 다음과 같은 방법으로 확인한다.
% uname -a
Linux host_name 2.6.18-53.1.14.el5xen #1 SMP Wed Mar 5 12:08:17 EST 2008 x86_64 x86_64 x86_64 GNU/Linux
32비트 Linux에서는 CUBRID 32비트 버전을, 64비트 Linux에서는 CUBRID 64비트 버전을 설치한다. 설치할 추가 라이브러리는 다음과 같다.
Curses Library (rpm -q ncurses)
gcrypt Library (rpm -q libgcrypt)
stdc++ Library (rpm -q libstdc++)

CUBRID 설치

설치 프로그램은 바이너리 셸로 되어 있어 자동으로 설치할 수 있다. 설치를 진행하려면 다운로드한 설치 파일을 바이너리 모드로 Linux 서버의 FTP로 전송한다.

다음은 리눅스에서 "CUBRID-8.3.0.0312-linux.x86_64.sh" 파일을 이용하여 CUBRID를 설치하는 예제이다.

[cub_user@cubrid ~]$ sh CUBRID-8.3.0.0312-linux.x86_64.sh
Do you agree to the above license terms? (yes or no) : yes
Do you want to install this software(CUBRID) to the default(/home1/cub_user/CUBRID) directory? (yes or no) [Default: yes] : yes
Install CUBRID to '/home1/cub_user/CUBRID' ...
In case a different version of the CUBRID product is being used in other machines, please note that the CUBRID 2008 R3.0 servers are only compatible with the CUBRID 2008 R3.0 clients and vice versa.
Do you want to continue? (yes or no) [Default: yes] : yes
Copying old .cubrid.sh to .cubrid.sh.bak ...
 
CUBRID has been successfully installed.
 
demodb has been successfully created.
 
If you want to use CUBRID, run the following commands
  % . /home1/cub_user/.cubrid.sh
  % cubrid service start

위의 예제와 같이 다운로드한 파일(CUBRID-8.3.0.0312-linux.x86_64.sh)을 설치한 후, CUBRID 데이터베이스를 사용하기 위해서는 CUBRID 관련 환경 정보를 설정해야 한다. 이 설정은 해당 터미널에 로그인할 때 자동 설정되도록 지정되어 있으므로 설치 후 최초 한 번만 수행하면 된다. 

[cub_user@cubrid ~]$ . /home1/cub_user/.cubrid.sh

CUBRID가 설치 완료되면 CUBRID 매니저 서버와 브로커를 다음과 같이 구동시킬 수 있다.

[cub_user@cubrid ~]$ cubrid service start

cubrid service를 구동시킨 후 정상적으로 구동되었는지 확인하려면 다음과 같이 grep으로 cub_* 프로세스들이 구동되어 있는지를 확인한다.

[cub_user@cubrid ~]$ ps -ef | grep cub_
cub_user 15200 1 0 18:57 ? 00:00:00 cub_master
cub_user 15205 1 0 18:57 pts/17 00:00:00 cub_broker
cub_user 15210 1 0 18:57 pts/17 00:00:00 query_editor_cub_cas_1
cub_user 15211 1 0 18:57 pts/17 00:00:00 query_editor_cub_cas_2
cub_user 15212 1 0 18:57 pts/17 00:00:00 query_editor_cub_cas_3
cub_user 15213 1 0 18:57 pts/17 00:00:00 query_editor_cub_cas_4
cub_user 15214 1 0 18:57 pts/17 00:00:00 query_editor_cub_cas_5
cub_user 15217 1 0 18:57 pts/17 00:00:00 cub_broker
cub_user 15222 1 0 18:57 pts/17 00:00:00 broker1_cub_cas_1
cub_user 15223 1 0 18:57 pts/17 00:00:00 broker1_cub_cas_2
cub_user 15224 1 0 18:57 pts/17 00:00:00 broker1_cub_cas_3
cub_user 15225 1 0 18:57 pts/17 00:00:00 broker1_cub_cas_4
cub_user 15226 1 0 18:57 pts/17 00:00:00 broker1_cub_cas_5
cub_user 15229 1 0 18:57 ? 00:00:00 cub_auto start
cub_user 15232 1 0 18:57 ? 00:00:00 cub_js start

CUBRID 업그레이드

다른 버전의 CUBRID가 설치된 디렉터리를 CUBRID를 설치할 디렉터리로 지정하면, 해당 디렉터리가 존재하는 것을 알리고 덮어쓸 것인지 확인한다. no를 입력하면 설치가 중단된다.

Directory '/home1/cub_user/CUBRID' exist!
If a CUBRID service is running on this directory, it may be terminated abnormally.
And if you don't have right access permission on this directory(subdirectories or files), install operation will be failed.
Overwrite anyway? (yes or no) [Default: no] : yes

CUBRID를 설치하고 설정 파일을 구성할 때 기존의 설정 파일을 그대로 사용할 것인지, 새 설정 파일을 사용할 것인지 확인한다. yes를 입력하면 기존의 설정 파일을 확장자가 .bak인 백업 파일로 보관한다.

The configuration file (.conf or .pass) already exists. Do you want to overwrite it? (yes or no) : yes

환경 설정

서비스 포트 등 사용자 환경에 맞춰 설정을 변경하려면 $CUBRID/conf 디렉터리에서 설정 파일의 파라미터를 수정한다. 자세한 사항은 환경 설정을 참고한다.

참고 - RPM으로 설치할 때에는 의존성을 꼭 확인해야 한다. 의존성을 무시(--nodeps)하고 설치하면 실행되지 않을 수 있다.