首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >HAProxy无法启动

HAProxy无法启动
EN

Stack Overflow用户
提问于 2017-10-02 14:25:19
回答 1查看 13.6K关注 0票数 2

我似乎无法启动我的HAProxy,你知道是什么导致了这个问题吗?

代码语言:javascript
复制
root@haproxy-www:/# service haproxy restart
root@haproxy-www:/# service haproxy status
haproxy.service - HAProxy Load Balancer
   Loaded: loaded (/lib/systemd/system/haproxy.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Mon 2017-10-02 17:21:11 AEDT; 4s ago
     Docs: man:haproxy(1)
           file:/usr/share/doc/haproxy/configuration.txt.gz
  Process: 11014 ExecStart=/usr/sbin/haproxy-systemd-wrapper -f ${CONFIG} -p /run/haproxy.pid $EXTRAOPTS (code=exited, status=0/SUCCESS)
  Process: 11011 ExecStartPre=/usr/sbin/haproxy -f ${CONFIG} -c -q (code=exited, status=0/SUCCESS)
 Main PID: 11014 (code=exited, status=0/SUCCESS)

Oct 02 17:21:11 haproxy-www systemd[1]: haproxy.service: Service hold-off time over, scheduling restart.
Oct 02 17:21:11 haproxy-www systemd[1]: Stopped HAProxy Load Balancer.
Oct 02 17:21:11 haproxy-www systemd[1]: haproxy.service: Start request repeated too quickly.
Oct 02 17:21:11 haproxy-www systemd[1]: Failed to start HAProxy Load Balancer.
root@haproxy-www:/# 

这是我的haproxy.cfg文件

全局日志/dev/log local0日志/dev/log local1通知chroot /var/lib/haproxy stats socket /run/ haproxy /admin.sock模式660级别管理员统计信息超时30s用户haproxy组haproxy守护进程

代码语言:javascript
复制
    # Default SSL material locations
    ca-base /etc/ssl/certs
    crt-base /etc/ssl/private

    # Default ciphers to use on SSL-enabled listening sockets.
    # For more information, see ciphers(1SSL). This list is from:
    #  https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
    ssl-default-bind-ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS
    ssl-default-bind-options no-sslv3

defaults
        log     global
        mode    tcp
        option  tcplog
        option  dontlognull
        timeout connect 5000
        timeout client  50000
        timeout server  50000
        errorfile 400 /etc/haproxy/errors/400.http
        errorfile 403 /etc/haproxy/errors/403.http
        errorfile 408 /etc/haproxy/errors/408.http
        errorfile 500 /etc/haproxy/errors/500.http
        errorfile 502 /etc/haproxy/errors/502.http
        errorfile 503 /etc/haproxy/errors/503.http
        errorfile 504 /etc/haproxy/errors/504.http

frontend www
        bind ***.***.***.**:80
        default_backend site-backend

backend site-backend
        balance roundrobin
        mode tcp
        server webserver-1 10.240.0.178:80 check
        server webserver-2 10.240.0.42:80 check

谢谢=)

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-11-09 22:44:04

我有一个类似的问题,我用这个解决了:

Haproxy需要写入/run/haproxy/admin.sock,但它不会为您创建目录。首先创建目录/run/haproxy/或将stats套接字设置为其他路径。

Source

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46520428

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档