Troubleshooting#

Python仮想環境を再作成します#

時々、Python venvは一貫性のない状態になる場合があります。その場合、最も簡単な解決策は削除して再作成することです。壊れたvenvの症状には、次のようなプロビジョニング中のエラーが含まれる場合があります。

TASK [Write Vagrantfile and firstboot.sh]  ****  ****  ****  ****  ****  ****  ****  ****  ****  ****  ****  ****  ****  ****  ****  ****  ****  ****  ****  ****  ****  ****  ****  ****  ****  ****  ****  ****  ****  ****  **** **
failed: [localhost] (item=Vagrantfile) => {"changed": false, "checksum": "bf1403a17d897b68fa8137784d298d4da36fb7f9", "item": "Vagrantfile", "msg": "Aborting, target uses selinux but python bindings (libselinux-python) arent installed!"}

新しい仮想環境を作成するには tpaexecがデフォルトの場所にインストールされていると仮定します。

[tpa]$ sudo rm -rf /opt/EDB/TPA/tpa-venv
[tpa]$ sudo /opt/EDB/TPA/bin/tpaexec setup

資格情報に関する奇妙なAWSエラー#

TPAサーバーの時刻と日付が正しくない場合、プロビジョニング中にこれと同様のAWSエラーを取得する場合があります。

TASK [Register key tpa_cluster in each region]  ****  ****  ****  ****  ****  ****  ****  ****  ****  ****  **** **
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ClientError: An error occurred (AuthFailure) when calling the DescribeKeyPairs operation: AWS was not able to validate the provided access credentials
failed: [localhost] (item=eu-central-1) => {"boto3_version": "1.8.8", "botocore_version": "1.11.8", "changed": false, "error": {"code": "AuthFailure", "message": "AWS was not able to validate the provided access credentials"}, "item": "eu-central-1", "msg": "error finding keypair: An error occurred (AuthFailure) when calling the DescribeKeyPairs operation: AWS was not able to validate the provided access credentials", "response_metadata": {"http_headers": {"date": "Thu, 27 Sep 2018 12:49:41 GMT", "server": "AmazonEC2", "transfer-encoding": "chunked"}, "http_status_code": 401, "request_id": "a0d905ba-188f-48fe-8e5a-c8d8799e3232", "retry_attempts": 0}}

解決策-時刻と日付を正しく設定します。

[tpa]$ sudo ntpdate pool.ntp.org

ロギング#

デフォルトでは、すべてのtpaexecログはログファイル<clusterdir>/ansible.log に保存されます

ログファイルの場所を変更するには、環境変数ANSIBLE_LOG_PATH を目的の場所に設定します。たとえば、

export ANSIBLE_LOG_PATH=~/ansible.log

ロギングの詳細度を高めるには、 -v /-vv /-vvv /-vvvv /-vvvvv をtpaexecコマンドラインに追加するだけです。

[tpa]$ tpaexec deploy <clustername> -v

- v     shows the results of modules
- vv    shows the files from which tasks come
- vvv   shows what commands are being executed on the target machines
- vvvv  enables connection debugging, what callbacks have been loaded
- vvvvv shows some additional ssh configuration, filepath information

クラスターテスト#

既存のクラスターをスモークテストする簡単な方法は、次を実行することです。

[tpa]$ tpaexec test <clustername>

これにより、クラスターコンポーネントの機能テストが実行され、続いてpgbenchを使用してクラスターのパフォーマンステストが実行されます。 pgbenchは完了までに時間がかかるため、次のコマンドを実行してベンチマークを省略できます。

[tpa]$ tpaexec test <clustername> --excluded_tasks=pgbench

TPAサーバーテスト#

TPAサーバー自分自身のインストールを確認するには、次のコマンドを実行します。

[tpa]$ tpaexec selftest

特定のタスクを含めるまたは除外する#

障害が発生した後、またはテストを実行しているときにtpaexecのプロビジョニングまたは展開を再実行する場合、 TPAの Selective task execution を使用してタスクを見逃すことが役立つ場合があります。