Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-10004

Starting server should fail fast when server port and redis port are the same

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • 1.15.0
    • None
    • gfsh, redis

    Description

      When starting a cluster with GFSH with geode-for-redis enabled, starting a server fails when the geode-for-redis-port and server-port are set to the same port. It fails with the below stacktrace, but does not fail fast. We should be able to detect this issue before we reach the point of getting a bind exception.

      stacktrace:

      Exception in thread "main" java.lang.RuntimeException: An IO error occurred while starting a Server in /Users/hbales/workspace/geode/itch-proud-alpha on hbales-a01.vmware.com[6379]: Failed to create server socket on 192.168.0.4[6379]
      
          at org.apache.geode.distributed.ServerLauncher.start(ServerLauncher.java:863)
      
          at org.apache.geode.distributed.ServerLauncher.run(ServerLauncher.java:739)
      
          at org.apache.geode.distributed.ServerLauncher.main(ServerLauncher.java:258)
      
      Caused by: java.net.BindException: Failed to create server socket on 192.168.0.4[6379]
      
          at org.apache.geode.distributed.internal.tcpserver.ClusterSocketCreatorImpl.createServerSocket(ClusterSocketCreatorImpl.java:75)
      
          at org.apache.geode.internal.net.SCClusterSocketCreator.createServerSocket(SCClusterSocketCreator.java:55)
      
          at org.apache.geode.internal.net.SocketCreator.createServerSocket(SocketCreator.java:522)
      
          at org.apache.geode.internal.cache.tier.sockets.AcceptorImpl.<init>(AcceptorImpl.java:573)
      
          at org.apache.geode.internal.cache.tier.sockets.AcceptorBuilder.create(AcceptorBuilder.java:291)
      
          at org.apache.geode.internal.cache.CacheServerImpl.createAcceptor(CacheServerImpl.java:420)
      
          at org.apache.geode.internal.cache.CacheServerImpl.start(CacheServerImpl.java:377)
      
          at org.apache.geode.distributed.ServerLauncher.startCacheServer(ServerLauncher.java:1039)
      
          at org.apache.geode.distributed.ServerLauncher.start(ServerLauncher.java:837)
      
          ... 2 more
      
      Caused by: java.net.BindException: Address already in use (Bind failed)
      
          at java.net.PlainSocketImpl.socketBind(Native Method)
      
          at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:387)
      
          at java.net.ServerSocket.bind(ServerSocket.java:375)
      
          at org.apache.geode.distributed.internal.tcpserver.ClusterSocketCreatorImpl.createServerSocket(ClusterSocketCreatorImpl.java:72)
      
          ... 10 more
      

      series of GFSH commands that led to this error:

      > start locator
      > start server --J=-Dgemfire.geode-for-redis-enabled=true --J=-Dgemfire.geode-for-redis-port=6379 --server-port=6379
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              balesh2 Hale Bales
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: