$ redis-server
[28550] 01 Aug 19:29:28 # Warning: no config file specified, using the default config. In order to specify a config file use 'redis-server /path/to/redis.conf'
[28550] 01 Aug 19:29:28 * Server started, Redis version 2.2.12
[28550] 01 Aug 19:29:28 * The server is now ready to accept connections on port 6379
... and so forth ...
上面的命令启动了没有附带任何配置信息的服务,所有的配置信息将使用reids的默认配置。
可以通过在redis-server命令后附加上配置文件的绝对路径,即可启用配置文件的设置,如:
redis-server /etc/redis.conf
Redis配置文件默认存放在redis文件夹下,名为redis.conf,可以将该文件作为配置模版复制到root目录下。
Redis 服务端的默认连接端口是 6379。 将Redis作为 Linux 服务随机启动
vi /etc/rc.local, 使用vi编辑器打开随机启动配置文件,并在其中加入下面一行代码。