diff --git a/check_process b/check_process index 4b75a1f..0525f7b 100644 --- a/check_process +++ b/check_process @@ -3,6 +3,7 @@ domain="domain.tld" is_public=1 node_type="client" + bootstrap_expect="1" server_ip="192.168.1.100" ; Checks pkg_linter=1 @@ -22,6 +23,7 @@ domain="domain.tld" is_public=1 node_type="server" + bootstrap_expect="1" server_ip="none..." ; Checks pkg_linter=1 diff --git a/conf/server.hcl b/conf/server.hcl index 2b80785..0f937b5 100644 --- a/conf/server.hcl +++ b/conf/server.hcl @@ -8,7 +8,7 @@ server { # This is an integer representing the number of server nodes to wait for before bootstrapping. It is most # common to use the odd-numbered integers 3 or 5 for this value, depending on the cluster size. A value of # 1 does not provide any fault tolerance and is not recommended for production use cases. - bootstrap_expect = 1 + bootstrap_expect = __BOOTSTRAP_EXPECT__ # This is the data directory used for server-specific data, including the replicated log. By default, this # directory lives inside of the data_dir in the "server" sub-path. diff --git a/manifest.json b/manifest.json index 5e0561f..6581c06 100644 --- a/manifest.json +++ b/manifest.json @@ -45,6 +45,18 @@ "choices": ["server", "client"], "default": "server" }, + { + "name": "bootstrap_expect", + "type": "string", + "ask": { + "en": "[Server only] How many server nodes to wait for before bootstrapping ?" + }, + "choices": ["1", "3", "5", "7", "9"], + "default": "1", + "help": { + "en": "For production, it's recommanded to have 3 to 5 server nodes." + } + }, { "name": "server_ip", "type": "string", diff --git a/scripts/install b/scripts/install index fb436dc..686e9a2 100755 --- a/scripts/install +++ b/scripts/install @@ -28,6 +28,7 @@ domain=$YNH_APP_ARG_DOMAIN path_url="/" is_public=$YNH_APP_ARG_IS_PUBLIC node_type=$YNH_APP_ARG_NODE_TYPE +bootstrap_expect=$YNH_APP_ARG_BOOTSTRAP_EXPECT server_ip=$YNH_APP_ARG_SERVER_IP app=$YNH_APP_INSTANCE_NAME @@ -52,6 +53,7 @@ ynh_script_progression --message="Storing installation settings..." ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url ynh_app_setting_set --app=$app --key=node_type --value=$node_type +ynh_app_setting_set --app=$app --key=bootstrap_expect --value=$bootstrap_expect ynh_app_setting_set --app=$app --key=server_ip --value=$server_ip ynh_app_setting_set --app=$app --key=lxc_bridge --value=$lxc_bridge ynh_app_setting_set --app=$app --key=plage_ip --value=$plage_ip diff --git a/scripts/upgrade b/scripts/upgrade index 9fcf541..e54f780 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -23,6 +23,7 @@ config_path=$(ynh_app_setting_get --app=$app --key=config_path) datadir=$(ynh_app_setting_get --app=$app --key=datadir) node_type=$(ynh_app_setting_get --app=$app --key=node_type) server_ip=$(ynh_app_setting_get --app=$app --key=server_ip) +bootstrap_expect=$(ynh_app_setting_get --app=$app --key=bootstrap_expect) http_port=$(ynh_app_setting_get --app=$app --key=http_port) rpc_port=$(ynh_app_setting_get --app=$app --key=rpc_port) serf_port=$(ynh_app_setting_get --app=$app --key=serf_port)