nginx-lua-ds-loadbalancer

程序名称:nginx-lua-ds-loadbalancer

授权协议: Apache

操作系统: 跨平台

开发语言: Lua

nginx-lua-ds-loadbalancer 介绍

nginx-lua-ds-loadbalancer 是一个HTTP负载均衡器,基于liseen/lua-resty-http

A http loadbalancer which is based on liseen/lua-resty-http

将代码放在位于nginx根目录下的lua/ds_lb/下

Put the code into the directory lua/ds_lb which is located in the root
directory of the nginx

在nginx.conf的http段中添加如下配置:

Add the config below to the http seg in nginx.conf:

lua_package_path "/u/nginx/lua/ds_lb/?.lua;;";
lua_need_request_body on;
init_by_lua_file lua/ds_lb/init.lua;

在nginx.conf的location段中添加如下配置:

Add the config below to the location seg in nginx.conf:

location / {
        content_by_lua_file lua/ds_lb/lb.lua;
    }

负载均衡器的配置在config.lua中

You can config loadbalancer with the file config.lua

可以自己定制调度策略,只需在sched文件夹下创建相关的调度策略文件,在其中提供get_selected_server()函数即可

You can custom your sched strategy by just creating the sched file in the
“sched” directory,and provide the function get_selected_server()

nginx-lua-ds-loadbalancer 官网

https://github.com/Hevienz/nginx-lua-ds-loadbalancer

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐