Ich versuche, meine erste Phoenix-App mit Compose Cloud Hosted Postgres DB verbunden und kann keine Verbindung herstellen. Ich habe bestätigt, dass es läuft. Ich erhalte den folgenden Fehler:Elixir/Phoenix kann keine Verbindung zu Cloud gehosteten Postgres DB
[error] GenServer #PID<0.178.0> terminating
** (DBConnection.ConnectionError) tcp connect (postgres://*****@aws-us-east-1-portal.5.dblayer.com:16786/compose:5432): non-existing domain - :nx
domain
(db_connection) lib/db_connection/connection.ex:148: DBConnection.Connection.connect/2
(connection) lib/connection.ex:622: Connection.enter_connect/5
(stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Last message: nil
State: Postgrex.Protocol
** (Mix) The database for HelloPhoenix.Repo couldn't be created: an exception was raised:
** (DBConnection.ConnectionError) tcp connect (postgres://****@aws-us-east-1-portal.5.dblayer.com:16786/compose:5432): non-existing domain -
:nxdomain
(db_connection) lib/db_connection/connection.ex:148: DBConnection.Connection.connect/2
(connection) lib/connection.ex:622: Connection.enter_connect/5
(stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Das ist meine Abhängigkeiten:
defp deps do
[{:phoenix, "~> 1.2.1"},
{:phoenix_pubsub, "~> 1.0"},
{:phoenix_ecto, "~> 3.0"},
{:postgrex, ">= 0.0.0"},
{:phoenix_html, "~> 2.6"},
{:phoenix_live_reload, "~> 1.0", only: :dev},
{:gettext, "~> 0.11"},
{:cowboy, "~> 1.0"}]
end
Und meine DB Config:
# Configure your database
config :hello_phoenix, HelloPhoenix.Repo,
adapter: Ecto.Adapters.Postgres,
username: "admin",
password: "******",
database: "compose",
hostname: "postgres://admin:******@aws-us-east-1-portal.5.dblayer.com:16786/compose",
pool_size: 10
Und mit dieser Version von PostgresSQL: PostgreSQL 9.4.10
Jede Hilfe würde sehr geschätzt werden. :-) Mach's gut! -Chris
dank Mann, die perfekt funktioniert! – cpeele00