解压直接安装,并写软连接为tomcat
进入目录,开启tomcat
测试
关闭openresty,打开nginx
写测试的test.php并验证,发现调用后之前的数据丢失
测试主机加本地解析
3号实验主机配置
当切换时不在有之前的记录,用静态解决不存储的问题
使用交叉存储的方式进行防止数据丢失
memcache源码,环境纯净并重启
查看日志发现有白色的说明成功
写交叉存储的配置文件
当其他的挂掉,用自己本身的memcache
关闭在开启
查看缓存,获取到缓存数据
分别down掉mamcache和tomcat在进行测试,发现数据没有丢失
nginx结合lua
location @client {
proxy_pass http://172.25.0.3;
}
location ~ .php$ {
default_type text/html;
content_by_lua ‘ngx.say(“this is westos.org”)’;
access_by_lua ’
if ngx.var.remote_addr == “172.25.0.250” then
ngx.exec("@client")
end
';
}