# Class ZooKeeperServerMain

java.lang.Object
org.apache.zookeeper.server.ZooKeeperServerMain

@Public public class ZooKeeperServerMain extends Object
This class starts and runs a standalone ZooKeeperServer.

## Constructor Summary

Constructors
Constructor
Description
`ZooKeeperServerMain()`

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
Shutdowns properly the service, this method is not a public API.
`int`
`getClientPort()`
`int`
`getSecureClientPort()`
`protected void`
`initializeAndRun(String[] args)`
`static void`
`main(String[] args)`
`void`
`runFromConfig(ServerConfig config)`
Run from a ServerConfig.
`protected void`
`serverStarted()`
`protected void`
`shutdown()`
Shutdown the serving instance

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### ZooKeeperServerMain

public ZooKeeperServerMain()

## Method Details

### main

public static void main(String[] args)

### initializeAndRun

protected void initializeAndRun(String[] args) throws QuorumPeerConfig.ConfigException, IOException, AdminServer.AdminServerException

Throws:
  `QuorumPeerConfig.ConfigException`
  `IOException`
  `AdminServer.AdminServerException`

### runFromConfig

public void runFromConfig(ServerConfig config) throws IOException, AdminServer.AdminServerException
Run from a ServerConfig.

Parameters:
  `config` - ServerConfig to use.
Throws:
  `IOException`
  `AdminServer.AdminServerException`

### shutdown

protected void shutdown()
Shutdown the serving instance

### getClientPort

public int getClientPort()

### getSecureClientPort

public int getSecureClientPort()

### close

public void close()
Shutdowns properly the service, this method is not a public API.

### serverStarted

protected void serverStarted()