The default Redis program is installed in the/usr/local/redis directory;
Configuration file:/usr/local/redis/redis.conf, the port configured in this profile is the default port: 6379;
Redis boot command path:/usr/local/bin/redis-server.
You can specify a port to start multiple Redis processes.
#/usr/local/bin/redis-server--port 6380 & #启动6380端口的redis实例.
==================== Each of the following processes corresponds to a configuration file (reprint) ===================================================
Multiple Redis instances need to be started:
A Redis server, divided into multiple nodes, each node assigned a port (6380,6381 ...) ), the default port is 6379.
Each node corresponds to a redis configuration file, such as: redis6380.conf, redis6381.conf
#cp redis.confredis6380.conf
#vi redis6380.conf
Pidfile:pidfile/var/run/redis/redis_6380.pid
Port 6380
Logfile:logfile/var/log/redis/redis_6380.log
Rdbfile:dbfilenamedump_6380.rdb
(Other configuration files are similar to modifications)
To start multiple Redis instances:
#redis-server/usr/local/redis/redis6380.conf
#redis-server/usr/local/redis/redis6381.conf
Supplementary Note:
Redis Data storage
The Redis storage is divided into three parts: memory storage, disk storage and log files, and three parameters are configured in the configuration file.
Save seconds Updates: Synchronizes data to a data file when the number of update operations is reached within a specified time. This can be a combination of conditions, such as the default configuration file settings, set three conditions.
AppendOnly yes/no: Whether logging after each update operation may result in loss of data for a period of time if the power is not turned on.
Because the Redis itself synchronizes data files according to the save condition above, some data will only exist in memory for a period of time.
Appendfsyncno/always/everysec:no means that the operating system synchronizes the data cache to disk, always indicates that Fsync () is manually invoked after each update operation to write the data to disk, EVERYSEC is synchronized once per second.