How to download and run HA-Proxy Data Plane API on Mac Intel Chip

Discussão em 'Angular' iniciado por Syed Shaheer Ali Zaidi, Novembro 30, 2024.

  1. i am a frontend end dev. I was trying to run backend locally to test services of frontend. To run backend we need to have HA-Proxy and HAProxy Data Plane API.

    So, i downloaded HA-Proxy via Home-brew on MacBook Pro Intel Chip using

    ~% brew install haproxy


    After that to verify the version, i used:

    ~% haproxy -version
    HAProxy version 3.1.0-f2b9791 2024/11/26 - https://haproxy.org/
    Status: stable branch - will stop receiving fixes around Q1 2026.
    Known bugs: http://www.haproxy.org/bugs/bugs-3.1.0.html
    Running on: Darwin 22.6.0 Darwin Kernel Version 22.6.0: Wed Jul 31 21:42:48 PDT 2024; root:xnu-8796.141.3.707.4~1/RELEASE_X86_64 x86_64


    Which shows HA-Proxy is installed successfully , to find out the path i used:

    ~% which haproxy
    /usr/local/bin/haproxy


    Now it was time to download HA-Proxy Data Plane API, so i head towards https://github.com/haproxytech/dataplaneapi/releases/ And downloaded


    dataplaneapi_3.0.3_darwin_x86_64.tar.gz
    ​

    After unziping it using

    tar -xvzf dataplaneapi_3.0.3_darwin_x86_64.tar.gz


    Few Files showed up, dataplaneapi, dataplaneapi.yml.dist, LINCENSE, README.md, CHANGELOG.md

    So according to steps mentioned in "https://www.haproxy.com/documentation/haproxy-data-plane-api/installation/install-on-haproxy/"

    chmod +x dataplaneapi


    Copy the dataplaneapi program to /usr/local/bin/:

    sudo cp dataplaneapi /usr/local/bin/


    Copy the Data Plane API configuration file to /etc/haproxy/dataplaneapi.yml:

    sudo cp dataplaneapi.yml.dist /etc/haproxy/dataplaneapi.yml


    After that i checked dataplaneAPI version:

    ~% dataplaneapi --version
    2024/11/30 13:17:19 maxprocs: Leaving GOMAXPROCS=8: CPU quota undefined
    2024/11/30 13:17:19 INFO GOMEMLIMIT is already set, skipping package=github.com/KimMachineGun/automemlimit/memlimit GOMEMLIMIT=512MiB
    HAProxy Data Plane API v3.0.3 f1d4189a

    Build from: https://github.com/haproxytech/dataplaneapi
    Build date: 2024-10-10T13:42:11Z


    Now when i try to run

    sudo dataplaneapi -f /etc/haproxy/dataplaneapi.yml
    2024/11/30 13:23:40 maxprocs: Leaving GOMAXPROCS=8: CPU quota undefined
    2024/11/30 13:23:40 ERROR failed to set GOMEMLIMIT package=github.com/KimMachineGun/automemlimit/memlimit error="failed to set GOMEMLIMIT: cgroups is not supported on this system"


    What is this error and how to resolve it:

    ERROR failed to set GOMEMLIMIT package=github.com/KimMachineGun/automemlimit/memlimit error="failed to set GOMEMLIMIT: cgroups is not supported on this system"


    Let just say i ignore this error and continue:

    ~% sudo curl http://127.0.0.1:5555/v2/services/haproxy/configuration/version

    curl: (7) Failed to connect to 127.0.0.1 port 5555 after 0 ms: Couldn't connect to server


    Lets track it down from logs:

    ~% tail -f /var/log/dataplaneapi.log
    time="2024-11-30T13:23:41+05:00" level=fatal msg="Error initializing configuration client: error setting up configuration client: failed to find HAProxy: path to HAProxy binary not valid: /usr/sbin/haproxy, err: fork/exec /usr/sbin/haproxy: no such file or directory"


    Then i

    sudo nano /usr/local/etc/dataplaneapi.yml


    and set the path according to my home brew HAproxy location in HAproxy Section but still the problem persists. Please let me know alternative way to install and run HA Proxy Data plane API in MAC. I am tired.

    Continue reading...

Compartilhe esta Página