OpenDolphin-1.3をMacOSX Tiger上で構築する記録です。1台のMac上にサーバも構築してみようと考えています。このブログでは、元町皮ふ科様のサイトを参考に、それを忠実に(?)再現しようとした試みです。 バイブルサイトのURIは、こちらです。

2008年7月23日水曜日

MacPortsを利用したPostgreSQLのインストール

MacPortsを利用してOpenDolphinのデータベースバックエンドとなるPostgreSQLをインストールします。

PostgreSQLの本家サイト
日本PostgreSQLユーザー会のサイト

元町皮ふ科様のサイトでは、Debian EtchにあわせてPostgreSQL 8.1を導入されていますが、せっかくだから最新のものをインストールしてみます。

まずは、MacPortsにあるPostgreSQL関連のパッケージを検索します。コンソールを立ち上げて以下のコマンドを実行します。
tmiura$ port search postgresql
postgresql7 databases/postgresql7 7.4.21 The most advanced open-source database available anywhere
postgresql80 databases/postgresql80 8.0.17 The most advanced open-source database available anywhere
postgresql80-doc databases/postgresql80-doc 8.0.17 Documentation for the postgresql database
postgresql80-server databases/postgresql80-server 8.0.17 run postgresql80 as server
postgresql81 databases/postgresql81 8.1.13 The most advanced open-source database available anywhere
postgresql81-doc databases/postgresql81-doc 8.1.13 Documentation for the postgresql database
postgresql81-server databases/postgresql81-server 8.1.13 run postgresql81 as server
postgresql82 databases/postgresql82 8.2.9 The most advanced open-source database available anywhere
postgresql82-doc databases/postgresql82-doc 8.2.9 Documentation for the postgresql database
postgresql82-server databases/postgresql82-server 8.2.9 run postgresql82 as server
postgresql83 databases/postgresql83 8.3.3 The most advanced open-source database available anywhere.
postgresql83-doc databases/postgresql83-doc 8.3.3 Documentation for the postgresql database
postgresql83-server databases/postgresql83-server 8.3.3 run postgresql83 as server
postgresql_autodoc databases/postgresql_autodoc 1.25 Automatic documentation generator for postgresql databases
postgresql-jdbc java/postgresql-jdbc 8.0-311 PostgreSQL JDBC driver
py-postgresql-exception python/py-postgresql-exception 0.2 exceptions for the py-postgresql modules
py-postgresql-greentrunk python/py-postgresql-greentrunk 0.1 greentrunk interface to postgresql
py-postgresql-layout python/py-postgresql-layout 0.3 layout for the py-postgresql modules
py-postgresql-pqueue python/py-postgresql-pqueue 0.1 pure python implementation of the pq protocol
py-postgresql-proboscis python/py-postgresql-proboscis 0.1 postgresql database connector in pure python

どうやらPostgreSQL83が最新のパッケージのようです。実際のインストールは、root権限が必要ですから
tmiura$ sudo port install postgresql83
tmiura$ sudo port install postgresql83-server

とします。
あとは、インストール時に表示される指示に従い
PostgreSQLを自動起動するように設定。
tmiura$ sudo launchctl load -w /Library/LaunchDaemons/org.macports.postgresql83-server.plist
データベース領域の確保および初期化を行います。
tmiura$ sudo mkdir -p /opt/local/var/db/postgresql83/defaultdb
tmiura$ sudo chown postgres:postgres /opt/local/var/db/postgresql83/defaultdb
tmiura$ sudo su postgres -c '/opt/local/lib/postgresql83/bin/initdb -D /opt/local/var/db/postgresql83/defaultdb'

以後はMacを立ち上げる際にはPostgreSQLが自動起動するようになります。
一応確認。
tmiura$ ps ax | grep postgresql
32 ?? Ss 0:00.01 /opt/local/bin/daemondo --label=postgresql83-server --start-cmd /opt/local/etc/LaunchDaemons/org.macports.postgresql83-server/postgresql83-server.
65 ?? S 0:01.16 /opt/local/lib/postgresql83/bin/postgres -D /opt/local/var/db/postgresql83/defaultdb
2451 p1 R+ 0:00.00 grep postgresql


ちゃんとPostgreSQL83が起動しているようです。

0 件のコメント:

自己紹介

ちょっとしたTipsのメモです。