| 1 |
require 'strict'.on() |
| 2 |
fiber = require 'fiber' |
| 3 |
|
| 4 |
local instance_id = string.match(arg[1], '^%d+$') |
| 5 |
assert(instance_id, 'malformed instance id') |
| 6 |
|
| 7 |
local port = 3300 + instance_id |
| 8 |
local workdir = 'tnt'..instance_id |
| 9 |
|
| 10 |
box.cfg{ |
| 11 |
listen = '0.0.0.0:'..port, |
| 12 |
wal_mode = 'none', |
| 13 |
wal_dir = workdir, -- though WAL used here by default, see above. |
| 14 |
memtx_dir = workdir, |
| 15 |
readahead = 10 * 1024 * 1024, -- to keep up with benchmark load. |
| 16 |
net_msg_max = 1024, -- to keep up with benchmark load. |
| 17 |
} |
| 18 |
box.schema.user.grant('guest', 'super', nil, nil, { if_not_exists = true }) |
| 19 |
|
| 20 |
centrifuge = require 'centrifuge' |
| 21 |
|
| 22 |
box.once("centrifuge:schema:1", function() |
| 23 |
centrifuge.init({ |
| 24 |
presence_temporary=true |
| 25 |
}) |
| 26 |
end) |
| 27 |
|
| 28 |
if not fiber.self().storage.console then |
| 29 |
require'console'.start() |
| 30 |
os.exit() |
| 31 |
end |