首页 文章 精选 留言 我的

精选列表

搜索[分代式],共10010篇文章
优秀的个人博客,低调大师

Nginx反代MySQL案例

案例:一个朋友要用Nginx代理MySQL(MySQL局域网),不用×××,不用NAT映射等,好吧,做个笔记。 Nginx版本:1.9.x(持tcp的负载均衡,nginx_tcp_proxy_module(姚伟斌阿里团队也可以实现)) Nginx官方模块:ngx_stream_core_module --with-stream_ssl_module(ssl协议支持,比如MySQL ssl) 官网:http://nginx.org/en/docs/stream/ngx_stream_core_module.html 1、查看现有编译 --user=nginx--group=nginx--prefix=/usr/local/nginx--with-http_stub_status_module--with-http_ssl_module--with-http_realip_module--with-http_flv_module--with-http_mp4_module--with-http_gzip_static_module 2、重新编译: http://nginx.org/download/ --user=nginx--group=nginx--prefix=/usr/local/nginx--with-http_stub_status_module--with-http_ssl_module--with-http_realip_module--with-http_flv_module--with-http_mp4_module--with-http_gzip_static_module--with-stream--with-stream_ssl_module 注意:--with-stream --with-stream_ssl_module 3、配置、检测、重启nginx: 配置: stream{ upstreammysql{ zonemyapp164k; serverlocalhost:3306weight=1max_fails=3fail_timeout=30s; #server192.168.1.221:3306weight=1max_fails=2fail_timeout=30s; } server{ listen2188; proxy_connect_timeout1s; proxy_timeout3s; proxy_passmysql; } } 检测: [root@autoCentos67X64conf]#nginx-t nginx:theconfigurationfile/usr/local/nginx/conf/nginx.confsyntaxisok nginx:configurationfile/usr/local/nginx/conf/nginx.conftestissuccessful [root@autoCentos67X64conf]# 启动: [root@autoCentos67X64conf]#netstat-atupn|grepnginx tcp000.0.0.0:21880.0.0.0:*LISTEN2359/nginx [root@autoCentos67X64conf]# 4、验证:(转载请保留:renzhiyuan.blog.51cto.com) [root@log~]#mysql-uroot-prenzhiyuan-h192.168.1.11-P2188 WelcometotheMySQLmonitor.Commandsendwith;or\g. YourMySQLconnectionidis3 Serverversion:5.6.21-logMySQLCommunityServer(GPL) Copyright(c)2000,2013,Oracleand/oritsaffiliates.Allrightsreserved. OracleisaregisteredtrademarkofOracleCorporationand/orits affiliates.Othernamesmaybetrademarksoftheirrespective owners. Type'help;'or'\h'forhelp.Type'\c'toclearthecurrentinputstatement. mysql> 注意:2188可是Nginx的端口,代理(负载)后端的MySQL。其它玩法大家可自己研究。

优秀的个人博客,低调大师

elasticsearch 算分脚本

可以将上一章的脚本,放到elasticsearch/config/scripts 目录下,比如命名为my_script.groovy。 然后使用下面的代码进行调用: "script_score" : { "script" : { "file" : "my_script" } } 这个文件夹的文件60s更新一次,可以随时增加或者删除. script_score 官方网站上存在性能问题,建议使用Native Java Scripts,下次我们将介绍它 本文转自whk66668888 51CTO博客,原文链接:http://blog.51cto.com/12597095/1942728

资源下载

更多资源
腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册