Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not set IP for backend server by Runtime API #2523

Open
rockbesst opened this issue Apr 9, 2024 · 2 comments
Open

Can not set IP for backend server by Runtime API #2523

rockbesst opened this issue Apr 9, 2024 · 2 comments
Labels
status: needs-triage This issue needs to be triaged. type: bug This issue describes a bug.

Comments

@rockbesst
Copy link

Detailed Description of the Problem

I'm trying to add new server to existing backend via Runtime API, but I can't set the IP address to new server. I tried few commands:
"add server back/node_name addr 10.0.0.10 port 8000" returns "unknown keyword '10.0.0.10'. (without port or with ip:8000 same result
"add server back/node_name" without options adding server, but
"set server back/node_name addr 10.0.0.10" returns "Update for the current server address family is only supported through configuration file by 'stats socket command'", but this command is the same as example from API documentation.

Am I doing something wrong?

Expected Behavior

As written in documentation, command must set IP and port to backend server

Steps to Reproduce the Behavior

  1. add server back/node_name
  2. set server back/node_name addr 10.0.0.10

Do you have any idea what may have caused this?

No response

Do you have an idea how to solve the issue?

No response

What is your configuration?

global
    stats socket /run/haproxy/admin.sock mode 660 level admin
    daemon
    maxconn 2000
    log stdout  format raw  local0  info

defaults
    balance leastconn
    timeout client 1800s
    timeout connect 10s
    timeout server 1800s
    log global
    option tcpka

frontend front
    bind *:33060
    mode tcp
    option tcplog
    log global
    default_backend back

backend back
    option mysql-check user haproxy
    server data1 10.0.0.20:33060 maxconn 500 check fall 2 inter 2000 rise 1 backup
    server data2 192.168.0.136:33060 maxconn 500 check fall 2 inter 2000 rise 1

Output of haproxy -vv

HAProxy version 2.8.9-1ppa1~jammy 2024/04/06 - https://haproxy.org/
Status: long-term supported branch - will stop receiving fixes around Q2 2028.
Known bugs: http://www.haproxy.org/bugs/bugs-2.8.9.html
Running on: Linux 5.15.0-102-generic #112-Ubuntu SMP Tue Mar 5 16:50:32 UTC 2024 x86_64
Build options :
  TARGET  = linux-glibc
  CPU     = generic
  CC      = cc
  CFLAGS  = -O2 -g -O2 -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wundef -Wdeclaration-after-statement -Wfatal-errors -Wtype-limits -Wshift-negative-value -Wshift-overflow=2 -Wduplicated-cond -Wnull-dereference -fwrapv -Wno-address-of-packed-member -Wno-unused-label -Wno-sign-compare -Wno-unused-parameter -Wno-clobbered -Wno-missing-field-initializers -Wno-cast-function-type -Wno-string-plus-int -Wno-atomic-alignment
  OPTIONS = USE_OPENSSL=1 USE_LUA=1 USE_SLZ=1 USE_SYSTEMD=1 USE_OT=1 USE_QUIC=1 USE_PROMEX=1 USE_PCRE2=1 USE_PCRE2_JIT=1 USE_QUIC_OPENSSL_COMPAT=1
  DEBUG   = -DDEBUG_STRICT -DDEBUG_MEMORY_POOLS

Feature list : -51DEGREES +ACCEPT4 +BACKTRACE -CLOSEFROM +CPU_AFFINITY +CRYPT_H -DEVICEATLAS +DL -ENGINE +EPOLL -EVPORTS +GETADDRINFO -KQUEUE -LIBATOMIC +LIBCRYPT +LINUX_CAP +LINUX_SPLICE +LINUX_TPROXY +LUA +MATH -MEMORY_PROFILING +NETFILTER +NS -OBSOLETE_LINKER +OPENSSL -OPENSSL_WOLFSSL +OT -PCRE +PCRE2 +PCRE2_JIT -PCRE_JIT +POLL +PRCTL -PROCCTL +PROMEX -PTHREAD_EMULATION +QUIC +QUIC_OPENSSL_COMPAT +RT +SHM_OPEN +SLZ +SSL -STATIC_PCRE -STATIC_PCRE2 +SYSTEMD +TFO +THREAD +THREAD_DUMP +TPROXY -WURFL -ZLIB

Default settings :
  bufsize = 16384, maxrewrite = 1024, maxpollevents = 200

Built with multi-threading support (MAX_TGROUPS=16, MAX_THREADS=256, default=2).
Built with OpenSSL version : OpenSSL 3.0.2 15 Mar 2022
Running on OpenSSL version : OpenSSL 3.0.2 15 Mar 2022
OpenSSL library supports TLS extensions : yes
OpenSSL library supports SNI : yes
OpenSSL library supports : TLSv1.0 TLSv1.1 TLSv1.2 TLSv1.3
OpenSSL providers loaded : default
Built with Lua version : Lua 5.3.6
Built with the Prometheus exporter as a service
Built with network namespace support.
Built with OpenTracing support.
Built with libslz for stateless compression.
Compression algorithms supported : identity("identity"), deflate("deflate"), raw-deflate("deflate"), gzip("gzip")
Built with transparent proxy support using: IP_TRANSPARENT IPV6_TRANSPARENT IP_FREEBIND
Built with PCRE2 version : 10.39 2021-10-29
PCRE2 library supports JIT : yes
Encrypted password support via crypt(3): yes
Built with gcc compiler version 11.4.0

Available polling systems :
      epoll : pref=300,  test result OK
       poll : pref=200,  test result OK
     select : pref=150,  test result OK
Total: 3 (3 usable), will use epoll.

Available multiplexer protocols :
(protocols marked as <default> cannot be specified using 'proto' keyword)
       quic : mode=HTTP  side=FE     mux=QUIC  flags=HTX|NO_UPG|FRAMED
         h2 : mode=HTTP  side=FE|BE  mux=H2    flags=HTX|HOL_RISK|NO_UPG
       fcgi : mode=HTTP  side=BE     mux=FCGI  flags=HTX|HOL_RISK|NO_UPG
         h1 : mode=HTTP  side=FE|BE  mux=H1    flags=HTX|NO_UPG
  <default> : mode=HTTP  side=FE|BE  mux=H1    flags=HTX
       none : mode=TCP   side=FE|BE  mux=PASS  flags=NO_UPG
  <default> : mode=TCP   side=FE|BE  mux=PASS  flags=

Available services : prometheus-exporter
Available filters :
        [BWLIM] bwlim-in
        [BWLIM] bwlim-out
        [CACHE] cache
        [COMP] compression
        [FCGI] fcgi-app
        [  OT] opentracing
        [SPOE] spoe
        [TRACE] trace

Last Outputs and Backtraces

No response

Additional Information

No response

@rockbesst rockbesst added status: needs-triage This issue needs to be triaged. type: bug This issue describes a bug. labels Apr 9, 2024
@Darlelet
Copy link
Contributor

Darlelet commented Apr 9, 2024

Hi,

To add a server you should use: add server back/name ip:port [args] *, where [args] have the same meaning as on a server line from the configuration.

Example:

add server back/node_name 10.0.0.10:8000

Maybe the documentation is not clear enough on this point, because addr in cli set server context has a different meaning from addr in cli add server or config server line.

"add server back/node_name" without options adding server, but
"set server back/node_name addr 10.0.0.10" returns "Update for the current server address family is only supported through configuration file by 'stats socket command'"

You have this error message because you added a server without an IP address from the CLI and then tried to set an address, but change from NONE to IPv4 is not supported from the CLI. You may add a dummy IPv4 address when creating the server so that you may change it later from the CLI.

@rockbesst
Copy link
Author

Hi,

To add a server you should use: add server back/name ip:port [args] *, where [args] have the same meaning as on a server line from the configuration. Maybe the documentation is not clear enough on this point, because addr in cli set server context has a different meaning from addr in cli add server or config server line.

"add server back/node_name" without options adding server, but
"set server back/node_name addr 10.0.0.10" returns "Update for the current server address family is only supported through configuration file by 'stats socket command'"

You have this error message because you added a server without an IP address from the CLI and then tried to set an address, but change from NONE to IPv4 is not supported from the CLI. You may add a dummy IPv4 address when creating the server so that you may change it later from the CLI.

Thank you very much, I almost broke my brain) I think, it's time to update documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs-triage This issue needs to be triaged. type: bug This issue describes a bug.
Projects
None yet
Development

No branches or pull requests

2 participants