配置环境变量
- [root@redis-m tools]# echo "PATH=/application/redis/bin:$PATH">>/etc/profile
- [root@redis-m tools]# source /etc/profile
- [root@redis-m tools]# which redis-server
- /application/redis/bin/redis-server
查看帮助文档
- [root@redis-m tools]# redis-server --help
- Usage: ./redis-server [/path/to/redis.conf] [options]
- ./redis-server - (read config from stdin)
- ./redis-server -v or --version
- ./redis-server -h or --help
- ./redis-server --test-memory <megabytes>
- Examples:
- ./redis-server (run the server with default conf)
- ./redis-server /etc/redis/6379.conf
- ./redis-server --port 7777
- ./redis-server --port 7777 --slaveof 127.0.0.1 8888
- ./redis-server /etc/myredis.conf --loglevel verbose
启动服务
- [root@redis-m ~]# cd /application/redis/
- [root@redis-m redis]# ll
- total 4
- drwxr-xr-x 2 root root 4096 Mar 22 04:50 bin
- [root@redis-m redis]# mkdir conf
- [root@redis-m redis]# cp /download/tools/redis-2.8.24/redis.conf ./conf/
- [root@redis-m redis]# redis-server /application/redis/conf/redis.conf &
- [6072] 22 Mar 05:00:51.373 # Server started, Redis version 2.8.24
- [6072] 22 Mar 05:00:51.374 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
#内存不足的时候,数据加载到磁盘可能失效,可以使用命令解决或修改配置文件
- [6072] 22 Mar 05:00:51.375 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
- [6072] 22 Mar 05:00:51.375 * The server is now ready to accept connections on port 6379
- [root@redis-m redis]# lsof -i :6379
- COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
- redis-ser 6072 root 4u IPv6 24271 0t0 TCP *:6379 (LISTEN)
- redis-ser 6072 root 5u IPv4 24273 0t0 TCP *:6379 (LISTEN)
- vm.overcommit_memory
0表示用户空间请求更多内存时,内核尝试估算出余下可用内存
1表示内核允许最大限度的的使用内存 (编辑:晋中站长网)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|