Skip to content

Commit

Permalink
Add startup parameters for chunkserver
Browse files Browse the repository at this point in the history
Signed-off-by: yyyyufeng <[email protected]>
  • Loading branch information
Vigor-jpg committed Sep 27, 2023
1 parent 28dd6b0 commit 6526177
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
2 changes: 2 additions & 0 deletions internal/configure/topology/dc_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ func (dc *DeployConfig) GetListenDummyPort() int { return dc.getInt(CONFIG_L
func (dc *DeployConfig) GetListenProxyPort() int { return dc.getInt(CONFIG_LISTEN_PROXY_PORT) }
func (dc *DeployConfig) GetListenExternalIp() string { return dc.getString(CONFIG_LISTEN_EXTERNAL_IP) }
func (dc *DeployConfig) GetCopysets() int { return dc.getInt(CONFIG_COPYSETS) }
func (dc *DeployConfig) GetChunkFilePoolSize() int { return dc.getInt(CONFIG_CHUNK_FILE_POOL_SIZE) }
func (dc *DeployConfig) GetChunkFormatThreadNum() int { return dc.getInt(CONFIG_CHUNK_FORMAT_THREAD_NUM) }
func (dc *DeployConfig) GetS3AccessKey() string { return dc.getString(CONFIG_S3_ACCESS_KEY) }
func (dc *DeployConfig) GetS3SecretKey() string { return dc.getString(CONFIG_S3_SECRET_KEY) }
func (dc *DeployConfig) GetS3Address() string { return dc.getString(CONFIG_S3_ADDRESS) }
Expand Down
16 changes: 16 additions & 0 deletions internal/configure/topology/dc_item.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ const (
DEFAULT_ENABLE_EXTERNAL_SERVER = false
DEFAULT_CHUNKSERVER_COPYSETS = 100 // copysets per chunkserver
DEFAULT_METASERVER_COPYSETS = 100 // copysets per metaserver
DEFAULT_CHUNK_FILE_POOL_SIZE = 10 // size (GB) per chunk file pool
DEFAULT_CHUNK_FORMAT_THREAD_NUM = 2
)

type (
Expand Down Expand Up @@ -230,6 +232,20 @@ var (
},
)

CONFIG_CHUNK_FILE_POOL_SIZE = itemset.insert(
"chunkfilepool.size",
REQUIRE_POSITIVE_INTEGER,
true,
DEFAULT_CHUNK_FILE_POOL_SIZE,
)

CONFIG_CHUNK_FORMAT_THREAD_NUM = itemset.insert(
"chunkfilepool.format_thread_num",
REQUIRE_POSITIVE_INTEGER,
true,
DEFAULT_CHUNK_FORMAT_THREAD_NUM,
)

CONFIG_S3_ACCESS_KEY = itemset.insert(
"s3.ak",
REQUIRE_STRING,
Expand Down
4 changes: 3 additions & 1 deletion internal/task/task/common/create_container.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ func getArguments(dc *topology.DeployConfig) string {
"enableExternalServer": dc.GetEnableExternalServer(),
"chunkServerExternalIp": dc.GetListenExternalIp(),
"chunkServerPort": dc.GetListenPort(),
"chunkFilePoolDir": dataDir,
"chunkFilePoolDir": fmt.Sprintf("%s/chunks", dataDir),
"chunkFilePoolSize": dc.GetChunkFilePoolSize(),
"chunkFormatThreadNum": dc.GetChunkFormatThreadNum(),
"chunkFilePoolMetaPath": fmt.Sprintf("%s/chunkfilepool.meta", dataDir),
"walFilePoolDir": dataDir,
"walFilePoolMetaPath": fmt.Sprintf("%s/walfilepool.meta", dataDir),
Expand Down
2 changes: 1 addition & 1 deletion internal/task/task/playground/script/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function start_service() {
-raft_sync_segments=true \
-raft_max_install_snapshot_tasks_num=1 \
-chunkServerIp=127.0.0.1 \
-chunkFilePoolDir="${data_dir}" \
-chunkFilePoolDir="${data_dir}"/chunks \
-walFilePoolDir="${data_dir}" \
-raft_sync=true \
-raft_max_segment_size=8388608 \
Expand Down

0 comments on commit 6526177

Please sign in to comment.