Skip to content

Commit e3ff285

Browse files
committed
Draft for master discovery
1 parent bec9f72 commit e3ff285

File tree

10 files changed

+1572
-4
lines changed

10 files changed

+1572
-4
lines changed

connection_pool/config.lua

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
local nodes_load = require("config_load_nodes")
2+
3+
-- Do not set listen for now so connector won't be
4+
-- able to send requests until everything is configured.
5+
box.cfg{
6+
work_dir = os.getenv("TEST_TNT_WORK_DIR"),
7+
}
8+
9+
-- Function to call for getting address list, part of tarantool/multi API.
10+
local get_cluster_nodes = nodes_load.get_cluster_nodes
11+
rawset(_G, 'get_cluster_nodes', get_cluster_nodes)
12+
13+
box.once("init", function()
14+
box.schema.user.create('test', { password = 'test' })
15+
box.schema.user.grant('test', 'read,write,execute', 'universe')
16+
end)
17+
18+
-- Set listen only when every other thing is configured.
19+
box.cfg{
20+
listen = os.getenv("TEST_TNT_LISTEN"),
21+
}

connection_pool/config_load_nodes.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
local function get_cluster_nodes()
2+
return { 'localhost:3013', 'localhost:3014' }
3+
end
4+
5+
return {
6+
get_cluster_nodes = get_cluster_nodes
7+
}

0 commit comments

Comments
 (0)