HAProxyがサービスとして開始されていません。

HAProxyがサービスとして開始されていません。

SUDO権限を持たないユーザーからHAproxyを構成して開始する必要がありますか?全体的に結果が達成された。

/data/haproxy/haproxy -f /etc/haproxy/haproxy.cfg

標準出力:

[WARNING] 198/141606 (119143) : config : 'option forwardfor' ignored for frontend 'https-in' as it requires HTTP mode.
[WARNING] 198/141606 (119143) : config : 'option forwardfor' ignored for backend 'https-servers-basic' as it requires HTTP mode.
[WARNING] 198/141606 (119143) : config : 'option forwardfor' ignored for backend 'https-servers-redirect' as it requires HTTP mode.
[WARNING] 198/141606 (119143) : config : 'option forwardfor' ignored for backend 'https-servers-service' as it requires HTTP mode.

プロセスが正常に開始されます。

[test@ser-app-0001 haproxy]$ ps aux | grep haproxy
test   5109  0.3  0.0  49040  5224 ?        Ss   15:37   0:00 /data/haproxy/haproxy -f /etc/haproxy/haproxy.cfg

サービスを提供したいです。 /etc/systemd/system に ha.service ファイルを生成する

[Unit]
Description=ha.service
[Service]
Type=simple
User=test
WorkingDirectory=/data/haproxy/
ExecStart=/data/haproxy/haproxy -f /etc/haproxy/haproxy.cfg
SyslogIdentifier=ha.service-log
Restart=always
[Install]
WantedBy=multi-user.target

後ろに:

systemctl daemon-reload && systemctl start ha.service && systemctl status ha.service

サービスが実際に開始され、1〜2秒前に終了したことがわかりました。

Jul 18 15:41:26 ser-app-0001 systemd[1]: ha.service holdoff time over, scheduling restart.
Jul 18 15:41:26 ser-app-0001 systemd[1]: Started ha.service.
Jul 18 15:41:26 ser-app-0001 systemd[1]: Starting ha.service...
Jul 18 15:41:26 ser-app-0001 ha.service-log[5871]: [WARNING] 198/154126 (5871) : config : 'option forwardfor' ignored for frontend 'https-in' as it requires HTTP mode.
Jul 18 15:41:26 ser-app-0001 ha.service-log[5871]: [WARNING] 198/154126 (5871) : config : 'option forwardfor' ignored for backend 'https-servers-basic' as it requires HTTP mode.
Jul 18 15:41:26 ser-app-0001 ha.service-log[5871]: [WARNING] 198/154126 (5871) : config : 'option forwardfor' ignored for backend 'https-servers-redirect' as it requires HTTP mode.
Jul 18 15:41:26 ser-app-0001 ha.service-log[5871]: [WARNING] 198/154126 (5871) : config : 'option forwardfor' ignored for backend 'https-servers-service' as it requires HTTP mode.
Jul 18 15:41:26 ser-app-0001 systemd[1]: ha.service holdoff time over, scheduling restart.
Jul 18 15:41:26 ser-app-0001 systemd[1]: start request repeated too quickly for ha.service
Jul 18 15:41:26 ser-app-0001 systemd[1]: Failed to start ha.service.
Jul 18 15:41:26 ser-app-0001 systemd[1]: Unit ha.service entered failed state.
Jul 18 15:41:26 ser-app-0001 systemd[1]: ha.service failed.

この問題をどのように解決しますか?

ベストアンサー1

おすすめ記事