#目录
#安装(CentOS6.8)
下载、解压并编译
cd redis-2.8.0 make
##编译好的二进制文件在src目录里。运行Redis
cd src
启动占用窗口
启动在后台,不占用窗口
##你可以使用内置的客户端与Redis互动:
$ src/redis-cli redis> set foo bar OK redis> get foo "bar"
单实例服务端启动
redis-server redis-server $ {redis.conf} redis-server --port ${port}指定端口启动 ![redis-server --port 6380](http://upload-images.jianshu.io/upload_images/4685968-c1ba9778bb0cbcbb.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) ![客户端无法连接默认的6379端口](http://upload-images.jianshu.io/upload_images/4685968-7ad50e31fda378e4.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) ![需指定端口连接](http://upload-images.jianshu.io/upload_images/4685968-bb205ea67c06106f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) ![退出也要指定端口](http://upload-images.jianshu.io/upload_images/4685968-4ed5deac17f9c167.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
单实例客户端的启动
redis-cli redis-cli-p ${port} redis-cli-h ${ip} redis-cli-a ${password} redis-cli-p ${port} redis-cli-h ${ip} redis-cli-a ${password}
Redis单实例服务端及客户端关闭
使用Ctrl C终止服务时,Redis是不会持久化数据的,所以禁止使用!!!
而应该使用以下命令,Redis会自动触发持久化
redis-cli shutdown redis-cli -p ${port} shutdown redis-cli -h ${ip} shutdown redis-cli -p ${port} -h ${ip} shutdown
Redis单实例环境验证
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-CQJkSSmq-1595153063903)(http://upload-images.jianshu.io/upload_images/46859 68-ae7d0bd9a6671888.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)]