ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    RHEL7 Unable to bind HAProxy Stats to TCP Port 82

    IT Discussion
    rhel haproxy tcp centos rhel 7 centos 7 networking load balancer
    5
    10
    4.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • coliverC
      coliver
      last edited by scottalanmiller

      I'm having some issues binding the stats page of HAProxy to TCP port 82.

      I get the following error when trying to start HAProxy

      Starting proxy stats: cannot bind socket [0.0.0.0:82]
      

      I ran lsof -i and got the following

      COMMAND     PID       USER   FD   TYPE   DEVICE SIZE/OFF NODE NAME
      rsyslogd    646       root    3u  IPv4    14472      0t0  UDP localhost:syslog
      sshd       1245       root    3u  IPv4    17539      0t0  TCP *:ssh (LISTEN)
      sshd       1245       root    4u  IPv6    17541      0t0  TCP *:ssh (LISTEN)
      master     1855       root   13u  IPv4    17134      0t0  TCP localhost:smtp (LISTEN)
      master     1855       root   14u  IPv6    17135      0t0  TCP localhost:smtp (LISTEN)
      miniserv.  7685       root    4u  IPv4  7578132      0t0  TCP *:ndmp (LISTEN)
      miniserv.  7685       root    5u  IPv4  7578133      0t0  UDP *:ndmp
      sshd      15479       root    3u  IPv4 11578603      0t0  TCP hostname:ssh->clientname:63141 (ESTABLISHED)
      sshd      15484 delhiadmin    3u  IPv4 11578603      0t0  TCP hostname:ssh->clientname:63141 (ESTABLISHED)
      

      Running nmap -sT -O localhost returns:

      PORT      STATE SERVICE
      22/tcp    open  ssh
      25/tcp    open  smtp
      10000/tcp open  snet-sensor-mgmt
      

      Any ideas what else I can try to see what is using this port?

      dafyreD 1 Reply Last reply Reply Quote 2
      • DustinB3403D
        DustinB3403
        last edited by

        My initial question is, are you forced to use Port 82?

        Take a look here

        coliverC 1 Reply Last reply Reply Quote 0
        • coliverC
          coliver @DustinB3403
          last edited by

          @DustinB3403 said:

          My initial question is, are you forced to use Port 82?

          Yes

          Take a look here

          tcp        0      0 0.0.0.0:10000           0.0.0.0:*               LISTEN      7685/perl
          tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1245/sshd
          tcp        3      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1855/master
          tcp6       0      0 :::22                   :::*                    LISTEN      1245/sshd
          tcp6       0      0 ::1:25                  :::*                    LISTEN      1855/master
          
          1 Reply Last reply Reply Quote 0
          • JaredBuschJ
            JaredBusch
            last edited by JaredBusch

            Disabke SELinux and see if it works. Then if so, add the port as allowed to SELinux?

            coliverC 1 Reply Last reply Reply Quote 1
            • scottalanmillerS
              scottalanmiller
              last edited by

              Are you running this as root? It will fail on port 82 if you are not root.

              coliverC 1 Reply Last reply Reply Quote 1
              • coliverC
                coliver @scottalanmiller
                last edited by

                @scottalanmiller said:

                Are you running this as root? It will fail on port 82 if you are not root.

                It is running as a service, not sure if that is running as root or not?

                1 Reply Last reply Reply Quote 0
                • dafyreD
                  dafyre @coliver
                  last edited by

                  @coliver said:

                  I'm having some issues binding the stats page of HAProxy to TCP port 82.

                  I get the following error when trying to start HAProxy

                  Starting proxy stats: cannot bind socket [0.0.0.0:82]
                  

                  I ran lsof -i and got the following

                  COMMAND     PID       USER   FD   TYPE   DEVICE SIZE/OFF NODE NAME
                  rsyslogd    646       root    3u  IPv4    14472      0t0  UDP localhost:syslog
                  sshd       1245       root    3u  IPv4    17539      0t0  TCP *:ssh (LISTEN)
                  sshd       1245       root    4u  IPv6    17541      0t0  TCP *:ssh (LISTEN)
                  master     1855       root   13u  IPv4    17134      0t0  TCP localhost:smtp (LISTEN)
                  master     1855       root   14u  IPv6    17135      0t0  TCP localhost:smtp (LISTEN)
                  miniserv.  7685       root    4u  IPv4  7578132      0t0  TCP *:ndmp (LISTEN)
                  miniserv.  7685       root    5u  IPv4  7578133      0t0  UDP *:ndmp
                  sshd      15479       root    3u  IPv4 11578603      0t0  TCP hostname:ssh->clientname:63141 (ESTABLISHED)
                  sshd      15484 delhiadmin    3u  IPv4 11578603      0t0  TCP hostname:ssh->clientname:63141 (ESTABLISHED)
                  

                  Running nmap -sT -O localhost returns:

                  PORT      STATE SERVICE
                  22/tcp    open  ssh
                  25/tcp    open  smtp
                  10000/tcp open  snet-sensor-mgmt
                  

                  Any ideas what else I can try to see what is using this port?

                  Try

                  netstat -anp
                  
                  1 Reply Last reply Reply Quote 0
                  • coliverC
                    coliver @JaredBusch
                    last edited by

                    @JaredBusch said:

                    Disabke SELinux and see if it works. Then if so, add the port as allowed to SELinux?

                    Looks like it was SELinux, setting it to permissive allowed the port to be used. Now to figure out how to allow the port in SELinux.

                    JaredBuschJ 1 Reply Last reply Reply Quote 2
                    • JaredBuschJ
                      JaredBusch @coliver
                      last edited by JaredBusch

                      @coliver said:

                      @JaredBusch said:

                      Disabke SELinux and see if it works. Then if so, add the port as allowed to SELinux?

                      Looks like it was SELinux, setting it to permissive allowed the port to be used. Now to figure out how to allow the port in SELinux.

                      semanage port -m -t http_port_t -p tcp 82
                      
                      coliverC 1 Reply Last reply Reply Quote 2
                      • coliverC
                        coliver @JaredBusch
                        last edited by

                        @JaredBusch said:

                        @coliver said:

                        @JaredBusch said:

                        Disabke SELinux and see if it works. Then if so, add the port as allowed to SELinux?

                        Looks like it was SELinux, setting it to permissive allowed the port to be used. Now to figure out how to allow the port in SELinux.

                        semanage port -m -t http_port_t -p tcp 82
                        

                        That did it thanks.

                        1 Reply Last reply Reply Quote 1
                        • 1 / 1
                        • First post
                          Last post