if main_host then
local function sort_by_main_host(a, b)
if a.host == main_host and b.host ~= main_host then
return true
else
return false
end
end
tbl_sort(slaves, sort_by_main_host)
else
-- Put any slaves on 127.0.0.1 at the front
tbl_sort(slaves, sort_by_localhost)
end
AND can choose master or slave to connect via command ?
AND can choose master or slave to connect via command ?