I can't install docker kong problem

hello,

i can’t install docker with these guides:


https://hub.docker.com/_/kong/

a few months ago, with kong 0.13.0 the containers installation was correct.

Thanks for the answers

Please add more information: which steps did you follow, what was the expected result, and what did you receive instead.

Also, note that the official docs for installing with Docker are inside the Kong docs page:

hi kikito:

I execute:

docker run -d --name kong-database
-p 9042:9042
cassandra:3

docker run --rm
-e “KONG_DATABASE=cassandra”
-e “KONG_CASSANDRA_CONTACT_POINTS=kong-database”
kong:latest kong migrations up

docker run -d --name kong
–network=kong-net
-e “KONG_DATABASE=cassandra”
-e “KONG_CASSANDRA_CONTACT_POINTS=kong-database”
-e “KONG_PROXY_ACCESS_LOG=/dev/stdout”
-e “KONG_ADMIN_ACCESS_LOG=/dev/stdout”
-e “KONG_PROXY_ERROR_LOG=/dev/stderr”
-e “KONG_ADMIN_ERROR_LOG=/dev/stderr”
-e “KONG_ADMIN_LISTEN=0.0.0.0:8001, 0.0.0.0:8444 ssl”
-p 8000:8000
-p 8443:8443
-p 8001:8001
-p 8444:8444
kong:latest

but the kong conrainer don’t start.

also with option
docker network create kong-net

Moreover i have try with the version 0.13, no latest
kong:0.13.0 and 0.13.1

but the result is the same.

i try this installation with
docker-ce-18.06.0.ce-3.el7.x86_64 in Centos 7, selinux disabled
and
docker 18.03.1-ce MAC OS Sierra 10.12.6

thank you

Hi,

You didn’t mention when you created a kong net. This step is needed before calling docker run:

docker network create kong-net

Make sure you use the --network=kong-net option in all the calls to docker run. In your example, the kong-database one does not have the option.

but the kong conrainer don’t start.

Did you see any error message? You might be able to see them by executing

docker logs kong

Hi kikito,

I had created de network at the begining. I have try to install with and without this option.

docker don’t show any logs in Centos 7
in Mac osx show:

2018/07/25 11:54:44 [warn] You are using Cassandra but your ‘db_update_propagation’ setting is set to ‘0’ (default). Due to the distributed nature of Cassandra, you should increase this value.
2018/07/25 11:54:45 [warn] You are using Cassandra but your ‘db_update_propagation’ setting is set to ‘0’ (default). Due to the distributed nature of Cassandra, you should increase this value.
2018/07/25 11:54:45 [warn] 1#0: [lua] cluster.lua:136: set_peer_down(): [lua-cassandra] setting host at kong-database-test DOWN
nginx: [warn] [lua] cluster.lua:136: set_peer_down(): [lua-cassandra] setting host at kong-database-test DOWN
2018/07/25 11:54:45 [error] 1#0: init_by_lua error: /usr/local/share/lua/5.1/kong/init.lua:164: all hosts tried for query failed. kong-database-test: host seems unhealthy, considering it down (host or service not provided, or not known)
stack traceback:
[C]: in function ‘assert’
/usr/local/share/lua/5.1/kong/init.lua:164: in function ‘init’
init_by_lua:3: in main chunk
nginx: [error] init_by_lua error: /usr/local/share/lua/5.1/kong/init.lua:164: all hosts tried for query failed. kong-database-test: host seems unhealthy, considering it down (host or service not provided, or not known)
stack traceback:
[C]: in function ‘assert’
/usr/local/share/lua/5.1/kong/init.lua:164: in function ‘init’
init_by_lua:3: in main chunk

thank you very much

The error is clear in your logs:

kong-database-test: host seems unhealthy, considering it down (host or service not provided, or not known)

Kong cannot reach the database (and the migration step probably failed as well). We also see in those logs that you seem to be using a different name that the one you created your database container with (kong-database-test vs. kong-database).

So:

  1. Make sure that you added the database container to the Docker network you defined
  2. Make sure to add the ephemeral migrations container and the Kong container to it as well
  3. Make sure to use the proper name when referring to the database container in both of the above steps

Let us know how it goes.

yes,

you see “kong-database-test” because I have done several test but I use the proper name.

how can I do a new install of kong 0.13?

thanks

today i have tried a new install in ubuntu16 with docker 18
I put this commands:

docker run -d --name kong-database
-p 9042:9042
cassandra:3

docker run --rm
–link kong-database:kong-database
-e “KONG_DATABASE=cassandra”
-e “KONG_PG_HOST=kong-database”
-e “KONG_CASSANDRA_CONTACT_POINTS=kong-database”
kong kong migrations up

/usuario# docker run -d --name kong --link kong-database:kong-database -e “KONG_DATABASE=cassandra” -e “KONG_CASSANDRA_CONTACT_POINTS=kong-database” -e “KONG_PROXY_ACCESS_LOG=/dev/stdout” -e “KONG_ADMIN_ACCESS_LOG=/dev/stdout” -e “KONG_PROXY_ERROR_LOG=/dev/stderr” -e “KONG_ADMIN_ERROR_LOG=/dev/stderr” -e “KONG_ADMIN_LISTEN=0.0.0.0:8001” -e “KONG_ADMIN_LISTEN_SSL=0.0.0.0:8444” -p 8000:8000 -p 8443:8443 -p 8001:8001 -p 8444:8444 kong

but kong container don’t start, and there isn’t logs with this command:
docker logs kong

thanks

A good docker debug step is to jump into the container:

You can start the kong container and hop into /bin/sh as follows:

docker run -d --name kong-database -p 9042:9042 cassandra:3

docker run -it --rm --link kong-database:kong-database -e KONG_PG_HOST=kong-database -e KONG_CASSANDRA_CONTACT_POINTS=kong-database -e KONG_DATABASE=cassandra kong /bin/sh

kong migrations up

kong start

or in your example you could do the following

docker exec -it kong /bin/sh

and then debug from there ps aux etc