nginx grpc 试用
1. 编译
wget https://nginx.org/download/nginx-1.13.10.tar.gz
tar xvf nginx-1.13.10.tar.gz
cd nginx-1.13.10
./configure --with-http_ssl_module --with-http_v2_module
备注:需要安装pcre openssl
centos 操作为: yum install -y pcre-devel openssl-devel
upstream grpc9001 {
server 127.0.0.1:9001 weight=20 max_fails=2 fail_timeout=30s;
}
upstream grpc9000 {
server 127.0.0.1:9000 weight=20 max_fails=2 fail_timeout=30s;
}
server {
listen 80 http2;
server_name localhost;
location / {
root html;
index index.html index.htm;
grpc_pass grpc://grpc9001;
}
location /userserviceapp.UserServiceApp{
grpc_pass grpc://grpc9001;
}
location /echoservice.EchoService{
grpc_pass grpc://grpc9000;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
目前在使用 grpc-gateway中间件的时候存在内容content-type 的问题,具体的原因还需要进排查源码
对于grpc 的负载均衡以规则路由目前测试是没有问题的
https://www.nginx.com/blog/nginx-1-13-10-grpc/
https://mp.weixin.qq.com/s/kiMAMrPx_6lKYJlFwDK6rA
https://nginx.org/en/docs/http/ngx_http_grpc_module.html
nginx grpc 试用的更多相关文章
- Nginx grpc反向代理
L111 首先Grpc 默认编译进Nginx 但是依赖http_v2模块 需要编译进nginx 具体指令可以参考Nginx http 反向代理 指令都类似 分布式反向代理 server { serve ...
- elixir grpc 试用
备注: elixir grpc 封装测试 1. 安装 a. 安装 protoc 参考相关文档,比较简单 b. 安装elixir grpc 插件 protoc-gen-elixir 同时配置环 ...
- nginx报错整理
一. 1.线上有个域名出现一个访问报错: 413 Payload Too Large 这里贴一下关于这个报错的解释: The 413 (Payload Too Large) status code i ...
- Service Mesh - gRPC 本地联调远程服务
Description Service Mesh 架构下,服务间调用会通过服务名(Service Name)互相调用,比如在 Kubernetes .Docker Swarm 集群中,服务 IP 均由 ...
- RPC的故事
今天我跟几个RPC框架之间发生了一些事,情节跌宕起伏一波三折,不吐不快,以至于我这个从来不写博客的人也忍不住写下来分享一下. 背景 主系统部署在Windows上(.NET 4.5),子系统(.NET ...
- Emqtt集群搭建
1 Emqtt简单搭建 1.1 介绍:EMQ:EMQ 2.0,号称百万级开源MQTT消息服务器,基于Erlang/OTP语言平台开发,支持大规模连接和分布式集群,发布订阅模式的开源MQTT消息服务器 ...
- emqtt 分布集群及节点桥接搭建
目录 分布集群 emq@s1.emqtt.io 节点设置 emq@s2.emqtt.io 节点设置 节点加入集群 节点退出集群 节点发现与自动集群 manual 手动创建集群 基于 static 节点 ...
- Nginx宣布正式支持gRPC,附示例代码
原创 2018-03-20 薛命灯 聊聊架构 作者|Owen Garrett编辑|薛命灯 NGINX 官方博客正式宣布 NGINX 支持原生的 gPRC,现在就可以从代码仓库拉取快照版本.该特性将会被 ...
- nginx在centos 7中源码编译安装【添加grpc的支持】
安装依赖软件 1.安装编译工具gcc gcc是一个开源编译器集合,用于处理各种各样的语言:C.C++.Java.Ada等,在linux世界中是最通用的编译器,支持大量处理器:x86.AMD64.Pow ...
随机推荐
- Django 2.0 的路由如何实现正则表达式
在django2.0的路由系统中,摒弃了1.x中的url,而改用path.需要导入path. from django.urls import path,re_path 在1.x中,使用url()即可实 ...
- mongodb安装、运行
1.下载安装: 切换到:/usr/local/ mkdir -p mongodb groupadd -g 800 mongodb useradd -u 801 -g mongodb mongodb c ...
- Error:Cannot access first() element from an empty List
解决方案: bintray版本问题,修改为: classpath 'com.novoda:bintray-release:0.3.4' 如下: buildscript { repositories { ...
- Python之NumPy中线性代数
参考博客:http://blog.csdn.net/u013930163/article/details/51839983 网站:https://docs.scipy.org/doc/numpy-de ...
- POJ 3167 Cow Pattern ★(KMP好题)
题意 给你一个数字序列S,再给一个数字序列pattern,S和pattern中的数字都是1到s(s<=25).每个序列里的数字都有个排名,也就是第几小,现在我们要用pattern来匹配S.在本题 ...
- PKUSC2013 BUG集锦
如果今年考试真的是这个难度,那比的就是速度和准确度了…… a A:不明觉厉 B:推公式后不明觉厉 C:树的HASH D:不明觉厉 E:QAQ 复制代码'-'忘改'+' WA×1, F:QAQ 请输出 ...
- spring --解析自定义注解SpringAOP(配合@Aspect)
1:首先,声明自定义注解 @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD}) public @interface DtT ...
- ios 第2天
类的方法和实例的方法 -(void)runwithspeed:(int)speed and direction:(int)direction; 实例方法 -开头 运用对象调用 函数名为runwiths ...
- 20165202 2017-2018-2《Java程序设计》课程总结
每周作业链接汇总 ++预备作业一:我期待的师生关系++ ++预备作业二:学习基础和C语言基础调查++ ++预备作业三:linux安装及学习++ ++第一周作业:初识JAVA,注册码云并配置Git++ ...
- Talk to customer about the trouble with wireless failure connection。
It’s upset for me... 1 ATemel Studio61 and MKII program failure. Notes: The Flash file : A 90 is w ...