haproxy2.0 dataplaneapi 简单说明
haproxy2.0 支持基于dataplaneapi 的haproxy 动态配置修改以及服务生效,早期大家为了动态
可以会基于dsn 的服务发现模式,基于confd 结合consul 动态生成配置并加载,现在支持了基于
api 的控制,还是很方便的
帮助命令
Usage:
dataplaneapi [OPTIONS]
API for editing and managing haproxy instances
Application Options:
--scheme= the listeners to enable, this can be repeated and defaults to the schemes in the swagger spec
--cleanup-timeout= grace period for which to wait before killing idle connections (default: 10s)
--graceful-timeout= grace period for which to wait before shutting down the server (default: 15s)
--max-header-size= controls the maximum number of bytes the server will read parsing the request header's keys and values, including the request line. It does not limit the size
of the request body. (default: 1MiB)
--socket-path= the unix socket to listen on (default: /var/run/data-plane.sock)
--host= the IP to listen on (default: localhost) [$HOST]
--port= the port to listen on for insecure connections, defaults to a random value [$PORT]
--listen-limit= limit the number of outstanding requests
--keep-alive= sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download) (default: 3m)
--read-timeout= maximum duration before timing out read of the request (default: 30s)
--write-timeout= maximum duration before timing out write of the response (default: 60s)
--tls-host= the IP to listen on for tls, when not specified it's the same as --host [$TLS_HOST]
--tls-port= the port to listen on for secure connections, defaults to a random value [$TLS_PORT]
--tls-certificate= the certificate to use for secure connections [$TLS_CERTIFICATE]
--tls-key= the private key to use for secure connections [$TLS_PRIVATE_KEY]
--tls-ca= the certificate authority file to be used with mutual tls auth [$TLS_CA_CERTIFICATE]
--tls-listen-limit= limit the number of outstanding requests
--tls-keep-alive= sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)
--tls-read-timeout= maximum duration before timing out read of the request
--tls-write-timeout= maximum duration before timing out write of the response
HAProxy options:
-c, --config-file= Path to the haproxy configuration file (default: /etc/haproxy/haproxy.cfg)
-u, --userlist= Userlist in HAProxy configuration to use for API Basic Authentication (default: controller)
-b, --haproxy-bin= Path to the haproxy binary file (default: haproxy)
-d, --reload-delay= Minimum delay between two reloads (in s) (default: 5)
-r, --reload-cmd= Reload command
-s, --restart-cmd= Restart command
--reload-retention= Reload retention in days, every older reload id will be deleted (default: 1)
-t, --transaction-dir= Path to the transaction directory (default: /tmp/haproxy)
-n, --backups-number= Number of backup configuration files you want to keep, stored in the config dir with version number suffix (default: 0)
-m, --master-runtime= Path to the master Runtime API socket
-i, --show-system-info Show system info on info endpoint
Logging options:
--log-to=[stdout|file] Log target, can be stdout or file (default: stdout)
--log-file= Location of the log file (default: /var/log/dataplaneapi/dataplaneapi.log)
--log-level=[trace|debug|info|warning|error] Logging level (default: warning)
--log-format=[text|JSON] Logging format (default: text)
Show version:
-v, --version Version and build information
Help Options:
-h, --help Show this help message
<wiz_tmp_tag class="wiz-block-scroll">
启动
- 普通方式
./dataplaneapi --port 5555 -b /usr/sbin/haproxy -c /etc/haproxy/haproxy.cfg -d 5 -r "service haproxy reload" -s "service haproxy restart" -u dataplaneapi -t /tmp/haproxy
- 容器方式
./dataplaneapi --host 0.0.0.0 --port 5555 --haproxy-bin /usr/sbin/haproxy --config-file /etc/haproxy/haproxy.cfg --reload-cmd "kill -SIGUSR2 1" --reload-delay 5 --userlist controller
- api 请求方式
curl -u <user>:<pass> -H "Content-Type: application/json" "http://127.0.0.1:5555/v1/"
- haproxy 2.0 的process manager
program api
command dataplaneapi --host 0.0.0.0 --port 5555 --haproxy-bin /usr/sbin/haproxy --config-file /etc/haproxy/haproxy.cfg --reload-cmd "systemctl reload haproxy" --reload-delay 5 --userlist controller
说明
haproxy2.0 的扩展能力还是很不错的,而且源码在github 开放的,后续基于docker 运行下dataplaneapi,试用下功能
api 参考资料
https://www.haproxy.com/documentation/hapee/1-9r1/configuration/dataplaneapi/
https://github.com/haproxytech/dataplaneapi
haproxy2.0 dataplaneapi 简单说明的更多相关文章
- haproxy 2.0 dataplaneapi rest api 几个方便的问题排查接口
在使用haproxy 2.0 dataplaneapi的时候,刚开始的时候我们可能需要进行调试,保证我们的配置在我们的系统环境中 是可以使用的,以下是自己在当前学习中为了排查问题会使用的几个api 创 ...
- haproxy 2.0 dataplaneapi rest api 转为graphql
haproxy 2.0 dataplaneapi rest api 是比较全的,以下是一个简单的集成graphql,通过swagger-to-graphql 转换为graphql api 方便使用 环 ...
- haproxy 2.0 dataplaneapi docker 镜像
为了方便测试dataplaneapi 基于官方的docker镜像,制作了一个简单的包含dataplaneapi 的镜像 下载dataplaneapi https://github.com/haprox ...
- Asp.Net MVC+BootStrap+EF6.0实现简单的用户角色权限管理
这是本人第一次写,写的不好的地方还忘包含.写这个的主要原因是想通过这个来学习下EF的CodeFirst模式,本来也想用AngularJs来玩玩的,但是自己只会普通的绑定,对指令这些不是很熟悉,所以就基 ...
- 云优化的概念、Entity Framework 7.0、简单吞吐量压力测试
云优化的概念.Entity Framework 7.0.简单吞吐量压力测试 继续上一篇<开发 ASP.NET vNext 初步总结(使用Visual Studio 2014 CTP1)>之 ...
- Android 6.0 超级简单的权限申请2 (Permission)
代码地址如下:http://www.demodashi.com/demo/13506.html 写在前面 上次写了一个权限申请的例子Android 6.0 超级简单的权限申请 (Permission) ...
- Android 6.0 超级简单的权限申请 (Permission)
代码地址如下:http://www.demodashi.com/demo/13369.html 背景描述 随着Android系统的不断升级,谷歌对用户的隐私是越来越注重了,给我们开发者带来了更多的繁琐 ...
- haproxy2.0入门部署教程
测试后发现,haproxy2.0和之前的版本部署有些许差异,配置文件的写法也是不同的 测试环境:Centos7.3 IP:172.16.1.227 172.16.1.228 部署httpd,页面内容为 ...
- 用Vue2.0实现简单的分页及跳转
用Vue2.0实现简单的分页及跳转 2018年07月26日 20:29:51 Freya_yyy 阅读数 3369 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog ...
随机推荐
- java中String字符串
一.定义String字符串 String字符串和char字符不同,char使用单引号,只能表示一个字符,字符串就是一段文本.String是个类.这个类使用final修饰,所以这个类是不可以继承扩充和修 ...
- Echarts 学习系列(1)-5分钟上手ECharts
目录 写在前面 下载Echarts和主题 绘制一个简单的图表 写在前面 最近,在做某个项目的时候.需要使用的可视化的图表显数据.最后,选择了百度的Echarts. 下载Echarts和主题 1.获取E ...
- C# vb .NET读取识别条形码线性条码code128
code128是比较常见的条形码编码规则类型的一种.如何在C#,vb等.NET平台语言里实现快速准确读取该类型条形码呢?答案是使用SharpBarcode! SharpBarcode是C#快速高效.准 ...
- 详细的Hadoop的入门教程-完全分布模式Fully-Distributed Operation
1. 前面在伪分布模式下已经创建了一台机器,为了统一命名,hostname更名为hadoop01.然后再克隆2台机器:hadoop02. hadoop03:将第一台机器hadoop01上的伪分布停止, ...
- Map接口---Day20
Map接口概述: 现实生活中,我们常会看到这样的一种集合:IP地址与主机名,身份证号与个人,系统用户名与系统用户对象等, 这种一一对应的关系,就叫做映射.Java提供了专门的集合类用来存放这种对象关系 ...
- 【转载】C#的DataTable使用NewRow方法创建新表格行
在C#的DataTable数据表格操作过程中,DataRow类表示DataTable中的数据行信息,但DataRow没有可以直接实例化的构造方法,在创建DataTable的新行的时候,不可直接使用Da ...
- day 39
ORM 对象关系映射 表 ---> 类 字段 ---> 属性 记录 ---> 对象 优点: 使用者无需关心具体的SQL命令如何编写. 直接通过调用方法,来执行相对应的SQL命 ...
- RabbitMQ基本概念(一)-RabbitMQ的优劣势及产生背景
本篇并没有直接讲到技术,例如没有先写个Helloword.我想在选择了解或者学习一门技术之前先要明白为什么要现在这个技术而不是其他的,以免到最后发现自己学错了.同时如果已经确定就是他,最好先要了解下技 ...
- 为什么要将action实例设置为多例
转载自 https://zhidao.baidu.com/question/622162406833405932.html struts2中action是多例的,即一个session产生一个actio ...
- crontab定时任务不执行,单独运行sh生效
虽然已经从事运维两三年了. 但是今天写的计划任务没有执行,排除了下, 这里整理下,方便后期查看. 排除思路 1. 确保crond服务是开机自启和当前是启动的. # centos systemctl s ...