个推微服务实践 - 基于OpenResty和Node.js

2020-02-27 173浏览

  • 1.OpenResty 2017-04-16 Node.js
  • 2.SDK 2012 2013 2014 2015 2016 SDK 2017
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.A A B B Api C C D D
  • 9./ / A A Api B B Api Api
  • 10.A B F C E A C F B D G E H D
  • 11./ 1 DB DB/Redis 2 MQ DB/Redis MQ 3 0
  • 12.
  • 13.
  • 14.Web
  • 15.A JS B Web java BI A Web B
  • 16.Api OpenResty Nginx+Lua Nginx Lua web HTTP REST JSON HTTP REST JSON ZK Lua Node.js Java Java
  • 17.OpenResty OpenResty  Nginx  Lua Web Lua Web Web
  • 18.LVS+HaProxy API OpenResty (Nginx+Lua) ZooKeeper etcd/consul OpenResty (Nginx+Lua) OpenResty (Nginx+Lua) PM2 Jetty PM2 Jetty Node.js Java Node.js Java
  • 19.- OpenResty Nginx+lua WebLua A upstream B C lib library WebNode a lua upstream conf Java b c X express+co lib library Jetty conf Y
  • 20.- OpenResty Nginx+lua WebLua A upstream B C lib library WebNode a lua upstream conf Java b c X express+co lib library Jetty conf Y
  • 21.upstream node { server 127.0.0.1:3000; } server { listen 6080; server_name localhost *.a.com *.b.com *.c.com; OpenResty location ^~/auth { rewrite ^/(\w+)/(\w+)/(\w+)?(.*)$ /?app=$1&action=$2&func=$3&$4 break; content_by_lua_file weblua/lua/content/index.lua; } WebLua location /tdesk { rewrite ^/(\w+)/(\w+)/(\w+)?(.*)$ /api/?app=$1&action=$2&func=$3&$4 break; access_by_lua_file weblua/lua/access/index.lua; proxy_passhttp://node'>http://node