forked from vitalif/vitastor
Change default etcd_mon_ttl
parent
cc76e6876b
commit
d2b43cb118
|
@ -1,7 +1,7 @@
|
||||||
- name: etcd_mon_ttl
|
- name: etcd_mon_ttl
|
||||||
type: sec
|
type: sec
|
||||||
min: 10
|
min: 5
|
||||||
default: 30
|
default: 1
|
||||||
info: Monitor etcd lease refresh interval in seconds
|
info: Monitor etcd lease refresh interval in seconds
|
||||||
info_ru: Интервал обновления etcd резервации (lease) монитором
|
info_ru: Интервал обновления etcd резервации (lease) монитором
|
||||||
- name: etcd_mon_timeout
|
- name: etcd_mon_timeout
|
||||||
|
|
10
mon/mon.js
10
mon/mon.js
|
@ -55,7 +55,7 @@ const etcd_tree = {
|
||||||
// etcd connection - configurable online
|
// etcd connection - configurable online
|
||||||
etcd_address: "10.0.115.10:2379/v3",
|
etcd_address: "10.0.115.10:2379/v3",
|
||||||
// mon
|
// mon
|
||||||
etcd_mon_ttl: 30, // min: 10
|
etcd_mon_ttl: 5, // min: 1
|
||||||
etcd_mon_timeout: 1000, // ms. min: 0
|
etcd_mon_timeout: 1000, // ms. min: 0
|
||||||
etcd_mon_retries: 5, // min: 0
|
etcd_mon_retries: 5, // min: 0
|
||||||
mon_change_timeout: 1000, // ms. min: 100
|
mon_change_timeout: 1000, // ms. min: 100
|
||||||
|
@ -480,10 +480,10 @@ class Mon
|
||||||
|
|
||||||
check_config()
|
check_config()
|
||||||
{
|
{
|
||||||
this.config.etcd_mon_ttl = Number(this.config.etcd_mon_ttl) || 30;
|
this.config.etcd_mon_ttl = Number(this.config.etcd_mon_ttl) || 5;
|
||||||
if (this.config.etcd_mon_ttl < 10)
|
if (this.config.etcd_mon_ttl < 1)
|
||||||
{
|
{
|
||||||
this.config.etcd_mon_ttl = 10;
|
this.config.etcd_mon_ttl = 1;
|
||||||
}
|
}
|
||||||
this.config.etcd_mon_timeout = Number(this.config.etcd_mon_timeout) || 0;
|
this.config.etcd_mon_timeout = Number(this.config.etcd_mon_timeout) || 0;
|
||||||
if (this.config.etcd_mon_timeout <= 0)
|
if (this.config.etcd_mon_timeout <= 0)
|
||||||
|
@ -794,7 +794,7 @@ class Mon
|
||||||
{
|
{
|
||||||
this.failconnect('Lease expired');
|
this.failconnect('Lease expired');
|
||||||
}
|
}
|
||||||
}, this.config.etcd_mon_timeout);
|
}, this.config.etcd_mon_ttl*1000);
|
||||||
if (!this.signals_set)
|
if (!this.signals_set)
|
||||||
{
|
{
|
||||||
process.on('SIGINT', this.on_stop_cb);
|
process.on('SIGINT', this.on_stop_cb);
|
||||||
|
|
Loading…
Reference in New Issue