반응형

5. 설치

GOLILOCKS 소프트웨어는 제공되는 압축 파일을 해제 하는 만으로 기본적인 인스톨이 완료 .

goldilocks-<version>-<os_type>-<cpu_type>.tar.gz 파일의 형태로 소프트웨어가 제공되며, 압축을 해제 하면 다음과 같은 개의 디렉터리가 생성 .

 

GOLDILOCKS_HOME : binary 설치 되는 위치이며, 업데이트 시에 binary overwrite가능 ( license 백업 받아놓아야 )

GOLDILOCKS_DATA : Log File Data File, Control File 등의 데이터 베이스가 사용하는 파일들 존재 위치. Overwrite 불가능.

 


 

Goldilocks DB 설치할 O/S 유저가 sunje이며, 해당 유저의 home 디렉터리가 /home/sunje .

압축 파일은 /home/sunje/product 밑에 upload 압축 해제

 

$ pwd

/home/sunje

$ cd product

$ pwd

/home/sunje/product

$ ls

goldilocks-server-trunk.3.1.0-linux-ppc64le/              goldilocks-server-trunk.3.1.0-linux-ppc64le-22171.tar.gz

goldilocks-server-trunk.3.1.0-linux-ppc64le-21976.tar.gz  goldilocks-server-trunk.3.1.0-linux-ppc64le-22178.tar.gz

 

위와 같이 압축을 해제하면 goldilocks-server-trunk.3.1.0-linux-ppc64le 디렉터리가 생성 .

 

$ cd goldilocks-server-trunk.3.1.0-linux-ppc64le

$  pwd

/home/sunje/product/goldilocks-server-trunk.3.1.0-linux-ppc64le

$ ls

goldilocks_datagoldilocks_home/

 

위와 같이 goldilocks_data, goldilocks_home 디렉터리가 있음을 확인 있음.

 

$ cd goldilocks_home

$ ls

admin/  bin/  include/  lib/  license/  msg/  sample/  script/

 

 

$ pwd

/home/sunje

$ ls -al

total 604

drwx------. 9 sunje sunje   4096 Jun  8 11:06 ./

drwxr-xr-x. 4 root  root      30 May 31 17:04 ../

-rw-------. 1 sunje sunje   4582 Jun  1 17:17 .bash_history

-rw-r--r--. 1 sunje sunje     18 Nov 22  2015 .bash_logout

-rw-r--r--. 1 sunje sunje    193 Nov 22  2015 .bash_profile

-rw-r--r--. 1 sunje sunje   1600 Jun  1 13:12 .bashrc

drwxrwxr-x. 2 sunje sunje   4096 Jun  1 17:15 bin/

drwxrwxr-x. 3 sunje sunje     25 May 31 17:04 .cache/

drwxrwxr-x. 3 sunje sunje     25 May 31 17:04 .config/

drwxrwxr-x. 8 sunje sunje   4096 May 31 17:48 goldilocks_data/

lrwxrwxrwx. 1 sunje sunje     79 May 31 17:11 goldilocks_home -> /home/sunje/product/goldilocks-server-trunk.3.1.0-linux-ppc64le/goldilocks_home/

-rw-rw-r--. 1 sunje sunje     79 Jun  1 13:13 .locator.ini

drwxr-xr-x. 4 sunje sunje     49 Apr 25 10:12 .mozilla/

-rw-rw-r--. 1 sunje sunje    211 Jun  1 13:14 .odbc.ini

-rw-rw-r--. 1 sunje sunje    521 May 31 17:25 .odbc.ini.ex11

drwxrwxr-x. 7 sunje sunje   4096 May 31 17:10 .onmir/

-rw-r--r--. 1 sunje sunje 555000 May 31 17:10 .onmir.tgz

drwxrwxr-x. 3 sunje sunje   4096 Jun  1 16:58 product/

-rw-------. 1 sunje sunje   5571 Jun  1 17:14 .viminfo

 

위에 ls -al 결과를 보면 goldilocks_home 소프트 링크로 걸려 있는 것을 확인 있는데, 이는 mysql이나 이런 DB 처럼 엔진 업그레이드시에

새로 설치 엔진 디렉터리로 소프트 링크만 바꿈으로 쉽게 버전 업을 하기 위한 같음. (문의해볼 필요 있음)

 

$ cat .bashrc

set -o vi

stty erase "^H"

ulimit -n 4096

 

# GOLDILOCKS Env

export GOLDILOCKS_HOME=$HOME/goldilocks_home

export GOLDILOCKS_DATA=$HOME/goldilocks_data

export PATH=$GOLDILOCKS_HOME/bin:$PATH:$HOME/script:.

export LD_LIBRARY_PATH=$GOLDILOCKS_HOME/lib:$LD_LIBRARY_PATH

export CLASSPATH=$GOLDILOCKS_HOME/lib/goldilocks6.jar

 

# GOLDILOCKS Property (Declare prefix with GOLDILOCKS_ or Add properties at $GOLDILOCKS_DATA/conf/goldilocks.properties.conf)

export GOLDILOCKS_LISTEN_PORT=22581                                     # 20101

export GOLDILOCKS_SHARED_MEMORY_STATIC_KEY=${GOLDILOCKS_LISTEN_PORT}00  # 542353

export GOLDILOCKS_LOCAL_CLUSTER_MEMBER='G1N1'

export GOLDILOCKS_LOCAL_CLUSTER_MEMBER_PORT=10101                       # 60101

 

# aliases

alias gs='gsql sys gliese --as sysdba'

alias gsn='gsqlnet sys gliese --as sysdba'

alias gsn2='gsqlnet sys gliese --as sysdba --dsn=$GOLDILOCKS_LOCAL_CLUSTER_MEMBER'

alias gst='gsql test test'

alias gsnt='gsqlnet test test'

alias gsnt2='gsqlnet test test --dsn=$GOLDILOCKS_LOCAL_CLUSTER_MEMBER'

 

alias glp='vi $GOLDILOCKS_DATA/conf/goldilocks.properties.conf'

alias gld='cd $GOLDILOCKS_DATA'

alias glh='cd $GOLDILOCKS_HOME'

alias glb='cd $GOLDILOCKS_HOME/bin'

alias gls='cd $GOLDILOCKS_HOME/sample'

alias glc='cd $GOLDILOCKS_DATA/conf'

alias glt='tail -f $GOLDILOCKS_DATA/trc/system.trc'

 

if [ -f /tmp/.onmir/.profile ]

then

    source /tmp/.onmir/.profile

fi

    

 

 

1. 공유 메모리 설정

공유메모리란 IPC ( Inter Process Communication ) 의 일종으로 복수의 프로그램에서 데이터를 공유하기 위해 사용되는 메모리를 가리키는 용어이다. GOLDILOCKS에서는 gsql, gloader 및 ODBC를 이용한 사용자 프로그램 등과의 CS ( Client – Server ) 를 위해 공유메모리를 이용한다. 또한 운영에 필요한 Tablespace들이 모두 공유메모리에 생성되기 때문에 여타 프로그램에서 권장되는 값 보다 정확한 설정이 필요하다

 


 

 

# shmmax 값은 32G 이며, PAGE_SIZE 4096 byte 가정하였다.

# 8388609 = (34359738368 / 4096) + 1

# 경우 shmall 8388609 이상의 값을 가져야 한다.

 

/etc/sysctl.conf

 

# shared memory

kernel.shmmax = 34359738368

kernel.shmall = 8388608

kernel.shmmni = 4096

 

# semaphore

kernel.sem = 250 32000 100 128

 

# network

net.core.somaxconn = 1024

net.unix.max_dgram_qlen = 256

 

[SHELL]> sysctl -p

[SHELL]> ipcs -l

 

------ Shared Memory Limits --------

max number of segments = 4096

max seg size (kbytes) = 33554432

max total shared memory (kbytes) = 33554432

min seg size (bytes) = 1

 

------ Semaphore Limits --------

max number of arrays = 128

max semaphores per array = 250

max semaphores system wide = 32000

max ops per semop call = 100

semaphore max value = 32767

 

 

2. 세마포어 설정

세마포어 ( shemaphore ) 란 공유메모리 ( shared memory ) 처럼 IPC 의 일종으로 운영체제에서 자원을 사용하는 복수의 프로세스의 행동을 제어하는 기술을 뜻한다.

세마포어는 설정에 따라서 복수의 프로세스가 해당 자원을 동시에 참조 할 수 있으며, 다른 프로세스가 사용 중일 때는 해당 프로세스가 자원의 사용을 끝마칠 때까지 대기 할 수도 있다.

GOLDILOCKS에서도 공유메모리에 대한 접근순서를 제어하기 위해 세마포어가 사용된다.

예를 들어 복수의 GOLDILOCKS 클라이언트 프로그램에서 동일한 데이터 변경을 요청하는 경우 이를 적절하게 제어할 수 있어야 하기 때문이다.

세마포어의 파라미터 값은 GOLDILOCKS 운영 시 발생하는 세마포어 오퍼레이션에 따라 적절한 값을 설정해야 하며, 아래는 리눅스에서의 일반적인 값으로 권장 한다.

 


 

/etc/sysctl.conf

 

# shared memory

kernel.shmmax = 34359738368

kernel.shmall = 8388608

kernel.shmmni = 4096

 

# semaphore

kernel.sem = 250 32000 100 128

 

# network

net.core.somaxconn = 1024

net.unix.max_dgram_qlen = 256

 

[SHELL]> sysctl -p

[SHELL]> ipcs -l

 

------ Shared Memory Limits --------

max number of segments = 4096

max seg size (kbytes) = 33554432

max total shared memory (kbytes) = 33554432

min seg size (bytes) = 1

 

------ Semaphore Limits --------

max number of arrays = 128

max semaphores per array = 250

max semaphores system wide = 32000

max ops per semop call = 100

semaphore max value = 32767

 

 

3. 네트워크 설정

backlog는 TCP socket listen시에 accept가 되길 기다리는 socket들의 queue길이를 의미한다. GOLDILOCKS glsnr의 backlog는 glsnr의 config파일의 BACKLOG로 설정한다.

system에서 backlog의 최대값이 somaxconn 보다 큰 경우 somaxconn로 설정됨으로 somaxconn를 늘려 주어야 한다.

GOLDILOCKS에서 CS의 shared모드로 동작 시 사용되는 UDS(Unix Domain Socket)의 queue 길이는 max_dgram_qlen으로 설정된다.

client들이 동시에 접속할 때 이 값이 작으면 glsnr, gbalancer, gdispatcher 간에 통신에 병목이 발생하게 된다.

 


 

/etc/sysctl.conf

 

# shared memory

kernel.shmmax = 34359738368

kernel.shmall = 8388608

kernel.shmmni = 4096

 

# semaphore

kernel.sem = 250 32000 100 128

 

# network

net.core.somaxconn = 1024

net.unix.max_dgram_qlen = 256

 

[SHELL]> sysctl -p

[SHELL]> ipcs -l

 

------ Shared Memory Limits --------

max number of segments = 4096

max seg size (kbytes) = 33554432

max total shared memory (kbytes) = 33554432

min seg size (bytes) = 1

 

------ Semaphore Limits --------

max number of arrays = 128

max semaphores per array = 250

max semaphores system wide = 32000

max ops per semop call = 100

semaphore max value = 32767

 

 

4. 설치 파일 압축 해제 환경 변수 설정

 

- 압축 해제

 

[SHELL]> gzip d goldilocks-mercury.2.1.0-linux-x86_64.tar.gz

[SHELL]> tar -xvf goldilocks-server-mercury.2.1.0-linux-x86_64.tar

 

압축 해제가 완료되면 <package_file_name>으로 생성된 디렉터리의 이름을 원하는 대로 변경한다.

이에 따라서 $GOLDILOCKS_HOME과 $GOLDILOCKS_DATA 환경변수도 변경시켜야 한다.

 

- 환경 변수 설정

 

export GOLDILOCKS_HOME=/home/GOLDILOCKS/goldilocks-mercury.2.1.0-linux-x86_64/

export GOLDILOCKS_DATA=/home/GOLDILOCKS/data/

export PATH=$GOLDILOCKS_HOME/bin:$PATH

export LD_LIBRARY_PATH=$GOLDILOCKS_HOME/lib:$LD_LIBRARY_PATH

 

- 데이터 베이스 생성

데이터베이스 생성시에는 다음과 같은 사항을 고려하여야 한다.

- Kernel Parameter Shared Memory 설정

Shared Memory 설정 에서 명시 된 사이즈가 $GOLDILOCKS_HOME/conf/goldilocks.properties.conf에서 기술된 사이즈보다 작은 경우 데이터베이스 생성을 할 수 없다.

- Tablespace 사이즈

데이터베이스 생성 시 생성된 Tablespace 파일들은 GOLDILOCKS기동 시 메모리에 Tablespace 사이즈만큼 할당되어 사용되기 때문에 Data Tablespace 에 실제 사용자 데이터가 없더라도 메모리를 사용하게 된다.

따라서 Shared Memory 는 물론 goldilocks.properties.conf 작성시 GOLDILOCKS가 기동되는 머신 에서 가용 메모리를 고려하여 데이터베이스를 생성하여야 한다.

- Cluster System 사용 여부

데이터베이스 생성 시에 해당 데이터베이스가 Cluster System 의 Member 로 참여하여 사용 될 것인지를 명시하여야 한다.

즉, Standalone으로 사용할 시에는 gcreatedb 실행 시 --cluster 옵션을 생략해야 하지만, Cluster System으로 사용될 경우에는 반드시 해당 옵션을 명시해야 한다.

 

데이터베이스 생성은 $GOLDILOCKS_HOME/bin/gcreatedb 명령어를 이용하여 생성할 수 있다

 

[SHELL]> gcreatedb --help

Usage

 

gcreatedb [options]

 

Options:

 

--cluster            cluster system (if not specified, stand-alone system)

--db_name            database name

--db_comment         database comment

--timezone           timezone ( {+/-}{TZH:TZM} )

--character_set      character set

                            SQL_ASCII/UTF8/UHC/GB18030

     --char_length_units  char length units

                            OCTETS/CHARACTERS

     --home               home directory

     --member             local member name

     --host               host address

     --port               host port

     --silent             suppresses the display of the result message

     --help               print help message

 

examples:

 

gcreatedb --db_name="goldilocks" --db_comment="goldilocks database" --timezone="+09:00"

--character_set="UTF8" --char_length_units="OCTETS" --silent

 


 

Standalone 데이터 베이스 생성

 

[SHELL]> gcreatedb

Database created

 

[SHELL]> gcreatedb --db_name="TEST_DB" \

                   --db_commnet="test database comment" \

                   --timezone="+09:00" \

                   --character_set="UHC" \

                   --char_length_units="OCTETS"

Database created

 

[SHELL]> ls $GOLDILOCKS_DATA/db

system_data.dbf system_dict.dbf system_undo.dbf

 

 

Cluster System 에서 사용될 데이터베이스를 생성

 

[SHELL]> gcreatedb --cluster

Database created

 

[SHELL]> gcreatedb --cluster --member=G1N1

Database created

 

[SHELL]> gcreatedb --cluster --member=G1N1 --host=127.0.0.1 --port 10101

Database created

 

[SHELL]> gcreatedb --cluster \

                   --db_name="TEST_DB" \

                   --home=$GOLDILOCKS_DATA \

                   --host=127.0.0.1 \

                   --port=10101 \

                   --db_comment="g1n1 db comment" \

                   --timezone="+09:00" \

                   --character_set="UHC" \

                   --char_length_units="OCTETS"

Database created

 

[SHELL]> ls $GOLDILOCKS_DATA/db

system_data.dbf system_dict.dbf system_trans.dbf system_undo.dbf

 

 

- DB기동에 필수 적인 스키마 생성

오라클 수동 설치시와 마찬가지로 system/sys 스키마 생성하는 단계로 보면 .

Dictionary/Information/Performance 스키마 생성 스크립트를 수행해 준다.

 

Standalone용 스크립트

 

% gsql --as sysdba --import $GOLDILOCKS_HOME/admin/standalone/DictionarySchema.sql

% gsql --as sysdba --import $GOLDILOCKS_HOME/admin/standalone/InformationSchema.sql

% gsql --as sysdba --import $GOLDILOCKS_HOME/admin/standalone/PerformanceViewSchema.sql

 

Cluster System용 스크립트

 

% gsql --as sysdba --import $GOLDILOCKS_HOME/admin/cluster/DictionarySchema.sql

% gsql --as sysdba --import $GOLDILOCKS_HOME/admin/cluster/InformationSchema.sql

% gsql --as sysdba --import $GOLDILOCKS_HOME/admin/cluster/PerformanceViewSchema.sql

 

 

 


  

반응형

+ Recent posts