0
クラウドフォーメーションテンプレート用に私のサーバ上でpostgresサーバを起動しています。問題は、私はそれが実行時にファイルをロード持っているかわからないということである、適切なユーザーまたはコマンドが何を次のようになります。CloudFormation用のUserDataのPostgresコマンド
May 2 13:50:16 ip-10-205-0-135 cloud-init: 2016-05-02 13:50:16 (31.1 MB/s) - ‘psqlCloudera.sql’ saved [876/876]
May 2 13:50:16 ip-10-205-0-135 cloud-init: psql -U postgres -a -f psqlCloudera.sql
May 2 13:50:16 ip-10-205-0-135 cloud-init: psql: FATAL: Peer authentication failed for user "postgres"
そして、このようなビット異なる:
私はこれを試してみました:
私のユーザデータには "su - postgres \ n"が含まれています。
May 2 13:31:05 ip-10-205-0-135 cloud-init: Saving to: ‘psqlCloudera.sql’
May 2 13:31:05 ip-10-205-0-135 cloud-init: 0K 100% 36.2M=0s
May 2 13:31:05 ip-10-205-0-135 cloud-init: 2016-05-02 13:31:05 (36.2 MB/s) - ‘psqlCloudera.sql’ saved [876/876]
May 2 13:31:05 ip-10-205-0-135 cloud-init: psql -a -f psqlCloudera.sql
May 2 13:31:05 ip-10-205-0-135 cloud-init: psql: FATAL: role "root" does not exist
スタートアップ時にポストグルを読み込む適切な方法は何ですか?