目录
安装(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单实例配置
redis.conf配置文件
单实例服务端启动
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单实例环境验证
![源配置]( http://upload-images.jianshu.io/upload_images/46859 68-ae7d0bd9a6671888.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
export JAVA_HOME=/usr/java/jdk1.7.0_80
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export MAVEN_HOME=/developer/apache-maven-3.0.5
export NODE_HOME=/usr/local/node-v4.4.7-linux-x64
export RUBY_HOME=/usr/local/ruby
export CATALINA_HOME=/developer/apache-tomcat-7.0.73
export PATH=$PATH:$JAVA_HOME/bin:$CATALINA_HOME/bin:$MAVEN_HOME/bin:$NODE_HOME/bin:/usr/local/bin:$RUBY_HOME/bin
export LC_ALL=en_US.UTF-8
创建一个user,没有登录云服务器权限,但有登录vsftpd权限
进入解压后的NGINX目录,执行./configure然后make,make install进行编译
Tomcat多实例配置及验证
5:55处 Tomcat 首页无法打开,留待解决
Nginx负载均衡配置及验证
通过访问域名进行验证