Opensourcetechブログ

OpensourcetechによるNGINX/Kubernetes/Zabbix/Neo4j/Linuxなどオープンソース技術に関するブログです。

CentOS6.6(x86_64)にPostgresql9.4をインストールする

こんにちは、鯨井貴博@opensourcetechです。

 

 今回は、PostgreSQL9.4をCentOS6.6(x86_64)にインストールしてみようと思います。

f:id:opensourcetech:20150714005931p:plain

 

なお、Postgresqlに関しては、以下のURLから様々な情報が得られます。

http://www.postgresql.org/

f:id:opensourcetech:20150714005823p:plain

 

 日本語の情報が欲しいという方は、

NPO法人 日本PostgreSQLユーザ会のサイトもよさそうです。

www.postgresql.jp

 

 

コマンドラインから、yum install postgresql*とすると、

通常のレポジトリにあるバージョン8.4がインストールされます。

f:id:opensourcetech:20150714010937p:plain

 

 

その為、9.4を使用するにはまずレポジトリを追加します。

yum install http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-redhat94-9.4-1.noarch.rpm

f:id:opensourcetech:20150714011359p:plain

f:id:opensourcetech:20150714011406p:plain

 

すると、/etc/yum.repos.dpgdg-94-redhat.repoが追加され、

yum.posgresql.orgからバージョン9.4が取得できます。

f:id:opensourcetech:20150714011456p:plain

f:id:opensourcetech:20150714011458p:plain

 

 

yum install postgresql94-server postgresql94-contrib

f:id:opensourcetech:20150714012050p:plain

f:id:opensourcetech:20150714012053p:plain

 

また、GUI環境からPostgreSQLを操作する「pgadmin3」も、

yum install pgadmin3_94 でインストール可能です。

 

その後、service postgresql-9.4 initdbでデータベース初期化、

chkconfig postgresql-9.4 onで自動起動が可能です。

f:id:opensourcetech:20150714013000p:plain

f:id:opensourcetech:20150714013003p:plain

 

参照サイト:http://www.postgresql.org/download/linux/redhat/#yum

 

 

にほんブログ村 IT技術ブログ Linuxへ
Linux

にほんブログ村 IT技術ブログ オープンソースへ
オープンソース

Opensourcetech by Takahiro Kujirai