#author("2018-06-23T14:28:59+00:00","default:haikikyou","haikikyou")
#contents

* pgenv2 [#u56e47f6]

- ローカルマシン上で複数バージョンのPostgreSQLをインストールして管理するためのツール
- テストや開発時に役に立つことを目的として作成
- レプリケーションクラスタを構築したり、動作確認を行なうのにも有用

* 動作要件 [#be893d48]

- Bash 4.2 or later

* インストール [#q61b577c]

#geshi(bash){{{
$ git clone https://github.com/moritoru81/pgenv2.git
$ cd pgenv2
$ source install.sh
}}}

* 使用方法 [#n42a300c]

** 利用可能なバージョンを表示 [#j00178c6]

#geshi(bash){{{
$ pgenv versions
}}}

** インストール [#s0cffe32]

#geshi(bash){{{
$ pgenv install 10.4
}}}

** デフォルト使用を10,4にする [#ia112e71]

#geshi(bash){{{
$ pgenv global 10.4
}}}

** クラスタ [#o4b1a864]

*** クラスタ作成 [#cb216090]

#geshi(bash){{{
$ pgenv cluster -D clusterdir -s standby primary
}}}

*** クラスタ停止 [#id351be3]

#geshi(bash){{{
$ pgenv cluster -D clusterdir stop -a
}}}

*** クラスタ起動 [#aa3325ca]

#geshi(bash){{{
$ pgenv cluster -D clusterdir start -a
}}}


*** クラスタ状態表示 [#c9ad98e6]

#geshi(bash){{{
$ pgenv cluster -D clusterdir status
}}}


*** クラスタノード追加/削除 [#da35623d]

#geshi(bash){{{
$ pgenv cluster -D clusterdir ctrl --attach --fork-off primary standby2
$ pgenv cluster -D clusterdir ctrl --dettach  standby2
}}}

*** クラスタのログをtail [#v462b19f]

#geshi(bash){{{
# 全てのインスタンスの最新ログをtail
$ pgenv cluster -D clusterdir tail -f --all

# primaryの最新ログのみtail
$ pgenv cluster -D clusterdir tail -f primary

# 全てのインスタンスの全てのログをtail
$ pgenv cluster -D clusterdir tail -f --all --all-logs
}}}

** 拡張機能 [#neb0a391]

拡張機能の雛形を作成

#geshi(bash){{{
$ pgenv extension init myext
}}}

拡張機能をビルド

#geshi(bash){{{
$ pgenv extension install -v @all myext
}}}

拡張機能のリグレッションテスト

#geshi(bash){{{
$ pgenv extension run -v @all myext make installcheck
}}}



* 参考リンク [#lc0f8e01]

- https://github.com/moritoru81/pgenv2

トップ   一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
目次
ダブルクリックで閉じるTOP | 閉じる
GO TO TOP