この製品のマニュアルセットは、偏向のない言語を使用するように配慮されています。このマニュアルセットでの偏向のない言語とは、年齢、障害、性別、人種的アイデンティティ、民族的アイデンティティ、性的指向、社会経済的地位、およびインターセクショナリティに基づく差別を意味しない言語として定義されています。製品ソフトウェアのユーザーインターフェイスにハードコードされている言語、RFP のドキュメントに基づいて使用されている言語、または参照されているサードパーティ製品で使用されている言語によりドキュメントに例外が存在する場合があります。シスコのインクルーシブランゲージに対する取り組みの詳細は、こちらをご覧ください。
このドキュメントは、米国シスコ発行ドキュメントの参考和訳です。リンク情報につきましては、日本語版掲載時点で、英語版にアップデートがあり、リンク先のページが移動/変更されている場合がありますことをご了承ください。あくまでも参考和訳となりますので、正式な内容については米国サイトのドキュメントを参照ください。
この章では、PostgreSQL のインストールおよび設定について説明します。
シスコでは、PostgreSQL DBA が PostgreSQL サーバをインストールして保守することを推奨しています。
セキュリティの推奨事項について の項で PostgreSQL データベースのセキュリティの推奨事項をご覧ください。
サポートされているバージョンの詳細については、外部データベースの設定の要件 を参照してください。
ステップ 1 | 次のコマンドを入力して、Postgres のユーザとしてデータベース サーバにサイン インします。
>su - postgres >psql | ||||||||||||||||||||
ステップ 2 | 新しいデータベース ユーザを作成します。次の例では、tcuser という名前の新しいデータベース ユーザを作成しています。
#CREATE ROLE tcuser LOGIN CREATEDB;
| ||||||||||||||||||||
ステップ 3 | データベースを作成します。データベースに ASCII 文字のみが含まれる場合、SQL_ASCII の符号化でデータベースを作成します。データベースに ASCII 以外の文字が含まれる場合、UTF8 の符号化でデータベースを作成します。
次の例では、tcmadb という名前の SQL_ASCII データベースを作成しています。 #CREATE DATABASE tcmadb WITH OWNER tcuser ENCODING 'SQL_ASCII'; | ||||||||||||||||||||
ステップ 4 | データベースへのユーザ アクセスを設定します。install_dir/data/pg_hba.conf ファイルを編集して、postgres ユーザと新しい tcuser ユーザがデータベースにアクセスできるようにします。次に例を示します。
| ||||||||||||||||||||
ステップ 5 | 次のコマンドを入力して、postgres ユーザと tcuser ユーザのパスワードを定義します。
#ALTER ROLE postgres WITH PASSWORD 'mypassword'; #ALTER ROLE tcuser WITH PASSWORD 'mypassword';
| ||||||||||||||||||||
ステップ 6 | PostgreSQL バージョン 8.3.7 またはそれ以降の 8.3.x リリースを実行している場合は、tcuser の権限をスーパーユーザに変更して、このユーザにデータベースへのアクセスを許可します。次のコマンドを入力します。
#ALTER ROLE tcuser WITH SUPERUSER; | ||||||||||||||||||||
ステップ 7 | リモート ホストからのデータベースへの接続を設定します。install_dir/data/postgresql.conf ファイルで listen_addresses パラメータを編集します。次に例を示します。
listen_addresses = '*' | ||||||||||||||||||||
ステップ 8 | PostgreSQL バージョン 9.1.1 を実行している場合、postgresql.conf ファイルに次の値を設定する必要があります。
escape_string_warning = off standard_conforming_strings = off | ||||||||||||||||||||
ステップ 9 | PostgreSQL サービスを停止し、再起動します。次に例を示します。
/etc/rc.d/init.d/postgresql-8.3 stop /etc/rc.d/init.d/postgresql-8.3 start
| ||||||||||||||||||||
ステップ 10 | 次のコマンドを入力して、postgres ユーザとして新しいデータベースにサインインし、PL/pgSQL を有効にします。
>psql tcmadb -U postgres
#CREATE FUNCTION plpgsql_call_handler () RETURNS LANGUAGE_HANDLER AS '$libdir/plpgsql' LANGUAGE C; #CREATE TRUSTED PROCEDURAL LANGUAGE plpgsql HANDLER plpgsql_call_handler; トラブルシューティングのヒント install_dir/data/postgresql.conf ファイルでは、次の設定項目をオンにしないでください(デフォルトで、これらの項目はコメント アウトされています)。 client_min_messages = log log_duration = on |
(注) | この項の設定はオプションです。 |
デフォルトでは、Postgresql データベースはポート 5432 で待機します。このポートを変更する場合は、/etc/rc.d/init.d/postgresql で PGPORT 環境変数を新しいポート番号で編集する必要があります。
(注) | PGPORT 環境変数は /var/lib/pgsql/data/postgresql.conf ファイルでの「ポート」パラメータ値を上書きするため、Postgresql データベースを新しいポート番号で待機させるには、PGPORT 環境変数を編集する必要があります。 |
外部データベースへのユーザ アクセスを、特定のユーザや IM and Presence サービスが使用するデータベース インスタンスのみに制限することを強く推奨します。<install_dir>/data ディレクトリにある pg_hba.conf ファイルで、PostgreSQL データベースへのユーザ アクセスを制限できます。
注意 | どのようなユーザでも任意のデータベースにアクセスできるようになってしまうため、ユーザとデータベースのエントリには「all」を設定しないでください。 |
また、外部データベースにユーザ アクセスを設定する際に、データベース アクセスに、「パスワード」方式を使用して、パスワード保護を設定することも推奨します。
(注) | IM and Presence サービスでデータベース エントリを設定する際には、データベース ユーザのパスワードを入力する必要があります。 |
次に示すのは、pg_hba.conf ファイルでセキュアなユーザ アクセスを設定する例と、それほどセキュアではないユーザ アクセスを設定する例です。
# TYPE |
DATABASE |
USER |
CIDR-ADDRESS |
METHOD |
host |
dbinst1 |
tcuser1 |
10.89.99.0/24 |
password |
host |
dbinst2 |
mauser1 |
10.89.99.0/24 |
password |
# TYPE |
DATABASE |
USER |
CIDR-ADDRESS |
METHOD |
host |
dbinst1 |
tcuser1 |
10.89.99.0/24 |
trust |
host |
dbinst2 |
all |
10.89.99.0/24 |
password |