我正在尝试使用ipfs-cluster进行一些实验,我注意到的是,当我首先启动主节点,然后使用以下方法将从节点连接到该主节点时,群集网络(Master_N0,Slave_N1,Slave_N2)工作正常--bootstrap。 问题是,如果由于某种原因主节点发生故障,则其所有从节点(Slave_N1,Slave_N2)也会与群集网络断开连接。 所以我只想知道有什么办法,如果我的主节点(Master_N0)发生故障,那么它将自动(带有一些标志或脚本)将一个从节点(Slave_N1或Slave_N2)作为主节点(因此,群集-网络将保持不变,无论任何一个出现故障。
这是我主人的 $ HOME / .ipfs-cluster / service.json 文件
{
"cluster": {
"id": "Qme1gDJ1VuLN7UZPbhk72Jwh2apBgqM2RakcQPV6XPkvn",
"peername": "Master-Node",
"private_key": "CAASpgkwggSRuxfFuSJD06UoxS7D+mctCAoiODsvmYUWOb5+U+I7P0QBG1ZYDBv67Jw97NEI+nbL1vLMQDUlwKBgDm4YatGm3IzgdGs1s1lJVgcNvuWPeX70ryFT2mMIAeIHE2pnXSTW5sVEU1ijgWQnj3K3G31g7bHEK7BUiZB+qcHHkab8hfjJNw3TQg5Cb9dyx3nKoWvAyKZ4REVshv3fYswL0npY5Ol+tfqazlSdNsaNvBLzfE3r4nQbQlCihgtAoGAamsv1rGmfOEn8MX81CVm7Sm+/oaFMKkt+Db1Hqgd1DxMbzVxlR/wxvi5GpkjbnD6IsEXJh8BX2UzYHoTJmekICdmgd626fdXEMBxzELTJIzv49NROID8P+UZTYB/JfezttmFq4YNcBxOZNXnqrsVHKQR2lC1ZFlD2y1cEBLr2XcCgYBcqSzMCjZkeGwFJUsUy8J20OjZ7FXiBp/bWCr0bVCQhvUEL7AzwL+ef5Iuvw5DbTwtdNdQgfGs5bNHz75FbvoXMAGhSnWi540AjIaICtJ8U0WzFRMU3J89g...,
"secret": "ece81c477e07d89fd7bf511314e24349aecfd46dc4a7a2f582c112f7a8ceda0",
"leave_on_shutdown": false,
"listen_multiaddress": "/ip4/0.0.0.0/tcp/9096",
"state_sync_interval": "10m0s",
"ipfs_sync_interval": "2m10s",
"replication_factor_min": -1,
"replication_factor_max": -1,
"monitor_ping_interval": "15s",
"peer_watch_interval": "5s",
"disable_repinning": false
},
"consensus": {
"raft": {
"init_peerset": [],
"wait_for_leader_timeout": "15s",
"network_timeout": "10s",
"commit_retries": 1,
"commit_retry_delay": "200ms",
"backups_rotate": 6,
"heartbeat_timeout": "1s",
"election_timeout": "1s",
"commit_timeout": "50ms",
"max_append_entries": 64,
"trailing_logs": 10240,
"snapshot_interval": "2m0s",
"snapshot_threshold": 8192,
"leader_lease_timeout": "500ms"
}
},
"api": {
"ipfsproxy": {
"listen_multiaddress": "/ip4/127.0.0.1/tcp/9095",
"node_multiaddress": "/ip4/127.0.0.1/tcp/5001",
"read_timeout": "0s",
"read_header_timeout": "5s",
"write_timeout": "0s",
"idle_timeout": "1m0s",
"extract_headers_path": "/api/v0/version",
"extract_headers_ttl": "5m0s"
},
"restapi": {
"http_listen_multiaddress": "/ip4/127.0.0.1/tcp/9094",
"read_timeout": "0s",
"read_header_timeout": "5s",
"write_timeout": "0s",
"idle_timeout": "2m0s",
"basic_auth_credentials": null,
"headers": {},
"cors_allowed_origins": [
"*"
],
"cors_allowed_methods": [
"GET"
],
"cors_allowed_headers": [],
"cors_exposed_headers": [
"Content-Type",
"X-Stream-Output",
"X-Chunked-Output",
"X-Content-Length"
],
"cors_allow_credentials": true,
"cors_max_age": "0s"
}
},
"ipfs_connector": {
"ipfshttp": {
"node_multiaddress": "/ip4/127.0.0.1/tcp/5001",
"connect_swarms_delay": "30s",
"pin_method": "refs",
"ipfs_request_timeout": "5m0s",
"pin_timeout": "24h0m0s",
"unpin_timeout": "3h0m0s"
}
},
"pin_tracker": {
"maptracker": {
"max_pin_queue_size": 50000,
"concurrent_pins": 10
},
"stateless": {
"max_pin_queue_size": 50000,
"concurrent_pins": 10
}
},
"monitor": {
"monbasic": {
"check_interval": "15s"
},
"pubsubmon": {
"check_interval": "15s"
}
},
"informer": {
"disk": {
"metric_ttl": "30s",
"metric_type": "freespace"
},
"numpin": {
"metric_ttl": "10s"
}
},
"observations": {
"metrics": {
"enable_stats": false,
"prometheus_endpoint": "/ip4/0.0.0.0/tcp/8888",
"reporting_interval": "2s"
},
"tracing": {
"enable_tracing": false,
"jaeger_agent_endpoint": "/ip4/0.0.0.0/udp/6831",
"sampling_prob": 0.3,
"service_name": "cluster-daemon"
}
}
}