centos 7에서
postgres 9.6 binary install 방법
postgres install 방법에는 총 3가지가 있고
binary install , yum install , rpm install 등이 있음. ( source code 를 받아 컴파일 하는 것도 존재함)
1.파일 다운로드
wget https://get.enterprisedb.com/postgresql/postgresql-9.6.2-4-linux-x64-binaries.tar.gz
최신 버전은 https://get.enterprisedb.com/postgresql/postgresql-9.6.11-1-linux-x64-binaries.tar.gz
2. 압축 풀기
적당히 설치할 위치에 압축을 풀고
$ mkdir /guddls/database --> 적당한 디랙토리 생성
$ cd /guddls/database --> 위치 이동
$ mv /download/postgresql-9.6.2-4-linux-x64-binaries.tar.gz /guddls/database/
--> 여기 까지는 디렉토리 생성부터 압축 파일 복사 까지
$ tar -xvzf postgresql-9.6.2-4-linux-x64-binaries.tar.gz
--> 압축 풀기
3. 데이터 디렉토리 생성및 initdb
$ mkdir /guddls/data --> /guddls/data 는 설정 파일 및 데이터가 생성될 디렉토리
$ /guddls/database/postgres/bin/initdb -D /guddls/data
[/guddls/database/postgres/bin/initdb -- > 앞축푼 폴더 밑 bin/initdb를 실행]
The files belonging to this database system will be owned by user "guddls". This user must also own the server process. The database cluster will be initialized with locale "ko_KR.UTF-8". The default database encoding has accordingly been set to "UTF8". initdb: could not find suitable text search configuration for locale "ko_KR.UTF-8" The default text search configuration will be set to "simple". Data page checksums are disabled. fixing permissions on existing directory /guddls/data... ok creating subdirectories ... ok selecting default max_connections ... 100 selecting default shared_buffers ... 128MB selecting dynamic shared memory implementation ... posix creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... ok syncing data to disk ... ok WARNING: enabling "trust" authentication for local connections You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb. Success. You can now start the database server using: bin/pg_ctl -D /guddls/data -l logfile start
4. postgres 실행
$ /guddls/database/postgres/bin/pg_ctl -D /guddls/data -l logfile start
server starting
5. posgres 종료
$ /guddls/database/postgres/bin/pg_ctl -D /guddls/data -l logfile stop
waiting for server to shut down.... done
server stopped
'linux' 카테고리의 다른 글
postgres 서비스 등록 (0) | 2019.02.07 |
---|---|
Centos 7 Samba 설치 (1) | 2017.04.12 |
Centos 7 원격제어 - XRDP + Tigervnc-server (0) | 2017.04.06 |