Ich habe einen Postgres-Server auf meinem Server für eine Cloud-Formationsvorlage gestartet. Das Problem ist, dass ich nicht sicher bin, wie es eine Datei während der Laufzeit geladen haben, was der richtige Benutzer oder Befehl wäre:Postgres-Befehl in UserData für CloudFormation
Ich habe dies versucht:
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"
Und ein bisschen anders wie diese :
Es beinhaltet ein "su - postgres \ n", in meinen userdata.
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
Was ist der richtige Weg, um ein Postgres beim Start zu laden?