title: create elasticsearch client throws a netty IllegalStateException
body: <p>elasticsearch version 5.4.3</p>
  
  <p>I use singleton to create a client , here is the main code</p>
  
  <pre><code>TransportClient tclient = null;
      if (clusterName != null) {
              Settings settings = Settings.builder()
                      .put("cluster.name",clusterName)
                      .put("client.transport.sniff", true)
                      .build();
              tclient = new PreBuiltTransportClient(settings);//here will throw the exception
      } else {
          tclient = new  PreBuiltTransportClient(Settings.EMPTY);
      }
  </code></pre>
  
  <p>when the first time run to the code "tclient = new PreBuiltTransportClient(settings);",it  throws a exception</p>
  
  <p><a href="https://i.stack.imgur.com/V7sg7.png" rel="nofollow noreferrer">IllegalStateException: availableProcessors is already set to [4]</a></p>
  
  <p>but invoke that for the second it will success,and client will be ceated,
  anyone knows how to fix it?</p>