Hi Eugene,
You can run a server and a locator on the same machine or even in the same
process.
Distributed system properties (see javadocs on DistributedSystem [1]):
locators -- use this to specify one or more locators
start-locator -- use this to embed a locator in a server process
Launcher APIs:
LocatorLauncher.Builder.set(String, String) and
ServerLauncher.Builder.set(String, String) can be used to set any
distributed system properties:
new ServerLauncher.Builder().setMemberName("myname").set("locators",
value).build().start();
System Properties:
Simply prepend any distributed system property with "gemfire." and it can
be specified via a system property.
a) Java API: System.setProperty("gemfire.locators", value);
b) Java command-line: -Dgemfire.locators=value
c) gfsh start command: --J-Dgemfire.locators=value
CacheFactory API:
Properties properties = new Properties();
properties.set("locators", value);
Cache cache = new CacheFactory(properties).create();
The banner (first section) of the Geode log file will show how each
distributed system property was specified (ie, the source of the values)
for the Geode process.
(I'm not sure if there are online geode javadocs or not so the following
are gemfire 8.1 javadocs)
[0]
http://data-docs-samples.cfapps.io/docs-gemfire/latest/javadocs/japi/index.html
[1]
http://data-docs-samples.cfapps.io/docs-gemfire/latest/javadocs/japi/com/gemstone/gemfire/distributed/DistributedSystem.html
-Kirk
On Wed, Apr 20, 2016 at 1:24 PM, Eugene Strokin <[email protected]> wrote:
> It looks like DigitalOcean does not support Multicast IP.
> In this case, from what I understood, I should be running Locators.
> My idea was to start a server and a locator on the same node using API
> (ServerLauncher, LocatorLauncher).
> My assumption, that the server will read a list of locators from
> gemfire.properties file and register itself there.
> If this is correct, my only question is: Can I specify the list of
> locators via API as well? Or maybe as a system property?
> If I'm wrong about servers registering themselves using the list of
> locators, please point me to the right direction.
>
> Thanks,
> Eugene
>