99
1010import redis
1111
12- from redisbench_admin .utils .utils import wait_for_conn , redis_server_config_module_part
12+ from redisbench_admin .utils .utils import (
13+ wait_for_conn ,
14+ redis_server_config_module_part ,
15+ generate_common_server_args ,
16+ )
1317
1418
1519def spin_up_local_redis_cluster (
@@ -22,6 +26,7 @@ def spin_up_local_redis_cluster(
2226 configuration_parameters = None ,
2327 dataset_load_timeout_secs = 60 ,
2428 modules_configuration_parameters_map = {},
29+ redis_7 = True ,
2530):
2631 redis_processes = []
2732 redis_conns = []
@@ -41,6 +46,9 @@ def spin_up_local_redis_cluster(
4146 configuration_parameters ,
4247 "no" ,
4348 modules_configuration_parameters_map ,
49+ None ,
50+ "yes" ,
51+ redis_7 ,
4452 )
4553
4654 logging .info (
@@ -147,41 +155,25 @@ def generate_cluster_redis_server_args(
147155 daemonize = "yes" ,
148156 modules_configuration_parameters_map = {},
149157 logname_prefix = None ,
158+ enable_debug_command = "yes" ,
159+ enable_redis_7_config_directives = False ,
150160):
151161 if logname_prefix is None :
152162 logname_prefix = ""
153163 logfile = "{}cluster-node-port-{}.log" .format (logname_prefix , port )
154- if type ( binary ) == list :
155- command = binary
156- else :
157- command = [ binary ]
158- # start redis-server
164+ dbfilename = get_cluster_dbfilename ( port )
165+
166+ command = generate_common_server_args (
167+ binary , daemonize , dbdir , dbfilename , enable_debug_command , ip , logfile , port
168+ )
159169 command .extend (
160170 [
161- "--appendonly" ,
162- "no" ,
163- "--logfile" ,
164- logfile ,
165171 "--cluster-enabled" ,
166172 "yes" ,
167- "--daemonize" ,
168- daemonize ,
169- "--dbfilename" ,
170- get_cluster_dbfilename (port ),
171- "--protected-mode" ,
172- "no" ,
173- "--bind" ,
174- "{}" .format (ip ),
175173 "--cluster-config-file" ,
176174 "cluster-node-port-{}.config" .format (port ),
177- "--save" ,
178- "" ,
179175 "--cluster-announce-ip" ,
180176 "{}" .format (ip ),
181- "--port" ,
182- "{}" .format (port ),
183- "--dir" ,
184- dbdir ,
185177 ]
186178 )
187179 if configuration_parameters is not None :
0 commit comments