diff --git a/README.md b/README.md index 2f8abad..a55fb94 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ Choosing a store database to use is very simple, you have two ways: + Set in command flag - ledis-server -config=/etc/ledis.toml -db_name=leveldb + ledis-server -config=/etc/ledis.conf -db_name=leveldb Flag command set will overwrite config set. @@ -78,12 +78,18 @@ Choosing a store database to use is very simple, you have two ways: You must known that changing store database runtime is very dangerous, LedisDB will not guarantee the data validation if you do it. +## Configuration + +LedisDB uses [toml](https://github.com/toml-lang/toml) as the preferred configuration format, also supports ```json``` because of some history reasons. The basic configuration ```./etc/ledis.conf``` in LedisDB source may help you. + +If you don't use a configuration, LedisDB will use the default for you. + ## Server Example //set run environment if not source dev.sh - ledis-server -config=/etc/ledis.toml + ledis-server -config=/etc/ledis.conf //another shell ledis-cli -p 6380 diff --git a/etc/ledis.toml b/etc/ledis.conf similarity index 87% rename from etc/ledis.toml rename to etc/ledis.conf index 6ef9a6c..8d92919 100644 --- a/etc/ledis.toml +++ b/etc/ledis.conf @@ -1,5 +1,7 @@ # LedisDB configuration +# Config format is toml, https://github.com/toml-lang/toml + # Server listen address addr = "127.0.0.1:6380" @@ -36,6 +38,7 @@ max_open_files = 1024 map_size = 524288000 [binlog] +# Set either size or num to 0 to disable binlog max_file_size = 0 max_file_num = 0