Rate This Document
Findability
Accuracy
Completeness
Readability

Starting Redis

This section describes how to start the Redis server using commands, and the parameters for specifying the port number and IP address when starting Redis.

  1. Switch to the directory where the Redis configuration file is stored. Here, the directory is /home/redis/standalone.
    cd /home/redis/standalone
  2. Run the following command to start Redis:
    redis-server ./redis.conf &
    • By default, the Redis server listens to port 6379. If you want to run Redis instances on different ports, specify the port number using the --port parameter in the startup command.
      redis-server ./redis.conf --port 6380 &
    • By default, the Redis server listens to all IP addresses bound to it. To enable the Redis server to listen to only specified IP addresses, set the --bind parameter.
      redis-server ./redis.conf --bind 192.168.1.2 &
    • If both the port number and IP address need to be specified, set the --port and --bind parameters together.
      redis-server ./redis.conf --port 6380 --bind 192.168.1.2 &
    • If the port number and IP address have been configured in the redis.conf file and do not need to be changed during startup, you do not need to specify these parameters in the startup command.