SSDB configuration


Note

The configuration file of SSDB uses a TAB to represent one level of indentation. Do not use spaces for indentation, no matter you use 1, 2, or 3 One, four, five, six, seven, eight or countless spaces will not work!

Important

Must be Remember to modify your Linux kernel parameters. Regarding the content of max open files (maximum number of file descriptors), please refer to [1]. Otherwise, you will see it in log.txt Too many open files Similar errors, or see Connection reset by peer error on the client.

PS: Use this c1000k tool to test how many concurrent connections your system supports.


Listening network port

server:
    ip: 127.0.0.1
    port: 8888

Default configuration file listening 127.0.0.1 is a local loop network, so this SSDB server cannot be connected from other machines. If you want to connect to the SSDB server from other machines, you must change 127.0.0.1 Changed to 0.0.0.0.

At the same time, use the deny, allow directive in the configuration file to restrict trusted source IP access.

warn!

If you monitor without network restrictions 0.0.0.0 IP may cause your data to be accessed by any machine, which is likely to be a security issue! You can combine the iptables of the operating system to limit network access .


Synchronization and Replication


Log Configuration

Also see Log analysis.

  • ##logger.level Log level
Supported log levels are:

debug, warn, error, fatal.

Generally, it is recommended that you set logger.level to debug level.

  • ##logger.output Log Output
You can directly write the relative path or absolute path. If it is a relative path, it is the directory where the relative configuration file is located.

If you want to output the log to the terminal screen, Edit ssdb.conf and change

logger:
    output: log.txt

to

logger:
    output: stdout

  • ##logger.rorate.size Log rotation and cleaning
  • Set the size of the log when splitting, the unit is the number of bytes. According to the default configuration, the log will be split according to the size of 1000MB. The format of the split file name is as follows:
log.txt.20150723 -230422

.

The split log files will not be automatically cleaned. You need to write your own crontab script to clean them.


Memory usage

One ssdb- The memory occupied by the server instanceInstantly(It is possible, and even if it is reached, it will only last for a short period of time) The maximum reaches (MB):

cache_size + write_buffer_size  66 + 32

This is the case when the compression option is not turned on. If compression: yes, the calculation formula is:

cache_size + 10  write_buffer_size * 66 + 32

You can adjust the configuration parameters to limit the memory usage of ssdb-server.