Skip to content

Commit

Permalink
feat(config): Modify config items; Change starting prints (cnosdb#912)
Browse files Browse the repository at this point in the history
* feat(config): Change type of  size items to string (num + k/m/g)

* feat(config): Modify config items; cli args has higher priority than config

* fix(config): causes rustc panic
  • Loading branch information
zipper-meng authored Feb 14, 2023
1 parent b8d5232 commit c4845b2
Show file tree
Hide file tree
Showing 10 changed files with 554 additions and 195 deletions.
2 changes: 0 additions & 2 deletions config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ version.workspace = true
edition.workspace = true

[dependencies]
trace = { path = "../common/trace" }

serde = { workspace = true }
toml = { workspace = true }
20 changes: 10 additions & 10 deletions config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ auth_enabled = false
path = 'data/db'

# The maximum file size of summary file.
max_summary_size = 134217728 # 128M (128 * 1024 * 1024)
max_summary_size = "128M" # 134217728

# The maximum file size of a level is:
# $base_file_size * level * $compact_trigger_file_num
base_file_size = 16777216 # 16M (16 * 1024 * 1024)
base_file_size = "16M" # 16777216

# The maxmimum data file level (from 0 to 4).
max_level = 4
Expand All @@ -33,7 +33,7 @@ compact_trigger_file_num = 4
compact_trigger_cold_duration = "1h"

# The maximum size of all files in a compaction.
max_compact_size = 2147483648 # 2G (2 * 1024 * 1024 * 1024)
max_compact_size = "2G" # 2147483648

# The maximum concurrent compactions.
max_concurrent_compaction = 4
Expand All @@ -50,14 +50,14 @@ enabled = true
path = 'data/wal'

# The maximum size of a wal file.
max_file_size = 1073741824 # 1024 * 1024 * 1024
max_file_size = "1G" # 1073741824

# If true, fsync will be called after every wal writes.
sync = false
sync_interval = "0" # h, m, s

[cache]
max_buffer_size = 134217728 # 128M (128 * 1024 * 1024)
max_buffer_size = "128M" # 134217728
max_immutable_number = 4

[log]
Expand All @@ -72,13 +72,13 @@ path = 'data/log'
[cluster]
node_id = 100
name = 'cluster_xxx'
meta = '127.0.0.1:21001'
meta_service_addr = '127.0.0.1:21001'
tenant = ''

flight_rpc_server = '127.0.0.1:31006'
http_server = '127.0.0.1:31007'
grpc_server = '127.0.0.1:31008'
tcp_server = '127.0.0.1:31009'
http_listen_addr = '127.0.0.1:31007'
grpc_listen_addr = '127.0.0.1:31008'
tcp_listen_addr = '127.0.0.1:31009'
flight_rpc_listen_addr = '127.0.0.1:31006'

[hintedoff]
enable = true
Expand Down
20 changes: 10 additions & 10 deletions config/config_31001.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ auth_enabled = false
# Directory for tsm: $path/data/$database/tsm/
# Directory for delta: $path/data/$database/delta/
path = '/tmp/cnosdb/1001/db'
max_summary_size = 134217728 # 128 * 1024 * 1024
base_file_size = 16777216 # 16 * 1024 * 1024
max_summary_size = "128M" # 134217728
base_file_size = "16M" # 16777216
max_level = 4
compact_trigger_file_num = 4
compact_trigger_cold_duration = "1h"
max_compact_size = 2147483648 # 2 * 1024 * 1024 * 1024
max_compact_size = "2G" # 2147483648
max_concurrent_compaction = 4
dio_max_resident = 1024
dio_max_non_resident = 1024
Expand All @@ -25,11 +25,11 @@ strict_write = false
[wal]
enabled = true
path = '/tmp/cnosdb/1001/wal'
max_file_size = 1073741824 # 1024 * 1024 * 1024
max_file_size = "1G" # 1073741824
sync = false

[cache]
max_buffer_size = 134217728 # 128 * 1024 * 1024
max_buffer_size = "128M" # 134217728
max_immutable_number = 4

[log]
Expand All @@ -45,12 +45,12 @@ path = '/tmp/cnosdb/1001/log'
node_id = 1001
tenant = ''
name = 'cluster_xxx'
meta = '127.0.0.1:21001'
meta_service_addr = '127.0.0.1:21001'

http_server = '127.0.0.1:31001'
grpc_server = '127.0.0.1:31002'
tcp_server = '127.0.0.1:31003'
flight_rpc_server = '127.0.0.1:31004'
http_listen_addr = '127.0.0.1:31001'
grpc_listen_addr = '127.0.0.1:31002'
tcp_listen_addr = '127.0.0.1:31003'
flight_rpc_listen_addr = '127.0.0.1:31004'

[hintedoff]
enable = true
Expand Down
20 changes: 10 additions & 10 deletions config/config_32001.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ auth_enabled = false
# Directory for tsm: $path/data/$database/tsm/
# Directory for delta: $path/data/$database/delta/
path = '/tmp/cnosdb/2001/db'
max_summary_size = 134217728 # 128 * 1024 * 1024
base_file_size = 16777216 # 16 * 1024 * 1024
max_summary_size = "128M" # 134217728
base_file_size = "16M" # 16777216
max_level = 4
compact_trigger_file_num = 4
compact_trigger_cold_duration = "1h"
max_compact_size = 2147483648 # 2 * 1024 * 1024 * 1024
max_compact_size = "2G" # 2147483648
max_concurrent_compaction = 4
dio_max_resident = 1024
dio_max_non_resident = 1024
Expand All @@ -25,11 +25,11 @@ strict_write = false
[wal]
enabled = true
path = '/tmp/cnosdb/2001/wal'
max_file_size = 1073741824 # 1024 * 1024 * 1024
max_file_size = "1G" # 1073741824
sync = false

[cache]
max_buffer_size = 134217728 # 128 * 1024 * 1024
max_buffer_size = "128M" # 134217728
max_immutable_number = 4

[log]
Expand All @@ -45,12 +45,12 @@ path = '/tmp/cnosdb/2001/log'
node_id = 2001
tenant = ''
name = 'cluster_xxx'
meta = '127.0.0.1:21001'
meta_service_addr = '127.0.0.1:21001'

http_server = '127.0.0.1:32001'
grpc_server = '127.0.0.1:32002'
tcp_server = '127.0.0.1:32003'
flight_rpc_server = '127.0.0.1:32004'
http_listen_addr = '127.0.0.1:32001'
grpc_listen_addr = '127.0.0.1:32002'
tcp_listen_addr = '127.0.0.1:32003'
flight_rpc_listen_addr = '127.0.0.1:32004'

[hintedoff]
enable = true
Expand Down
Loading

0 comments on commit c4845b2

Please sign in to comment.