|
GemFire 5.5.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.gemstone.gemfire.distributed.Locator
public abstract class Locator
Represents a distribution locator server that provides discovery
information to members of a GemFire distributed system. In most
GemFire distributed cache architectures, distribution locators are
run in their own process. A stand-alone locator process is
managed using the GemFire console, administration API,
or the gemfire command line utility:
$ gemfire start-locatorThe stand-alone locator configuration provides high-availability of the membership information.
This class allows a GemFire application VM to host a distribution locator. Such a configuration minimizes the number of processes that are required to run GemFire. However, hosting distribution locators is not generally recommended because if the application VM exits, the primary membership list for the distributed system would be lost and it would not be possible for new applications to connect to the distributed system.
It is important to remember that an application that hosts a distribution locator must start its locator before it (or any other potentialy member) connects to the distributed system.
| Constructor Summary | |
|---|---|
Locator()
|
|
| Method Summary | |
|---|---|
InetAddress |
getBindAddress()
Returns the IP address to which this locator's listening socket is bound. |
abstract DistributedSystem |
getDistributedSystem()
Returns the distributed system started by this locator, if any |
static Collection |
getLocators()
Returns an unmodifiable collection of all of the Locators that are hosted by this VM. |
File |
getLogFile()
Returns the log file to which this locator's output is written |
int |
getPort()
Returns the port on which this locator runs |
static boolean |
hasLocators()
Examine the size of the collection of locators running in this VM |
static void |
main(String[] args)
Starts a distribution locator from the command line. |
static Locator |
startLocator(int port,
File logFile)
Starts a new distribution locator host by this VM. |
static Locator |
startLocator(int port,
File logFile,
InetAddress bindAddress)
Starts a new distribution locator host by this VM. |
static Locator |
startLocatorAndDS(int port,
File logFile,
InetAddress bindAddress,
Properties dsProperties)
Starts a new distribution locator host by this VM that binds to the given network address. |
static Locator |
startLocatorAndDS(int port,
File logFile,
Properties distributedSystemProperties)
Starts a new distribution locator host by this VM, and an admin distributed system controlled by the locator. |
abstract void |
stop()
Stops this distribution locator. |
String |
toString()
Returns a brief description of this Locator |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Locator()
| Method Detail |
|---|
public static Locator startLocator(int port,
File logFile)
throws IOException
The locator will not start a distributed system.
port - The port on which the locator will listen for membership
information requests from new memberslogFile - The file to which the locator logs information. The
directory that contains the log file is used as the output
directory of the locator (see -dir option to
the gemfire command).
IllegalArgumentException - If port is not in the range 0 to 65536
SystemIsRunningException - If another locator is already running in
outputDir
GemFireIOException - If the directory containing the logFile does
not exist or cannot be written to
IOException - If the locator cannot be started
public static Locator startLocatorAndDS(int port,
File logFile,
Properties distributedSystemProperties)
throws IOException
The locator starts a AdminDistributedSystem configured with the given properties to provide the system with a long-running process that can be relied on for stable membership information.
port - The port on which the locator will listen for membership
information requests from new memberslogFile - The file to which the locator logs information. The
directory that contains the log file is used as the output
directory of the locator (see -dir option to
the gemfire command).distributedSystemProperties - The properties used to configure the locator's distributed
system. If there are multiple locators in the system,
this should note them in the "locators" setting. If
The distributed system is using multicast, the "mcast-port"
should also be set.
IllegalArgumentException - If port is not in the range 0 to 65536
SystemIsRunningException - If another locator is already running in
outputDir
GemFireIOException - If the directory containing the logFile does
not exist or cannot be written to
IOException - If the locator cannot be started
public static Locator startLocator(int port,
File logFile,
InetAddress bindAddress)
throws IOException
The locator will not start a distributed system.
port - The port on which the locator will listen for membership
information requests from new memberslogFile - The file to which the locator logs information. The
directory that contains the log file is used as the output
directory of the locator (see -dir option to
the gemfire command).bindAddress - The IP address to which the locator's socket binds
IllegalArgumentException - If port is not in the range 0 to 65536
SystemIsRunningException - If another locator is already running in
outputDir
GemFireIOException - If the directory containing the logFile does
not exist or cannot be written to
IOException - If the locator cannot be started
public static Locator startLocatorAndDS(int port,
File logFile,
InetAddress bindAddress,
Properties dsProperties)
throws IOException
The locator starts a AdminDistributedSystem configured with the given properties to provide the system with a long-running process that can be relied on for stable membership information.
port - The port on which the locator will listen for membership
information requests from new memberslogFile - The file to which the locator logs information. The
directory that contains the log file is used as the output
directory of the locator (see -dir option to
the gemfire command).bindAddress - The IP address to which the locator's socket bindsdsProperties - The properties used to configure the locator's DistributedSystem.
If there are multiple locators, the "locators" property should
be set. If multicast is being used, the "mcast-port" property
should be set.
IllegalArgumentException - If port is not in the range 0 to 65536
SystemIsRunningException - If another locator is already running in
outputDir
GemFireIOException - If the directory containing the logFile does
not exist or cannot be written to
IOException - If the locator cannot be startedpublic static Collection getLocators()
Locators that are hosted by this VM.
public static boolean hasLocators()
public int getPort()
public abstract DistributedSystem getDistributedSystem()
public File getLogFile()
public InetAddress getBindAddress()
public abstract void stop()
public String toString()
Locator
toString in class Objectpublic static void main(String[] args)
8 This method of starting the locator is provided as an alternative to the gemfire start-locator command to give you complete control over the java virtual machine's configuration.
The gemfire stop-locator command can be used to stop a locator that is started with this class.
java com.gemstone.gemfire.distributed.Locator port [bind-address] [gemfire-properties-file]
port - the tcp/ip port that the locator should listen on. This is the port number that applications will refer to in their locators property in gemfire.properties
bind-address - the tcp/ip address that the locator should bind to. This can be missing or be an empty string, which causes the locator to listen on all host addresses.
gemfire-properties-file - the location of a gemfire.properties file to be used in configuring the locator's distributed system.
|
GemFire 5.5.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||