您现在的位置是:主页 > 数据库技术 > 数据库技术

CTDB中main loop怎么配置

IDCBT2022-01-05服务器技术人已围观

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

本篇内容介绍了“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

标签:

很赞哦! ()

本栏推荐