Kong: error on start kong-0.9.5.el7.noarch.rpm

Created on 12 Dec 2016  路  3Comments  路  Source: Kong/kong

hi

for install kong on centos7.2-x86-64 i first install "postgresql94-server" and "postgresql94-contrib" package and then run this command :

/usr/pgsql-9.4/bin/postgresql94-setup initdb

and then start postgresql service.

after that i create linux user by name "kong" with "kong" password.

after that i login to postgresql :

su - postgres

and then run :

$psql

and then run this command for create user and database :

CREATE USER kong; CREATE DATABASE kong OWNER kong;

then exit of postgresql and login to linux user kong :

su - kong

for start kong i run this command :

$ kong start

but display this error :

$ kong start
ulimit is currently set to "1024". For better performance set it to at least "4096" using "ulimit -n"
Error: /usr/local/share/lua/5.1/kong/cmd/start.lua:18: [postgres error] FATAL: Ident authentication failed for user "kong"

Run with --v (verbose) or --vv (debug) for more details

for more info :

$ kong start --vv
2016/12/12 23:21:27 [verbose] Kong: 0.9.5
2016/12/12 23:21:27 [debug] ngx_lua: 10006
2016/12/12 23:21:27 [debug] nginx: 1011002
2016/12/12 23:21:27 [debug] Lua: LuaJIT 2.1.0-beta2
2016/12/12 23:21:27 [debug] PRNG seed: 568211172181
2016/12/12 23:21:27 [verbose] reading config file at /etc/kong.conf
2016/12/12 23:21:27 [debug] admin_listen = "0.0.0.0:8001"
2016/12/12 23:21:27 [debug] anonymous_reports = true
2016/12/12 23:21:27 [debug] cassandra_consistency = "ONE"
2016/12/12 23:21:27 [debug] cassandra_contact_points = {"127.0.0.1"}
2016/12/12 23:21:27 [debug] cassandra_data_centers = {"dc1:2","dc2:3"}
2016/12/12 23:21:27 [debug] cassandra_keyspace = "kong"
2016/12/12 23:21:27 [debug] cassandra_port = 9042
2016/12/12 23:21:27 [debug] cassandra_repl_factor = 1
2016/12/12 23:21:27 [debug] cassandra_repl_strategy = "SimpleStrategy"
2016/12/12 23:21:27 [debug] cassandra_ssl = false
2016/12/12 23:21:27 [debug] cassandra_ssl_verify = false
2016/12/12 23:21:27 [debug] cassandra_timeout = 5000
2016/12/12 23:21:27 [debug] cassandra_username = "kong"
2016/12/12 23:21:27 [debug] cluster_listen = "0.0.0.0:7946"
2016/12/12 23:21:27 [debug] cluster_listen_rpc = "127.0.0.1:7373"
2016/12/12 23:21:27 [debug] cluster_profile = "wan"
2016/12/12 23:21:27 [debug] cluster_ttl_on_failure = 3600
2016/12/12 23:21:27 [debug] custom_plugins = {}
2016/12/12 23:21:27 [debug] database = "postgres"
2016/12/12 23:21:27 [debug] dnsmasq = true
2016/12/12 23:21:27 [debug] dnsmasq_port = 8053
2016/12/12 23:21:27 [debug] log_level = "notice"
2016/12/12 23:21:27 [debug] lua_code_cache = "on"
2016/12/12 23:21:27 [debug] lua_package_cpath = ""
2016/12/12 23:21:27 [debug] lua_package_path = "?/init.lua;./kong/?.lua"
2016/12/12 23:21:27 [debug] lua_ssl_verify_depth = 1
2016/12/12 23:21:27 [debug] mem_cache_size = "128m"
2016/12/12 23:21:27 [debug] nginx_daemon = "on"
2016/12/12 23:21:27 [debug] nginx_optimizations = true
2016/12/12 23:21:27 [debug] nginx_worker_processes = "auto"
2016/12/12 23:21:27 [debug] pg_database = "kong"
2016/12/12 23:21:27 [debug] pg_host = "127.0.0.1"
2016/12/12 23:21:27 [debug] pg_password = "**"
2016/12/12 23:21:27 [debug] pg_port = 5432
2016/12/12 23:21:27 [debug] pg_ssl = false
2016/12/12 23:21:27 [debug] pg_ssl_verify = false
2016/12/12 23:21:27 [debug] pg_user = "kong"
2016/12/12 23:21:27 [debug] prefix = "/usr/local/kong/"
2016/12/12 23:21:27 [debug] proxy_listen = "0.0.0.0:8000"
2016/12/12 23:21:27 [debug] proxy_listen_ssl = "0.0.0.0:8443"
2016/12/12 23:21:27 [debug] serf_path = "serf"
2016/12/12 23:21:27 [debug] ssl = true
2016/12/12 23:21:27 [verbose] prefix in use: /usr/local/kong
2016/12/12 23:21:27 [verbose] preparing nginx prefix directory at /usr/local/kong
2016/12/12 23:21:27 [verbose] saving serf identifier to /usr/local/kong/serf/serf.id
2016/12/12 23:21:27 [debug] searching for OpenResty 'resty' executable
2016/12/12 23:21:27 [debug] /usr/local/openresty/bin/resty -V: 'nginx version: openresty/1.11.2.1'
2016/12/12 23:21:27 [debug] found OpenResty 'resty' executable at /usr/local/openresty/bin/resty
2016/12/12 23:21:27 [verbose] saving serf shell script handler to /usr/local/kong/serf/serf_event.sh
2016/12/12 23:21:27 [verbose] SSL enabled, no custom certificate set: using default certificate
2016/12/12 23:21:27 [verbose] default SSL certificate found at /usr/local/kong/ssl/kong-default.crt
2016/12/12 23:21:27 [warn] ulimit is currently set to "1024". For better performance set it to at least "4096" using "ulimit -n"
2016/12/12 23:21:27 [verbose] running datastore migrations
2016/12/12 23:21:27 [verbose] could not start Kong, stopping services
2016/12/12 23:21:27 [verbose] leaving serf cluster
2016/12/12 23:21:27 [verbose] stopping dnsmasq at /usr/local/kong/pids/dnsmasq.pid
2016/12/12 23:21:27 [debug] sending signal to pid at: /usr/local/kong/pids/dnsmasq.pid
2016/12/12 23:21:27 [debug] no pid file at: /usr/local/kong/pids/dnsmasq.pid
2016/12/12 23:21:27 [verbose] stopped services
Error:
/usr/local/share/lua/5.1/kong/cmd/start.lua:37: /usr/local/share/lua/5.1/kong/cmd/start.lua:18: [postgres error] FATAL: Ident authentication failed for user "kong"
stack traceback:
[C]: in function 'error'
/usr/local/share/lua/5.1/kong/cmd/start.lua:37: in function 'cmd_exec'
/usr/local/share/lua/5.1/kong/cmd/init.lua:89: in function
[C]: in function 'xpcall'
/usr/local/share/lua/5.1/kong/cmd/init.lua:89: in function
/usr/local/bin/kong:15: in function 'file_gen'
init_worker_by_lua:38: in function
[C]: in function 'pcall'
init_worker_by_lua:45: in function

$ kong version
0.9.5

$ uname -r
3.10.0-327.el7.x86_64

how can i fix this error?
tnx

Most helpful comment

@thibaultcha
tnx man
my problem is Solved.i doing this config :

Install postgresql94 :
Install repo :

rpm -ivh http://yum.postgresql.org/9.4/redhat/rhel-7-x86_64/pgdg-centos94-9.4-1.noarch.rpm

yum install postgresql94-server postgresql94-contrib

/usr/pgsql-9.4/bin/postgresql94-setup initdb

systemctl enable postgresql-9.4.service

systemctl start postgresql-9.4.service


install kong :

wget -c https://github.com/Mashape/kong/releases/download/0.9.5/kong-0.9.5.el7.noarch.rpm

yum install epel-release

yum install kong-0.9.5.el7.noarch.rpm

Configure your database :

su - postgres

$ psql

postgres=# CREATE USER kong; CREATE DATABASE kong OWNER kong;

postgres=# ALTER USER kong WITH password 'kong';

cp /etc/kong/kong.conf.default /etc/kong.conf

vi /etc/kong.conf

edit belowe prameters :

database = postgres # Determines which of PostgreSQL or Cassandra
# this node will use as its datastore.
# Accepted values are postgres and
# cassandra.

pg_host = 127.0.0.1 # The PostgreSQL host to connect to.
pg_port = 5432 # The port to connect to.
pg_user = kong # The username to authenticate if required.
pg_password = kong # The password to authenticate if required.
pg_database = kong # The database name to connect to.

pg_ssl = off # Toggles client-server TLS connections
# between Kong and PostgreSQL.

pg_ssl_verify = off # Toggles server certificate verification if
# pg_ssl is enabled.
# See the lua_ssl_trusted_certificate
# setting to specify a certificate authority.

vim /var/lib/pgsql/9.4/data/pg_hba.conf

edit belowe prametrs :

TYPE DATABASE USER ADDRESS METHOD

"local" is for Unix domain socket connections only

local all all md5

IPv4 local connections:

host all all 127.0.0.1/32 md5

IPv6 local connections:

host all all ::1/128 md5

vim /var/lib/pgsql/9.4/data/postgresql.conf

edit belowe line :

listen_addresses = '*'

systemctl restart postgresql-9.4.service

For start kong run this command :

kong start

test :

curl 127.0.0.1:8001

All 3 comments

Did you properly configure your PostgreSQL server authentication in pg_hba.conf?

See http://stackoverflow.com/a/2942678/1437192

Hint: Kong will connect to your PostgreSQL server via an IPv4 connection. Therefore,

local kong kong 127.0.0.1/32 password

might be a suitable setting, maybe?

@thibaultcha
tnx man
my problem is Solved.i doing this config :

Install postgresql94 :
Install repo :

rpm -ivh http://yum.postgresql.org/9.4/redhat/rhel-7-x86_64/pgdg-centos94-9.4-1.noarch.rpm

yum install postgresql94-server postgresql94-contrib

/usr/pgsql-9.4/bin/postgresql94-setup initdb

systemctl enable postgresql-9.4.service

systemctl start postgresql-9.4.service


install kong :

wget -c https://github.com/Mashape/kong/releases/download/0.9.5/kong-0.9.5.el7.noarch.rpm

yum install epel-release

yum install kong-0.9.5.el7.noarch.rpm

Configure your database :

su - postgres

$ psql

postgres=# CREATE USER kong; CREATE DATABASE kong OWNER kong;

postgres=# ALTER USER kong WITH password 'kong';

cp /etc/kong/kong.conf.default /etc/kong.conf

vi /etc/kong.conf

edit belowe prameters :

database = postgres # Determines which of PostgreSQL or Cassandra
# this node will use as its datastore.
# Accepted values are postgres and
# cassandra.

pg_host = 127.0.0.1 # The PostgreSQL host to connect to.
pg_port = 5432 # The port to connect to.
pg_user = kong # The username to authenticate if required.
pg_password = kong # The password to authenticate if required.
pg_database = kong # The database name to connect to.

pg_ssl = off # Toggles client-server TLS connections
# between Kong and PostgreSQL.

pg_ssl_verify = off # Toggles server certificate verification if
# pg_ssl is enabled.
# See the lua_ssl_trusted_certificate
# setting to specify a certificate authority.

vim /var/lib/pgsql/9.4/data/pg_hba.conf

edit belowe prametrs :

TYPE DATABASE USER ADDRESS METHOD

"local" is for Unix domain socket connections only

local all all md5

IPv4 local connections:

host all all 127.0.0.1/32 md5

IPv6 local connections:

host all all ::1/128 md5

vim /var/lib/pgsql/9.4/data/postgresql.conf

edit belowe line :

listen_addresses = '*'

systemctl restart postgresql-9.4.service

For start kong run this command :

kong start

test :

curl 127.0.0.1:8001

Was this page helpful?
0 / 5 - 0 ratings