diff --git a/docs/source/deployment/mooncake-store-deployment-guide.md b/docs/source/deployment/mooncake-store-deployment-guide.md index df91836b..1b7b7a08 100644 --- a/docs/source/deployment/mooncake-store-deployment-guide.md +++ b/docs/source/deployment/mooncake-store-deployment-guide.md @@ -45,6 +45,15 @@ mooncake_master \ --enable_metric_reporting=true ``` +**Tips:** + +In addition to command-line flags, the Master also supports configuration via JSON and YAML files. For example: + +```bash +mooncake_master \ + --config_path=mooncake-store/conf/master.yaml +``` + ## Metrics Endpoints The master exposes Prometheus-style metrics over HTTP on `--metrics_port`: diff --git a/docs/source/getting_started/quick-start.md b/docs/source/getting_started/quick-start.md index 85b5a02a..5ac3ed18 100644 --- a/docs/source/getting_started/quick-start.md +++ b/docs/source/getting_started/quick-start.md @@ -216,4 +216,4 @@ store.close() ### More Examples and Documentation -Please refer to the [Mooncake Store Python API](../python-api-reference/mooncake-store.md) and [Mooncake Store](../design/mooncake-store.md) for more examples and documentation. \ No newline at end of file +Please refer to the [Mooncake Store Python API](../python-api-reference/mooncake-store.md), [Mooncake Store](../design/mooncake-store.md) and [Mooncake Store Deployment & Operations Guide](../deployment/mooncake-store-deployment-guide.md) for more examples and documentation. \ No newline at end of file diff --git a/mooncake-store/conf/master.json b/mooncake-store/conf/master.json new file mode 100644 index 00000000..4ca0935f --- /dev/null +++ b/mooncake-store/conf/master.json @@ -0,0 +1,23 @@ +{ + "enable_metric_reporting": true, + "metrics_port": 9003, + "rpc_port": 50051, + "rpc_thread_num": 4, + "rpc_address": "0.0.0.0", + "rpc_conn_timeout_seconds": 0, + "rpc_enable_tcp_no_delay": true, + "default_kv_lease_ttl": 5000, + "default_kv_soft_pin_ttl": 1800000, + "allow_evict_soft_pinned_objects": true, + "eviction_ratio": 0.1, + "eviction_high_watermark_ratio": 1.0, + "enable_ha": false, + "etcd_endpoints": "http://localhost:2379", + "root_fs_dir": "", + "cluster_id": "mooncake_cluster", + "memory_allocator": "offset", + "client_live_ttl_sec": 60, + "enable_http_metadata_server": false, + "http_metadata_server_host": "0.0.0.0", + "http_metadata_server_port": 8080 +} diff --git a/mooncake-store/conf/master.yaml b/mooncake-store/conf/master.yaml index b0a73135..24e73752 100644 --- a/mooncake-store/conf/master.yaml +++ b/mooncake-store/conf/master.yaml @@ -11,9 +11,14 @@ default_kv_soft_pin_ttl: 1800000 allow_evict_soft_pinned_objects: true eviction_ratio: 0.1 eviction_high_watermark_ratio: 1.0 -client_live_ttl_sec: 60 enable_ha: false etcd_endpoints: "http://localhost:2379" +root_fs_dir: "" cluster_id: "mooncake_cluster" -memory_allocator: "offset" \ No newline at end of file +memory_allocator: "offset" +client_live_ttl_sec: 60 + +enable_http_metadata_server: false +http_metadata_server_host: "0.0.0.0" +http_metadata_server_port: 8080 \ No newline at end of file diff --git a/mooncake-store/src/master.cpp b/mooncake-store/src/master.cpp index a3f6ca6f..b5f68b2f 100644 --- a/mooncake-store/src/master.cpp +++ b/mooncake-store/src/master.cpp @@ -18,7 +18,7 @@ using namespace coro_rpc; using namespace async_simple; using namespace async_simple::coro; -DEFINE_string(conf_path, "", "master service config file path"); +DEFINE_string(config_path, "", "master service config file path"); DEFINE_int32(port, 50051, "Port for master service to listen on (deprecated, use rpc_port)"); DEFINE_int32( @@ -324,7 +324,7 @@ int main(int argc, char* argv[]) { gflags::ParseCommandLineFlags(&argc, &argv, true); // Initialize the master configuration mooncake::MasterConfig master_config; - std::string conf_path = FLAGS_conf_path; + std::string conf_path = FLAGS_config_path; if (!conf_path.empty()) { mooncake::DefaultConfig default_config; default_config.SetPath(conf_path);