Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Turbo码先生
redis
提交
615eae2c
R
redis
项目概览
Turbo码先生
/
redis
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
redis
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
615eae2c
编写于
4月 28, 2020
作者:
S
Salvatore Sanfilippo
提交者:
GitHub
4月 28, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #6942 from itamarhaber/clustrutil-binpath
Adds `BIN_PATH` to create-cluster
上级
4d4c8c8a
d25709cd
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
8 addition
and
6 deletion
+8
-6
utils/create-cluster/create-cluster
utils/create-cluster/create-cluster
+8
-6
未找到文件。
utils/create-cluster/create-cluster
浏览文件 @
615eae2c
#!/bin/bash
#!/bin/bash
# Settings
# Settings
BIN_PATH
=
"../../"
CLUSTER_HOST
=
127.0.0.1
CLUSTER_HOST
=
127.0.0.1
PORT
=
30000
PORT
=
30000
TIMEOUT
=
2000
TIMEOUT
=
2000
...
@@ -25,7 +26,7 @@ then
...
@@ -25,7 +26,7 @@ then
while
[
$((
PORT < ENDPORT
))
!=
"0"
]
;
do
while
[
$((
PORT < ENDPORT
))
!=
"0"
]
;
do
PORT
=
$((
PORT+1
))
PORT
=
$((
PORT+1
))
echo
"Starting
$PORT
"
echo
"Starting
$PORT
"
../../src
/redis-server
--port
$PORT
--protected-mode
$PROTECTED_MODE
--cluster-enabled
yes
--cluster-config-file
nodes-
${
PORT
}
.conf
--cluster-node-timeout
$TIMEOUT
--appendonly
yes
--appendfilename
appendonly-
${
PORT
}
.aof
--dbfilename
dump-
${
PORT
}
.rdb
--logfile
${
PORT
}
.log
--daemonize
yes
${
ADDITIONAL_OPTIONS
}
$BIN_PATH
/redis-server
--port
$PORT
--protected-mode
$PROTECTED_MODE
--cluster-enabled
yes
--cluster-config-file
nodes-
${
PORT
}
.conf
--cluster-node-timeout
$TIMEOUT
--appendonly
yes
--appendfilename
appendonly-
${
PORT
}
.aof
--dbfilename
dump-
${
PORT
}
.rdb
--logfile
${
PORT
}
.log
--daemonize
yes
${
ADDITIONAL_OPTIONS
}
done
done
exit
0
exit
0
fi
fi
...
@@ -37,7 +38,7 @@ then
...
@@ -37,7 +38,7 @@ then
PORT
=
$((
PORT+1
))
PORT
=
$((
PORT+1
))
HOSTS
=
"
$HOSTS
$CLUSTER_HOST
:
$PORT
"
HOSTS
=
"
$HOSTS
$CLUSTER_HOST
:
$PORT
"
done
done
../../src
/redis-cli
--cluster
create
$HOSTS
--cluster-replicas
$REPLICAS
$BIN_PATH
/redis-cli
--cluster
create
$HOSTS
--cluster-replicas
$REPLICAS
exit
0
exit
0
fi
fi
...
@@ -46,7 +47,7 @@ then
...
@@ -46,7 +47,7 @@ then
while
[
$((
PORT < ENDPORT
))
!=
"0"
]
;
do
while
[
$((
PORT < ENDPORT
))
!=
"0"
]
;
do
PORT
=
$((
PORT+1
))
PORT
=
$((
PORT+1
))
echo
"Stopping
$PORT
"
echo
"Stopping
$PORT
"
../../src
/redis-cli
-p
$PORT
shutdown nosave
$BIN_PATH
/redis-cli
-p
$PORT
shutdown nosave
done
done
exit
0
exit
0
fi
fi
...
@@ -57,7 +58,7 @@ then
...
@@ -57,7 +58,7 @@ then
while
[
1
]
;
do
while
[
1
]
;
do
clear
clear
date
date
../../src
/redis-cli
-p
$PORT
cluster nodes |
head
-30
$BIN_PATH
/redis-cli
-p
$PORT
cluster nodes |
head
-30
sleep
1
sleep
1
done
done
exit
0
exit
0
...
@@ -81,7 +82,7 @@ if [ "$1" == "call" ]
...
@@ -81,7 +82,7 @@ if [ "$1" == "call" ]
then
then
while
[
$((
PORT < ENDPORT
))
!=
"0"
]
;
do
while
[
$((
PORT < ENDPORT
))
!=
"0"
]
;
do
PORT
=
$((
PORT+1
))
PORT
=
$((
PORT+1
))
../../src
/redis-cli
-p
$PORT
$2
$3
$4
$5
$6
$7
$8
$9
$BIN_PATH
/redis-cli
-p
$PORT
$2
$3
$4
$5
$6
$7
$8
$9
done
done
exit
0
exit
0
fi
fi
...
@@ -101,7 +102,7 @@ then
...
@@ -101,7 +102,7 @@ then
exit
0
exit
0
fi
fi
echo
"Usage:
$0
[start|create|stop|watch|tail|clean]"
echo
"Usage:
$0
[start|create|stop|watch|tail|clean
|call
]"
echo
"start -- Launch Redis Cluster instances."
echo
"start -- Launch Redis Cluster instances."
echo
"create -- Create a cluster using redis-cli --cluster create."
echo
"create -- Create a cluster using redis-cli --cluster create."
echo
"stop -- Stop Redis Cluster instances."
echo
"stop -- Stop Redis Cluster instances."
...
@@ -110,3 +111,4 @@ echo "tail <id> -- Run tail -f of instance at base port + ID."
...
@@ -110,3 +111,4 @@ echo "tail <id> -- Run tail -f of instance at base port + ID."
echo
"tailall -- Run tail -f for all the log files at once."
echo
"tailall -- Run tail -f for all the log files at once."
echo
"clean -- Remove all instances data, logs, configs."
echo
"clean -- Remove all instances data, logs, configs."
echo
"clean-logs -- Remove just instances logs."
echo
"clean-logs -- Remove just instances logs."
echo
"call <cmd> -- Call a command (up to 7 arguments) on all nodes."
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录