redis installation configuration

Installation:
MAC: Quguan network to download and install, extract
tar zxvf redis-5.0.5.tar.gz
into usr / local below unpacked
mv redis-5.0.5 / usr / local /
proceeds to the following redis
cd / usr / local /redis-5.0.5/
compile the test
sudo make test
compile
sudo make install
to redis which can start up
behind some other configuration
built in three directories below redis
sudo mkdir /usr/local/redis-5.0.5/bin
mkdir /usr/local/redis-5.0.5/etc the sudo
the sudo mkdir /usr/local/redis-5.0.5/db
mkreleasehdr.sh, Redis-Benchmark in the / usr / local / redis / src directory, redis- check-rdb, redis-cli, redis-server bin directory to copy
CP /usr/local/redis-5.0.5/src/mkreleasehdr.sh.
CP /usr/local/redis-5.0.5/src/redis-benchmark .
cp /usr/local/redis-5.0.5/src/redis-check-rdb.
/usr/local/redis-5.0.5/src/redis-cli CP.
CP /usr/local/redis-5.0.5/src/redis-server.
Under redis.conf copied to / usr / local / redis / etc
cp /usr/local/redis-5.0.5/redis.conf /usr/local/redis-5.0.5/etc
then modify redis.conf this important
# amended as guardian mode daemon mode refers to the redis will run until his kill off the process, where the default is NO
daemonize yes
when # setting process lock file redist run by default the guardian way pid process id written to the specified file pidfile below
pidfile /usr/local/redis-3.2.8 /redis.pid
# port
port 6379
# timeout when the client closes the connection is idle before the client, if you specify zero disables this function
timeout 300
# log level
LogLevel Debug
# log file location
logfile / usr / local / redis-3.2.8 / log-redis.log
number # database setup, the default database is 0, may be used in the SELECT command specified database connection ID
databases 16
## specifies how long, how many times the refresh operation, the data will be synchronized to the data file, a plurality of conditions can be fit
#save
#Redis default profile provided three conditions:
Save 900. 1
Save 300 10
Save 60 10000
are # specify the storage to the local database compression data, the default is yes, Redis using LZF compression, if in order to save CPU time,
# can close the # option, but will cause the database files become huge
rdbcompression yes
# specify the local database file name
dump.rdb dbfilename
# path to specify the local database
the dir /usr/local/redis-3.2.8/db/
# Specifies whether logging after each update operation, the Redis default asynchronous data is written to disk, If you do not open, could
# result in data over a period of time when power is lost. Because redis itself to synchronize data file is based on the above criteria to save synchronization, so there
# data will exist only in the memory for some time
appendOnly NO
# specified condition update log, there are three possible values:
#no: representation, etc. operating system to synchronize data cache to disk (fast)
#always: indicates that the call after each update manually fsync () writes data to disk (slow, safe)
#everysec: indicate synchronization once per second (a compromise, the default value)
appendfsync everysec
start reids
redis profile to say
# #
Note that in order to read the configuration file, Redis must be
# to the file path as the first argument began:
official website said redis configuration file can not start, but the proper use of redis posture or band profile start
./redis-server ... / etc / redis.conf
view the log:
tail -f log-redis.log
open redis client:
./bin/redis-cli

This command I write because the port number in the configuration file the port number is not specified redis, so every time the error could not connect
Baidu Baidu
can specify parameters at the time of execution of this command ./bin/redis-cli -h 127.0.0.1 -p 9325

Guess you like

Origin blog.csdn.net/qq_24854043/article/details/95307891