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 Oct 23, 2023
1 parent 28dd6b0 commit 4bf36b6
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 16 deletions.
6 changes: 6 additions & 0 deletions internal/configure/topology/dc_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ 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) GetChunkFilePoolAllocatedPercent() int {
return dc.getInt(CONFIG_CHUNK_FILE_POOL_ALLOCATED_PERCENT)
}
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_FILE_POOL_ALLOCATED_PERCENT = 90 // format percent per disk
DEFAULT_CHUNK_FORMAT_THREAD_NUM = 2
)

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

CONFIG_CHUNK_FILE_POOL_ALLOCATED_PERCENT = itemset.insert(
"chunkfilepool.allocated_percent",
REQUIRE_POSITIVE_INTEGER,
true,
DEFAULT_FILE_POOL_ALLOCATED_PERCENT,
)

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
32 changes: 17 additions & 15 deletions internal/task/task/common/create_container.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,21 +113,23 @@ func getArguments(dc *topology.DeployConfig) string {
dataDir := layout.ServiceDataDir
chunkserverArguments := map[string]interface{}{
// chunkserver
"conf": layout.ServiceConfPath,
"chunkServerIp": dc.GetListenIp(),
"enableExternalServer": dc.GetEnableExternalServer(),
"chunkServerExternalIp": dc.GetListenExternalIp(),
"chunkServerPort": dc.GetListenPort(),
"chunkFilePoolDir": dataDir,
"chunkFilePoolMetaPath": fmt.Sprintf("%s/chunkfilepool.meta", dataDir),
"walFilePoolDir": dataDir,
"walFilePoolMetaPath": fmt.Sprintf("%s/walfilepool.meta", dataDir),
"copySetUri": fmt.Sprintf("local://%s/copysets", dataDir),
"recycleUri": fmt.Sprintf("local://%s/recycler", dataDir),
"raftLogUri": fmt.Sprintf("curve://%s/copysets", dataDir),
"raftSnapshotUri": fmt.Sprintf("curve://%s/copysets", dataDir),
"chunkServerStoreUri": fmt.Sprintf("local://%s", dataDir),
"chunkServerMetaUri": fmt.Sprintf("local://%s/chunkserver.dat", dataDir),
"conf": layout.ServiceConfPath,
"chunkServerIp": dc.GetListenIp(),
"enableExternalServer": dc.GetEnableExternalServer(),
"chunkServerExternalIp": dc.GetListenExternalIp(),
"chunkServerPort": dc.GetListenPort(),
"chunkFilePoolDir": fmt.Sprintf("%s/chunks", dataDir),
"chunkFilePoolAllocatedPercent": dc.GetChunkFilePoolAllocatedPercent(),
"chunkFormatThreadNum": dc.GetChunkFormatThreadNum(),
"chunkFilePoolMetaPath": fmt.Sprintf("%s/chunkfilepool.meta", dataDir),
"walFilePoolDir": dataDir,
"walFilePoolMetaPath": fmt.Sprintf("%s/walfilepool.meta", dataDir),
"copySetUri": fmt.Sprintf("local://%s/copysets", dataDir),
"recycleUri": fmt.Sprintf("local://%s/recycler", dataDir),
"raftLogUri": fmt.Sprintf("curve://%s/copysets", dataDir),
"raftSnapshotUri": fmt.Sprintf("curve://%s/copysets", dataDir),
"chunkServerStoreUri": fmt.Sprintf("local://%s", dataDir),
"chunkServerMetaUri": fmt.Sprintf("local://%s/chunkserver.dat", dataDir),
// brpc
"bthread_concurrency": 18,
"graceful_quit_on_sigterm": true,
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 4bf36b6

Please sign in to comment.