redis安装 1.redis 安装 官网地址:http://redis.io/download $ wget http://download.redis.io/releases/redis-3.0.5.tar.gz $ tar xzf redis-3.0.5.tar.gz $ cd redis-3.0.5 $ make The binaries that are now compiled are available in the src directory. Run Redis with: $ src/redis-server You can interact with Redis using the built-in client: $ src/redis-cli redis> set foo bar OK redis> get foo "bar" redis的关闭 在链接的客户端里: redis>shutdown 按照上面的启动方式 redis没有加载配置文件,可以通过 查看redis的信息 redis>info 127.0.0.1:6379> info # Server redis_version:3.0.5 redis_git_sha1:00000000 redis_git_dirty:0 redis_build_id:253e13ee0c3e995d redis_mode:standalone os:Linux 3.19.0-25-generic x86_64 arch_bits:64 multiplexing_api:epoll gcc_version:4.8.4 process_id:8969 run_id:e4832553bdf475b22774c8ae365105af31320f6f tcp_port:6379 uptime_in_seconds:5 uptime_in_days:0 hz:10 lru_clock:4386972 config_file: 可以加载上配置文件来启动 redis默认带了一个redis .conf配置文件 启动 ./redis-server ../redis.conf 这个时候查看信息文件 127.0.0.1:6379> info # Server redis_version:3.0.5 redis_git_sha1:00000000 redis_git_dirty:0 redis_build_id:253e13ee0c3e995d redis_mode:standalone os:Linux 3.19.0-25-generic x86_64 arch_bits:64 multiplexing_api:epoll gcc_version:4.8.4 process_id:8979 run_id:c40d0d1a9a762217be785ca4ae7be9d9130f5264 tcp_port:6379 uptime_in_seconds:8 uptime_in_days:0 hz:10 lru_clock:4387544 config_file:/home/clz/Downloads/redis-3.0.5/redis.conf 在config_file 会多一个文件的路径。
注意更改redis绑定的ip地址,否则阿里云会提示安全错误
在配置文件中设置
daemonize yes
设置成功之后会以守护进程的方式进行运行。