pingcap / docs-cn

TiDB/TiKV/PD 中文文档
https://docs.pingcap.com/zh
Other
1.81k stars 1.21k forks source link

按照《HAProxy 在 TiDB 中的最佳实践》无法在 aws EC2 instance 上正常启动 haproxy #8403

Open Yui-Song opened 2 years ago

Yui-Song commented 2 years ago

Now, please describe your question here:

haproxy最佳实践的文档中,

  1. 以下命令在 aws 的 EC2 instance上即使加上 sudo 仍然没有权限执行 echo 'export PATH=/app/haproxy/bin:$PATH' >> /etc/profile

  2. 用上 sudo 和绝对路径启动 haproxy 仍然失败。

    $ sudo /home/centos/haproxy/bin/haproxy -f haproxy.cfg.new.cfg
    [NOTICE]   (7102) : haproxy version is 2.5.0-f2e0833f16
    [NOTICE]   (7102) : path to executable is /home/centos/haproxy/bin/haproxy
    [ALERT]    (7102) : [/home/centos/haproxy/bin/haproxy.main()] Cannot chroot(/var/lib/haproxy).

问题:请问以下两个haproxy配置是否有必要,可否去掉已使得最佳实践中的例子足够简单,让客户在不同环境中都能正常启动程序?或者至少补充云上使用的配置文件例子?

chroot     /var/lib/haproxy              # 更改当前目录并为启动进程设置超级用户权限,从而提高安全性。
pidfile     /var/run/haproxy.pid        # 将 HAProxy 进程的 PID 写入 pidfile
glkappe commented 2 years ago

it must be used: https://www.stigviewer.com/stig/vmw_vrealize_automation_7.x_ha_proxy/2018-10-12/finding/V-89157 pidfile is also same. https://cbonte.github.io/haproxy-dconv/1.9/configuration.html#pidfile

ran-huang commented 2 years ago

"以下命令在 aws 的 EC2 instance上即使加上 sudo 仍然没有权限执行" “用上 sudo 和绝对路径启动 haproxy 仍然失败” @glkappe 请问这两个问题有解吗?

Yui-Song commented 2 years ago

@glkappe 请问这个有什么进展吗? chroot /var/lib/haproxy这个配置我仍然在云上无法使用呢。现在需要更新 v6.0.0 的官方文档 TiDB TPC-C 性能对比测试报告 了,不知道有没有什么结论?如果没有我需要将这个配置从官方文档移除呢