mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-20 08:25:50 +08:00
集群节点暂时
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
<p onclick="redisStatus($('.plugin_version').attr('version'));">负载状态</p>
|
||||
<p onclick="replStatus($('.plugin_version').attr('version'));">复制状态</p>
|
||||
<p onclick="clusterStatus($('.plugin_version').attr('version'));">集群状态</p>
|
||||
<p onclick="clusterNodes($('.plugin_version').attr('version'));">集群节点</p>
|
||||
<p onclick="pluginLogs('redis','','run_log');">日志</p>
|
||||
</div>
|
||||
<div class="bt-w-con pd15">
|
||||
|
||||
@@ -393,6 +393,21 @@ def clusterInfo():
|
||||
|
||||
return mw.getJson(result)
|
||||
|
||||
def clusterNodes():
|
||||
s = status()
|
||||
if s == 'stop':
|
||||
return mw.returnJson(False, '未启动')
|
||||
|
||||
cmd = getRedisCmd()
|
||||
cmd = cmd + 'cluster nodes'
|
||||
|
||||
# print(cmd)
|
||||
data = mw.execShell(cmd)[0]
|
||||
# print(data)
|
||||
|
||||
data = data.strip().split("\n")
|
||||
return mw.getJson(data)
|
||||
|
||||
def initdStatus():
|
||||
current_os = mw.getOs()
|
||||
if current_os == 'darwin':
|
||||
@@ -539,6 +554,8 @@ if __name__ == "__main__":
|
||||
print(infoReplication())
|
||||
elif func == 'cluster_info':
|
||||
print(clusterInfo())
|
||||
elif func == 'cluster_nodes':
|
||||
print(clusterNodes())
|
||||
elif func == 'conf':
|
||||
print(getConf())
|
||||
elif func == 'run_log':
|
||||
|
||||
@@ -165,8 +165,8 @@ function clusterStatus(version){
|
||||
'cluster_stats_messages_received':'接收',
|
||||
'cluster_current_epoch':'集群当前epoch',
|
||||
'cluster_my_epoch':'当前我的epoch',
|
||||
'cluster_slots_pfail':'处于PFAIL状态的节点槽数',
|
||||
'cluster_slots_fail':'处于FAIL状态的节点槽数',
|
||||
'cluster_slots_pfail':'处于PFAIL状态的槽数',
|
||||
'cluster_slots_fail':'处于FAIL状态的槽数',
|
||||
'total_cluster_links_buffer_limit_exceeded':'超出缓冲区总数',
|
||||
}
|
||||
|
||||
@@ -196,6 +196,35 @@ function clusterStatus(version){
|
||||
$(".soft-man-con").html(con);
|
||||
});
|
||||
}
|
||||
|
||||
function clusterNodes(version){
|
||||
redisPost('cluster_nodes', version, {},function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
|
||||
if ('status' in rdata && !rdata.status){
|
||||
layer.msg(rdata.msg,{icon:0,time:2000,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
|
||||
// console.log(rdata);
|
||||
var tbody_text = '';
|
||||
for (k in rdata){
|
||||
tbody_text += '<tr><td>'+ rdata[k] +'</td></tr>';
|
||||
}
|
||||
|
||||
if (tbody_text == ''){
|
||||
tbody_text += '<tr><td style="text-align:center;">无数据/未设置集群</td></tr>';
|
||||
}
|
||||
|
||||
var con = '<div class="divtable">\
|
||||
<table class="table table-hover table-bordered" style="width: 490px;">\
|
||||
<thead><th style="width:80px;text-align:center;">节点信息</th></thead>\
|
||||
<tbody>'+tbody_text+'<tbody>\
|
||||
</table></div>';
|
||||
$(".soft-man-con").html(con);
|
||||
});
|
||||
}
|
||||
|
||||
//redis状态 end
|
||||
|
||||
//配置修改
|
||||
|
||||
@@ -10,7 +10,6 @@ tcp-keepalive 0
|
||||
|
||||
bind 127.0.0.1
|
||||
port 6379
|
||||
requirepass {$REDIS_PASS}
|
||||
|
||||
################################ SNAPSHOTTING #################################
|
||||
|
||||
|
||||
Reference in New Issue
Block a user