# notice (moderately verbose, what you want in production probably) # verbose (many rarely useful info, but not a mess like the debug level) # debug (a lot of information, useful for development/testing)
# If port 0 is specified Redis will not listen on a TCP socket. # Accept connections on the specified port, default is 6379 (IANA #815344). In our example it is not needed as the default port is already 6379. # nothing bad happens, the server will start and run normally.Ĭhange the port accordingly. # Creating a pid file is best effort: if Redis is not able to create it # is used even if not specified, defaulting to "/var/run/redis.pid". When the server is daemonized, the pid file # When the server runs non daemonized, no pid file is created if none is # If a pid file is specified, Redis writes it where specified at startup Set the pidfile to /var/run/redis_6379.pid (modify the port if needed). # Note that Redis will write a pid file in /var/run/redis.pid when daemonized. # By default Redis does not run as a daemon. Set daemonize to yes (by default it is set to no). Both the pid file path and the configuration file name depend on the port number.Ĭopy the template configuration file you'll find in the root directory of the Redis distribution into /etc/redis/ using the port number as name, for instance: sudo cp nf /etc/redis/nfĬreate a directory inside /var/redis that will work as data and working directory for this Redis instance: sudo mkdir /var/redis/6379Įdit the configuration file, making sure to perform the following changes: sudo vim /etc/redis/nf Make sure to modify REDIS_PORT accordingly to the port you are using. # Short-Description: start and stop redis_6379 # Required-Stop: $network $remote_fs $local_fs # Required-Start: $network $remote_fs $local_fs
# description: Redis is a persistent key-value database # as it does use of the /proc filesystem. # Simple Redis init.d script conceived to work on Linux systems sudo vim /etc/init.d/redis_6379Īdd the following lines at the top of init script (below line #!/bin/sh): #!/bin/sh For example: sudo cp utils/redis_init_script /etc/init.d/redis_6379Įdit the init script. We suggest calling it with the name of the port where you are running this instance of Redis. Extract it and compile with: tar -xzvf redis-3.2.1.tar.gzĬreate a directory where to store your Redis config files and your data: sudo mkdir /etc/redisĬopy the init script that you'll find in the Redis distribution under the utils directory into /etc/init.d.