RDBMS/CUBRID & PostgreSQL
CUBRID Linux 버전 설치
- -
728x90
반응형
국내 오픈소스 RDBMS CUBRID Linux 버전을 설치 해보겠습니다.
CUBRID 공식 홈페이지
CUBRID | Enterprise Open Source DBMS
제품 다운로드 CUBRID는 관계형 DBMS로서 엔터프라이즈 시장에서 요구하는 대용량 데이터 처리 능력 및 성능, 안정성, 가용성, 관리 편의성을 제공하고 있습니다. 더 보기
www.cubrid.com
CUBRID 설치 파일 준비
- CUBRID FTP에서 설치 파일을 다운 받아야 합니다.
- 본 문에서는 sh 타입으로 설치해보도록 하겠습니다.
Index of /
CUBRID_VM/CentOS8 based vm image. include latest CUBRID
ftp.cubrid.org
- FTP에서 엔진 파일의 링크 주소 복사를 합니다.
- CUBRID 엔진 경로를 위해 디렉토리 생성 및 엔진 다운로드
[cubrid@689cae454053 ~]$ wget --no-check-certificate https://ftp.cubrid.org/CUBRID_Engine/11.2_latest/CUBRID-11.2-latest-Linux.x86_64.sh
... 생략 ...
Saving to: 'CUBRID-11.2-latest-Linux.x86_64.sh'
100%[====================================================================================================>] 139,463,911 3.39MB/s in 39s
2022-09-24 15:19:55 (3.37 MB/s) - 'CUBRID-11.2-latest-Linux.x86_64.sh' saved [139463911/139463911]
[cubrid@689cae454053 cubrid_engine]$ ls -lrth
total 134M
-rw-r--r-- 1 cubrid dba 134M Aug 1 02:01 CUBRID-11.2-latest-Linux.x86_64.sh
CUBRID 설치
- 유저 생성 및 그룹 생성
[root@689cae454053 ~]# groupadd dba
[root@689cae454053 ~]# useradd -d /cubrid -g dba cubrid
[root@689cae454053 ~]# su - cubrid
[cubrid@689cae454053 ~]$ pwd
/cubrid
- 엔진 다운로드 (위에서 다운 받은 엔진 파일 이동)
[cubrid@689cae454053 ~]$ mkdir cubrid_engine
[cubrid@689cae454053 ~]$ cd cubrid_engine
[cubrid@689cae454053 cubrid_engine]$ ls -lrt
total 136196
-rw-r--r-- 1 cubrid dba 139463911 Aug 1 02:01 CUBRID-11.2-latest-Linux.x86_64.sh
- sh 타입으로 설치를 진행 합니다. (기본 y로 설치)
[cubrid@689cae454053 cubrid_engine]$ sh CUBRID-11.2-latest-Linux.x86_64.sh
CUBRID Installer Version: 11.2.1.0677-82f461a, Copyright (c) CUBRID Corporation
This is a self-extracting archive.
The archive will be extracted to: /cubrid/cubrid_engine
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 mate
rials 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 specif
ic 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, INCID
ENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSIN
ESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY O
UT 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
Do you accept the license? [yN]:
y
By default the CUBRID will be installed in:
"/cubrid/cubrid_engine/CUBRID-11.2.1.0677-82f461a-Linux.x86_64"
Do you want to include the subdirectory CUBRID-11.2.1.0677-82f461a-Linux.x86_64?
Saying no will install in: "/cubrid/cubrid_engine" [Yn]:
y
Using target directory: /cubrid/cubrid_engine/CUBRID-11.2.1.0677-82f461a-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
Extracting, please wait...
Unpacking finished successfully
demodb has been successfully created.
If you want to use CUBRID, run the following command to set required environment variables.
$ . /cubrid/.cubrid.sh
- CUBRID 설치 확인
[cubrid@689cae454053 cubrid_engine]$ ls
CUBRID-11.2-latest-Linux.x86_64.sh CUBRID-11.2.1.0677-82f461a-Linux.x86_64
[cubrid@689cae454053 cubrid_engine]$ . ~/.cubrid.sh
[cubrid@689cae454053 cubrid_engine]$ cubrid_rel
CUBRID 11.2 (11.2.1.0677-82f461a) (64bit release build for Linux) (Jul 26 2022 18:30:33)
- CUBRID 엔진 구조
[cubrid@689cae454053 cubrid_engine]$ tree CUBRID-11.2.1.0677-82f461a-Linux.x86_64/ -d
CUBRID-11.2.1.0677-82f461a-Linux.x86_64/
|-- bin
|-- cci
| |-- include
| `-- lib
|-- compat
|-- conf
|-- databases
| `-- demodb
| `-- lob
|-- demo
|-- include
|-- java
| `-- lib
|-- jdbc
|-- lib
|-- locales
| |-- data
| | |-- codepages
| | `-- ldml
| `-- loclib
|-- log
| |-- manager
| `-- server
|-- msg
| |-- de_DE.utf8
| |-- en_US
| |-- en_US.utf8
| |-- es_ES.utf8
| |-- fr_FR.utf8
| |-- it_IT.utf8
| |-- ja_JP.utf8
| |-- km_KH.utf8
| |-- ko_KR.euckr
| |-- ko_KR.utf8
| |-- ro_RO.utf8
| |-- tr_TR.utf8
| |-- vi_VN.utf8
| `-- zh_CN.utf8
|-- share
| |-- init.d
| |-- scripts
| | `-- ha
| | |-- common
| | |-- expect
| | `-- functions
| `-- systemtap
| `-- tapset
| `-- scripts
|-- timezones
| |-- tzdata
| `-- tzlib
|-- tmp
`-- var
|-- CUBRID_SOCK
|-- javasp
`-- manager
`-- mon_data
- CUBRID 환경 변수
[cubrid@689cae454053 cubrid_engine]$ cat $HOME/.cubrid.sh
#
#
# Copyright 2016 CUBRID Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
export CUBRID=/cubrid/cubrid_engine/CUBRID-11.2.1.0677-82f461a-Linux.x86_64
export CUBRID_DATABASES=$CUBRID/databases
LD_LIBRARY_PATH=$CUBRID/lib:$CUBRID/cci/lib:$LD_LIBRARY_PATH
SHLIB_PATH=$LD_LIBRARY_PATH
LIBPATH=$LD_LIBRARY_PATH
PATH=$CUBRID/bin:$PATH
export LD_LIBRARY_PATH SHLIB_PATH LIBPATH PATH
LIB=$CUBRID/lib
if [ -f /etc/redhat-release ];then
OS=$(cat /etc/system-release-cpe | cut -d':' -f'3-3')
elif [ -f /etc/os-release ];then
OS=$(cat /etc/os-release | egrep "^ID=" | cut -d'=' -f2-2)
fi
case $OS in
fedoraproject | centos | redhat | rocky)
if [ ! -h /lib64/libncurses.so.5 ] && [ ! -h $LIB/libncurses.so.5 ];then
ln -s /lib64/libncurses.so.6 $LIB/libncurses.so.5
ln -s /lib64/libform.so.6 $LIB/libform.so.5
ln -s /lib64/libtinfo.so.6 $LIB/libtinfo.so.5
fi
;;
ubuntu)
if [ ! -h /lib/x86_64-linux-gnu/libncurses.so.5 ] && [ ! -h $LIB/libncurses.so.5 ];then
ln -s /lib/x86_64-linux-gnu/libncurses.so.6 $LIB/libncurses.so.5
ln -s /lib/x86_64-linux-gnu/libform.so.6 $LIB/libform.so.5
ln -s /lib/x86_64-linux-gnu/libtinfo.so.6 $LIB/libtinfo.so.5
fi
;;
debian)
if [ ! -h /lib/x86_64-linux-gnu/libncurses.so.5 ] && [ ! -h $LIB/libncurses.so.5 ];then
ln -s /lib/x86_64-linux-gnu/libncurses.so.6 $LIB/libncurses.so.5
ln -s /lib/x86_64-linux-gnu/libtinfo.so.6 $LIB/libtinfo.so.5
ln -s /usr/lib/x86_64-linux-gnu/libform.so.6 $LIB/libform.so.5
fi
;;
*)
echo "CUBRID requires the ncurses package. Make sure the ncurses package is installed"
;;
esac
CUBRID 서비스 기동
- cubrid service 기동
[cubrid@689cae454053 cubrid_engine]# cubrid service start
@ cubrid master start
++ cubrid master start: success
@ cubrid broker start
++ cubrid broker start: success
@ cubrid manager server start
++ cubrid manager server start: success
[cubrid@689cae454053 cubrid_engine]# cubrid service status
@ cubrid master status
++ cubrid master is running.
@ cubrid server status
@ cubrid javasp status
@ cubrid broker status
NAME PID PORT AS JQ TPS QPS SELECT INSERT UPDATE DELETE OTHERS LONG-T LONG-Q ERR-Q UNIQUE-ERR-Q #CONNECT #REJECT
===========================================================================================================================================================================================================
* query_editor 851 30000 5 0 0 0 0 0 0 0 0 0/60.0 0/60.0 0 0 0 0
* broker1 862 33000 5 0 0 0 0 0 0 0 0 0/60.0 0/60.0 0 0 0 0
@ cubrid gateway status
++ cubrid gateway is not running.
@ cubrid manager server status
++ cubrid manager server is running.
CUBRID 데이터 베이스 생성
- 데이터베이스 경로 설정을 위해 디렉토리 생성
[cubrid@689cae454053 cubrid_engine]# mkdir cubdata
[cubrid@689cae454053 cubrid_engine]# cd cubdata/
[cubrid@689cae454053 cubdata]# pwd
/cubrid/cubrid_engine/cubdata
- 데이터베이스 생성
[cubrid@689cae454053 cubdata]# cubrid createdb cub_testdb ko_KR.utf8
Creating database with 512.0M size using locale ko_KR.utf8. The total amount of disk space needed is 1.5G.
CUBRID 11.2
[cubrid@689cae454053 cubdata]# cubrid server start cub_testdb
@ cubrid server start: cub_testdb
This may take a long time depending on the amount of recovery works to do.
CUBRID 11.2
++ cubrid server start: success
java_stored_procedure system parameter is not enabled
Calling java stored procedure is not allowed
- cubrid createdb help
[cubrid@689cae454053 cubdata]# cubrid createdb
createdb: Create a database.
usage: cubrid createdb [OPTION] database-name database-locale
database-locale format is <language>.<charset>; examples : en_US.iso88591, ko_KR.utf8
valid options:
--db-volume-size=SIZE size of first information volume
default: db_volume_size in cubrid.conf
--db-page-size=SIZE database page SIZE in bytes; default: 16K
--log-volume-size=SIZE size of log archives
default: log_volume_size in cubrid.conf
--log-page-size=SIZE log page SIZE in bytes; default: database page size
--comment=COMMENT COMMENT for a database; default: none
-F, --file-path=PATH directory PATH for database volumes; default: current directory
-L, --log-path=PATH directory PATH for log volumes; default: same as file-path
-B, --lob-base-path=PATH base directory PATH for external LOB data; default: <file-path>/lob
--server-name=HOST server's HOST name; default: current host name
-r, --replace replace an existing database; default: don't replace
--more-volume-file=FILE FILE contain specifications for creation of additional volumes; default: none
--user-definition-file=FILE FILE contain user definitions; default: none
--csql-initialization-file=FILE FILE contain SQLs for an initialization of the database; default: none
-o, --output-file=FILE redirect output messages to FILE; default: none
-v, --verbose enable verbose status messages; default: disabled
CUBRID 접속 테스트
[cubrid@689cae454053 ~]$ csql -u dba testdb
CUBRID SQL Interpreter
Type `;help' for help messages.
csql> create table test_tbl(x int);
Execute OK. (0.013598 sec) Committed. (0.002822 sec)
1 command(s) successfully processed.
csql> desc test_tbl;
=== <Result of SELECT Command in Line 1> ===
Field Type Null Key Default Extra
====================================================================================================================================
'x' 'INTEGER' 'YES' '' NULL ''
1 row selected. (0.010797 sec) Committed. (0.000019 sec)
1 command(s) successfully processed.
csql>
CUBRID 11.2 사용자 매뉴얼 — CUBRID 11.2.0 documentation
CUBRID 11.2 사용자 매뉴얼 — CUBRID 11.2.0 documentation. Quick Reference Table and Table of Contents.
www.cubrid.org
728x90
반응형
'RDBMS > CUBRID & PostgreSQL' 카테고리의 다른 글
CUBRID 테이블 스페이스(볼륨) 사용량 확인하기 (0) | 2022.11.12 |
---|---|
CUBRID 파라미터 확인 (0) | 2022.11.05 |
docker container for PostgreSQL (PostgreSQL 설치) (0) | 2022.10.21 |
CUBRID 버전 확인 (0) | 2022.10.10 |
PostgreSQL 버전 확인 (0) | 2022.10.10 |
소중한 공감 감사합니다