diff --git a/kong-0.7.0-0.rockspec b/kong-0.7.0-0.rockspec index 89d08864525..98749125ca5 100644 --- a/kong-0.7.0-0.rockspec +++ b/kong-0.7.0-0.rockspec @@ -19,7 +19,7 @@ dependencies = { "yaml ~> 1.1.2-1", "lapis ~> 1.3.1-1", "stringy ~> 0.4-1", - "lua-cassandra ~> 0.5.0", + "lua-cassandra ~> 0.5.1", "multipart ~> 0.2-1", "lua-path ~> 0.2.3-1", "lua-cjson ~> 2.1.0-1", diff --git a/kong.yml b/kong.yml index 7c5e6ddf7d6..2ff3fe6d010 100644 --- a/kong.yml +++ b/kong.yml @@ -99,6 +99,8 @@ # contact_points: # - "127.0.0.1:9042" + # port: 9042 + ###### ## Name of the keyspace used by Kong. Will be created if it does not exist. # keyspace: kong diff --git a/kong/dao/cassandra/factory.lua b/kong/dao/cassandra/factory.lua index 4fb81708830..e8c7f976fed 100644 --- a/kong/dao/cassandra/factory.lua +++ b/kong/dao/cassandra/factory.lua @@ -114,6 +114,9 @@ function CassandraFactory:get_session_options() prepared_shm = "cassandra_prepared", contact_points = self.properties.contact_points, keyspace = self.properties.keyspace, + protocol_options = { + default_port = self.properties.port + }, query_options = { prepare = true }, diff --git a/kong/tools/config_defaults.lua b/kong/tools/config_defaults.lua index 168fd9f72c3..37780c1a03b 100644 --- a/kong/tools/config_defaults.lua +++ b/kong/tools/config_defaults.lua @@ -38,6 +38,7 @@ return { type = "table", content = { ["contact_points"] = {type = "array", default = {"127.0.0.1:9042"}}, + ["port"] = {type = "number", default = 9042}, ["keyspace"] = {type = "string", default = "kong"}, ["timeout"] = {type = "number", default = 5000}, ["replication_strategy"] = {type = "string", default = "SimpleStrategy", enum = {"SimpleStrategy", "NetworkTopologyStrategy"}},