shift31/haproxy-cluster-control

此包已被弃用且不再维护。未建议替代包。

通过 HTTP 管理HAProxy服务器集群的 CLI 工具

0.2.0 2015-07-02 16:57 UTC

This package is not auto-updated.

Last update: 2020-05-29 18:40:26 UTC


README

通过 HTTP 管理HAProxy服务器集群的 CLI 工具

安装

下载 haproxycc.phar,复制到 /usr/local/sbin,设置可执行权限,可选重命名为 haproxycc

配置

HAProxy

listen stats :8000
  mode http
  stats uri /stats
  stats auth username:password
  stats realm HAProxy
  stats admin if TRUE

haproxycc

HOME/etc 中创建 haproxycc.config.php

<?php

return [
    'environments' => [
        'qa' => [
            'servers'  => [
                // FQDN of each haproxy server
            ],
            'port'     => 8000,
            'baseUrl'  => '/stats',
            'username' => 'username',
            'password' => 'password'
        ]
    ],
    'backend_nickname_map' => [
        // optional, association of nicknames to backend names (as set in the haproxy config)
        // i.e. 'www' => 'www_http'
    ]
];

使用方法

使用 haproxycc list 列出可用的命令