Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-2326

Include connected server address:port in log

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.5.2, 3.6.0
    • Component/s: java client
    • Labels:
      None

      Description

      Currently ZooKeeper client log contains blank myid as bellow

      2015-11-18 23:46:39,045 [myid:] - INFO  [main-SendThread(192.168.1.3:2183):ClientCnxn$SendThread@1138] - Opening socket connection to server 192.168.1.3/192.168.1.3:2183. Will attempt to SASL-authenticate using Login Context section 'Client'
      2015-11-18 23:46:40,387 [myid:] - WARN  [main-SendThread(192.168.1.3:2183):ClientCnxn$SendThread@1206] - Client session timed out, have not heard from server in 1499ms for sessionid 0x200009eb6510002
      2015-11-18 23:46:40,387 [myid:] - INFO  [main-SendThread(192.168.1.3:2183):ClientCnxn$SendThread@1254] - Client session timed out, have not heard from server in 1499ms for sessionid 0x200009eb6510002, closing socket connection and attempting reconnect
      2015-11-18 23:46:41,323 [myid:] - INFO  [main-SendThread(192.168.1.3:2181):ZooKeeperSaslClient@235] - Client will use DIGEST-MD5 as SASL mechanism.
      

      myid is blank. it is fine as at client side myid(serverid ) does not make any sense. But we can assign myid serverIP: port which will be a very helpful information in analysing the issues. So we after fix we can have log as bellow

      2015-11-19 03:51:27,254 [myid:192.168.1.3:2183] - INFO  [main-SendThread(192.168.1.3:2183):Login@290] - successfully logged in.
      2015-11-19 03:51:27,270 [myid:192.168.1.3:2183] - INFO  [Thread-0:Login$1@124] - TGT refresh thread started.
      2015-11-19 03:51:27,270 [myid:192.168.1.3:2183] - INFO  [main-SendThread(192.168.1.3:2183):ZooKeeperSaslClient$1@297] - Client will use GSSAPI as SASL mechanism.
      2015-11-19 03:51:27,270 [myid:192.168.1.3:2183] - INFO  [Thread-0:Login@298] - TGT valid starting at:        Thu Nov 19 03:51:27 IST 2015
      2015-11-19 03:51:27,270 [myid:192.168.1.3:2183] - INFO  [Thread-0:Login@299] - TGT expires:                  Thu Nov 19 03:53:27 IST 2015
      2015-11-19 03:51:27,270 [myid:192.168.1.3:2183] - INFO  [Thread-0:Login$1@178] - TGT refresh sleeping until: Thu Nov 19 03:53:05 IST 2015
      2015-11-19 03:51:27,285 [myid:192.168.1.3:2183] - INFO  [main-SendThread(192.168.1.3:2183):ClientCnxn$SendThread@1141] - Opening socket connection to server 192.168.1.3/192.168.1.3:2183. Will attempt to SASL-authenticate using Login Context section 'Client'
      2015-11-19 03:51:27,301 [myid:192.168.1.3:2183] - INFO  [main-SendThread(192.168.1.3:2183):ClientCnxn$SendThread@981] - Socket connection established, initiating session, client: /192.168.1.2:53117, server: 192.168.1.3/192.168.1.3:2183
      2015-11-19 03:51:28,632 [myid:192.168.1.3:2183] - WARN  [main-SendThread(192.168.1.3:2183):ClientCnxn$SendThread@1209] - Client session timed out, have not heard from server in 1333ms for sessionid 0x0
      2015-11-19 03:51:28,632 [myid:192.168.1.3:2183] - INFO  [main-SendThread(192.168.1.3:2183):ClientCnxn$SendThread@1257] - Client session timed out, have not heard from server in 1333ms for sessionid 0x0, closing socket connection and attempting reconnect
      2015-11-19 03:51:29,147 [myid:192.168.1.3:2181] - INFO  [main-SendThread(192.168.1.3:2181):ZooKeeperSaslClient$1@297] - Client will use GSSAPI as SASL mechanism.
      2015-11-19 03:51:29,152 [myid:192.168.1.3:2181] - INFO  [main-SendThread(192.168.1.3:2181):ClientCnxn$SendThread@1141] - Opening socket connection to server 192.168.1.3/192.168.1.3:2181. Will attempt to SASL-authenticate using Login Context section 'Client'
      2015-11-19 03:51:29,154 [myid:192.168.1.3:2181] - INFO  [main-SendThread(192.168.1.3:2181):ClientCnxn$SendThread@981] - Socket connection established, initiating session, client: /192.168.1.2:53118, server: 192.168.1.3/192.168.1.3:2181
      2015-11-19 03:51:30,487 [myid:192.168.1.3:2181] - WARN  [main-SendThread(192.168.1.3:2181):ClientCnxn$SendThread@1209] - Client session timed out, have not heard from server in 1333ms for sessionid 0x0
      

        Attachments

          Activity

            People

            • Assignee:
              arshad.mohammad Mohammad Arshad
              Reporter:
              arshad.mohammad Mohammad Arshad
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: