Zookeeper unable to start AdminServer, exiting abnormally when pseudo-cluster test on a single machine
The cause of this problem is known to everyone because after starting a zookeeper server, the default zkserver.cmd does not have a corresponding non-boot adminserver mask.
The code in Adminserverfactory.java is as follows
public static AdminServer Createadminserver () {if (!) False ". Equals (System.getproperty (" Zookeeper.admin.enableServer "))) {try {class<?> Jettya Dminserverc = Class.forName ("Org.apache.zookeeper.server.admin.JettyAdminServer"); Object adminserver = Jettyadminserverc.getconstructor (). newinstance (); Return (AdminServer) AdminServer; } catch (ClassNotFoundException e) {Log.warn ("Unable to start Jettyadminserver", E); } catch (Instantiationexception e) {Log.warn ("Unable to start Jettyadminserver", E); } catch (Illegalaccessexception e) {Log.warn ("Unable to start Jettyadminserver", E); } catch (InvocationTargetException e) {Log.warn ("Unable to start Jettyadminserver", E); } catch (Nosuchmethodexception e) {Log.warn ("Unable to start Jettyadminserver", E); } catch (NoclassdeffoundeRror e) {Log.warn ("Unable to load jetty, not starting Jettyadminserver", e); }} return new Dummyadminserver (); }
Because the first boot of zookeeper server has taken 8080 ports to occupy the
The code under Create Jettyadminserver is as follows:
Public Jettyadminserver () throws Adminserverexception {This (Integer.getinteger ("Zookeeper.admin.serverPort", Default_port), system.getproperty ("Zookeeper.admin.commandURL", Default_command_url)); }
So you can add "-dzookeeper.admin.enableserver=false" to the last call parameter in the Zkserver.cmd
Or
"-dzookeeper.admin.serverport= your port number."
Change the port number before starting it, so configure the cluster test in a standalone environment OK
Zookeeper a pseudo-cluster test on a single machine, unable to start AdminServer appears, exiting abnormally