CTDB中main loop怎么配置

发布时间:2022-01-05 09:15:02 作者:iii
来源:亿速云 阅读:151

本篇内容介绍了“CTDB中main loop怎么配置”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!

main_loop

kill -o daemon is still running
ping local daemon
if election_timeout out
get debug_level
get relevant tunables
get runstate
get recovery lock file from the server
get nodemap
flags
if self_ban
if stop banned frozen
Retrieve capabilities from all connected nodes
validate_recovery_master --> force_election
verify ip public ip {

ips.pnn == self && dont have ip
ips.pnn != self && have ip
} tell recmaster takeover_run


down here only run with recmaster
flags right
active nodes agree we are recmaster --> force_election get vnnmap
need recovery --> do_recovery
verify all active nodes not in recover mode --> do_recovery
hold recovery lock --> do_recovery
get remote_nodemaps --> do_recovery
num_lmasters
vnnmap->size != num_lmasters --> do_recovery
nodemap node also in vnnmap --> do_recovery
all nodes have same vnnmap
if need_takeover_run do_takeover_run


<span id="force_election"></span>

force_election

election_handler

rec = self ctdb = rec->ctdb
pnn == self out

ctdb_election_win

states
longest running
biggest pnn

release recover lock file
let recmaster = that


<h2 id="do_recovery"></h2> # do_recovery > we are rec > need_recovery = true > begin > self_ban > recover_lock_file F_SETLK 为 F_WRLCK > get list of all databases dbmap > create missing local db > create missing remote db > update use same lock files > [db_recovery_parallel](#db_recovery_parallel) > [do_takeover_run](#do_takeover_run) > send message reconfigured > need_recovery = false > end > wait rerecovery_timeout


<span id='db_recovery_parallel'></span>

db_recovery_parallel

envvar CTDB_RECOVERY_HELPER
dir CTDB_HELPER_BINDIR == /usr/libexec/ctdb/
file ctdb_recovery_helper
pipe libsocket
args[0] = fd[1]
args[1] = daemon.name = CTDB_SOCKET = /var/run/ctdb/ctdb.socket
args[2] = random !=1
exec /usr/libexec/ctdb/ctdb_recovery_helper
<log-fd> <output-fd> <ctdb-socket-path> <generation>
1 1 /var/run/ctdb/ctdbd.socket 2


<span id='do_takeover_run'></span>

do_takeover_run

is_in_progress done
begin
srvid = 0 pnn = -1
list_of_connected_nodes
disable takeover_runs 60s
ctdb_takeover_run
reenable takeover_runs
ok
end

<span id='ctdb_takeover_run'></span>

ctdb_takeover_run

ipalloc_state_init

三种算法 ipalloc_lcp2 ==> 默认
ipalloc_deterministic ==> pnn = i % numnodes ipalloc_nondeterministic ==> min以pnn=0为基准,轮询 已有ip<min的则可收ip

<span id='ipalloc_lcp2'></span>

ipalloc_lcp2

unassign_unsuitable_ips 不匹配的ip的pnn = -1
lcp2_init
lcp2_allocate_unassigned

^运算 计算出从高到低不同=distance ipv4 32 + 32 + dis + 32 = 0 ~ 128 sum = ip 到其他每个ip distance平方和 minnode || mindstdsum rebalance_candidates
lcp2_failback
均衡所有lcp2_imbalances

“CTDB中main loop怎么配置”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注亿速云网站,小编将为大家输出更多高质量的实用文章!

推荐阅读:
  1. 在Gluster上使用CTDB和Samba
  2. JavaScript中Event Loop指的是什么

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

ctdb

上一篇:Snagit 2020 for mac工具有什么用

下一篇:中文预训练模型ERNIE该如何使用

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》