푸른 날개를 꿈꾸는 아이's 메모장
hp-ux PostgreSQL 설치하기 본문
#---------------------------------------------------------------------------
# hpux porting & archving centre 경로
#---------------------------------------------------------------------------
http://hpux.connect.org.uk/
#---------------------------------------------------------------------------
# hpux DB 설치하기
#---------------------------------------------------------------------------
위 사이트에서 postgresql 다운로드.
현재 설치 버전은 9.3.2 (postgresql-9.3.2-ia64-11.31.depot.gz) 이며 설치된 경로는 /usr/local/pgsql
설치 후 초기화를 위해 아래 파일이 요구되며 hpux porting & archving centre 에서 받을 수 있음.
$ swinstall -s /home/postgres/readline-7.0-ia64-11.31.depot.gz
$ swinstall -s /home/postgres/termcap-1.3.1-ia64-11.31.depot.gz
$ swinstall -s /home/postgres/zlib-1.2.8-ia64-11.31.depot.gz
설치전 $ machinfo 로 OS 정보 확인 후 해당 postgresql 파일 다운받기.
설치명령어:
$ swinstall -s /home/postgres/postgresql-9.3.2-ia64-11.31.depot.gz
※ swinstall 실행시 화면은 tab키로 이동
1) 처음 실행시 space바를 클릭하여 선택 (흰색으로 변경됨)
2) tab키 > Actions > Install...
3) OK 선택 > Done . 메뉴의 File의 Exit로 종료
기본 설치 경로: /usr/local/pgsql
시스템 계정 프로필 정보 셋팅:
- 프로필정보
PGHOME=/usr/local/pgsql
PGDATA=$PGHOME/data
PGLOG=$PGHOME/pgstartup.log
PGPORT=5432
LANG="ko_KR.utf8"
LD_LIBRARY_PATH=$PGHOME/lib
SHLIB_PATH=$LD_LIBRARY_PATH
LIBPATH=$LD_LIBRARY_PATH
PATH=$PGHOME/bin:$PATH
export PGDATA
export PGPORT
export PATH
export LD_LIBRARY_PATH
export SHLIB_PATH
export LIBPATH
export LANG
DB 데이터 저장 디렉토리 생성:
$ mkdir /usr/local/pgsql/data
DB 초기화:
$ initdb -D /usr/local/pgsql/data -E 'UTF-8'
서버 시작하기
$ pg_ctl -D /usr/local/pgsql/data start
서버 종료하기
$ pg_ctl -D /usr/local/pgsql/data stop
pg_ctl stop [-W] [-t seconds] [-s] [-D datadir] [-m s[mart] | f[ast] | i[mmediate] ]
db 계정 및 비밀번호 생성:
$ createdb kisa
$ psql kisa
kisa=# create role kisa LOGIN PASSWORD 'itsm123';
db 백업파일 임포트:
$ pg_restore -C -d kisa dumpFileName
원격정보를 위한 설정으로 DB툴 접속시 필요.
$ vi /usr/local/pgsql/data/pg_hba.conf
- 아래 내용 추가.
host all all 0.0.0.0/0 md5
$ vi /usr/local/pgsql/data/postgresql.conf
- 아래 내용 변경.
listen_addresses = '*'
port = 5432 //포트
max_connections = 500 //커넥션 최대 값
참고 매뉴얼: https://www.postgresql.org/docs/9.3/static/index.html