Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Incubator Pegasus
提交
b3a941cb
Incubator Pegasus
项目概览
apache
/
Incubator Pegasus
通知
9
Star
5
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Incubator Pegasus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
b3a941cb
编写于
8月 20, 2018
作者:
Q
QinZuoyan
提交者:
GitHub
8月 20, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
scripts: improve pegasus_rolling_update.sh; fix shell (#167)
上级
64766397
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
33 addition
and
22 deletion
+33
-22
scripts/pegasus_rolling_update.sh
scripts/pegasus_rolling_update.sh
+30
-18
src/shell/commands.h
src/shell/commands.h
+3
-4
未找到文件。
scripts/pegasus_rolling_update.sh
浏览文件 @
b3a941cb
...
...
@@ -124,58 +124,70 @@ do
echo
"ERROR: set lb.add_secondary_max_count_for_one_node to 0 failed"
exit
1
fi
echo
echo
"Migrating primary replicas out of node..."
./run.sh migrate_node
-c
$meta_list
-n
$node
-t
run &>/tmp/
$UID
.
$PID
.pegasus.rolling_update.migrate_node
echo
"Wait [
$node
] to migrate done..."
echo
"Refer to /tmp/
$UID
.
$PID
.pegasus.rolling_update.migrate_node for details"
sleeped
=
0
while
true
do
if
[
$((
sleeped%10
))
-eq
0
]
;
then
./run.sh migrate_node
-c
$meta_list
-n
$node
-t
run &>/tmp/
$UID
.
$PID
.pegasus.rolling_update.migrate_node
echo
"Send migrate propose, refer to /tmp/
$UID
.
$PID
.pegasus.rolling_update.migrate_node for details"
fi
pri_count
=
`
echo
'nodes -d'
| ./run.sh shell
--cluster
$meta_list
|
grep
$node
|
awk
'{print $4}'
`
if
[
$pri_count
-eq
0
]
;
then
echo
"Migrate done."
break
elif
[
$sleeped
-gt
28
]
;
then
echo
"Downgrade timeout."
break
else
echo
"Still
$pri_count
primary replicas left on
$node
"
sleep
1
sleeped
=
$((
sleeped+1
))
fi
done
echo
sleep
1
echo
"Downgrading replicas on node..."
./run.sh downgrade_node
-c
$meta_list
-n
$node
-t
run &>/tmp/
$UID
.
$PID
.pegasus.rolling_update.downgrade_node
echo
"Wait [
$node
] to downgrade done..."
echo
"Refer to /tmp/
$UID
.
$PID
.pegasus.rolling_update.downgrade_node for details"
sleeped
=
0
while
true
do
if
[
$((
sleeped%10
))
-eq
0
]
;
then
./run.sh downgrade_node
-c
$meta_list
-n
$node
-t
run &>/tmp/
$UID
.
$PID
.pegasus.rolling_update.downgrade_node
echo
"Send downgrade propose, refer to /tmp/
$UID
.
$PID
.pegasus.rolling_update.downgrade_node for details"
fi
rep_count
=
`
echo
'nodes -d'
| ./run.sh shell
--cluster
$meta_list
|
grep
$node
|
awk
'{print $3}'
`
if
[
$rep_count
-eq
0
]
;
then
echo
"Downgrade done."
break
elif
[
$sleeped
-gt
28
]
;
then
echo
"Downgrade timeout."
break
else
echo
"Still
$rep_count
replicas left on
$node
"
sleep
1
sleeped
=
$((
sleeped+1
))
fi
done
echo
sleep
1
echo
"Send kill_partition commands to node..."
grep
'^propose '
/tmp/
$UID
.
$PID
.pegasus.rolling_update.downgrade_node
>
/tmp/
$UID
.
$PID
.pegasus.rolling_update.downgrade_node.propose
while
read
line2
do
gpid
=
`
echo
$line2
|
awk
'{print $3}'
|
sed
's/\./ /'
`
echo
"remote_command -l
$node
replica.kill_partition
$gpid
"
| ./run.sh shell
--cluster
$meta_list
&>/tmp/
$UID
.
$PID
.pegasus.rolling_update.kill_partition
done
</tmp/
$UID
.
$PID
.pegasus.rolling_update.downgrade_node.propose
echo
"Sent to
`
cat
/tmp/
$UID
.
$PID
.pegasus.rolling_update.downgrade_node.propose |
wc
-l
`
partitions."
echo
sleep
1
echo
"Checking replicas closed on node..."
sleeped
=
0
while
true
do
if
[
$((
sleeped%10
))
-eq
0
]
;
then
echo
"Send kill_partition commands to node..."
grep
'^propose '
/tmp/
$UID
.
$PID
.pegasus.rolling_update.downgrade_node
>
/tmp/
$UID
.
$PID
.pegasus.rolling_update.downgrade_node.propose
while
read
line2
do
gpid
=
`
echo
$line2
|
awk
'{print $3}'
|
sed
's/\./ /'
`
echo
"remote_command -l
$node
replica.kill_partition
$gpid
"
| ./run.sh shell
--cluster
$meta_list
&>/tmp/
$UID
.
$PID
.pegasus.rolling_update.kill_partition
done
</tmp/
$UID
.
$PID
.pegasus.rolling_update.downgrade_node.propose
echo
"Sent to
`
cat
/tmp/
$UID
.
$PID
.pegasus.rolling_update.downgrade_node.propose |
wc
-l
`
partitions."
fi
echo
"remote_command -l
$node
perf-counters '.*replica(Count)'"
| ./run.sh shell
--cluster
$meta_list
&>/tmp/
$UID
.
$PID
.pegasus.rolling_update.replica_count_perf_counters
serving_count
=
`
grep
-o
'replica_stub.replica(Count)","type":"NUMBER","value":[0-9]*'
/tmp/
$UID
.
$PID
.pegasus.rolling_update.replica_count_perf_counters |
grep
-o
'[0-9]*$'
`
opening_count
=
`
grep
-o
'replica_stub.opening.replica(Count)","type":"NUMBER","value":[0-9]*'
/tmp/
$UID
.
$PID
.pegasus.rolling_update.replica_count_perf_counters |
grep
-o
'[0-9]*$'
`
...
...
@@ -188,7 +200,7 @@ do
if
[
$rep_count
-eq
0
]
;
then
echo
"Close done."
break
elif
[
$sleeped
-gt
2
0
]
;
then
elif
[
$sleeped
-gt
2
8
]
;
then
echo
"Close timeout."
break
else
...
...
src/shell/commands.h
浏览文件 @
b3a941cb
...
...
@@ -3654,10 +3654,9 @@ inline bool app_stat(command_executor *e, shell_context *sc, arguments args)
<<
std
::
setw
(
w
)
<<
std
::
right
<<
"INCR"
<<
std
::
setw
(
w
)
<<
std
::
right
<<
"CAS"
<<
std
::
setw
(
w
)
<<
std
::
right
<<
"CAM"
<<
std
::
setw
(
w
)
<<
std
::
right
<<
"SCAN"
;
if
(
!
only_qps
)
{
out
<<
std
::
setw
(
w
)
<<
std
::
right
<<
"storage_mb"
<<
std
::
setw
(
w
)
<<
std
::
right
<<
"file_count"
<<
std
::
setw
(
w
)
<<
std
::
right
<<
"expired"
<<
std
::
setw
(
w
)
<<
std
::
right
<<
"filtered"
<<
std
::
setw
(
w
)
<<
std
::
right
<<
"abnormal"
<<
std
::
setw
(
w
)
<<
std
::
right
<<
"file_mb"
<<
std
::
setw
(
w
)
<<
std
::
right
<<
"file_num"
;
out
<<
std
::
setw
(
w
)
<<
std
::
right
<<
"expired"
<<
std
::
setw
(
w
)
<<
std
::
right
<<
"filtered"
<<
std
::
setw
(
w
)
<<
std
::
right
<<
"abnormal"
<<
std
::
setw
(
w
)
<<
std
::
right
<<
"file_mb"
<<
std
::
setw
(
w
)
<<
std
::
right
<<
"file_num"
;
}
out
<<
std
::
endl
;
rows
.
resize
(
rows
.
size
()
+
1
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录