We have gemfire 7 packaged into tcServer instances with spring-data for as much as we can. Factory methods for the rest.
Multiple environments (dev/qa/prod/ types) on a single server.
We are differentiating by ip.
Ok, so we try to drop in a locator.
Here's a piece of configuration xml to bring up a locator.
<bean id="locator" class="com.gemstone.gemfire.distributed.Locator" factory-method="startLocatorAndDS"> <constructor-arg value="${locator.port}" /> <constructor-arg value="${locator.log-file}" /> <constructor-arg> <bean class="java.net.InetAddress" factory-method="getByName"> <constructor-arg value="${locator.bind-address}" /> </bean> </constructor-arg> <constructor-arg ref="locatorProperties" /> <constructor-arg value="true" /> <constructor-arg value="true" /> <constructor-arg value="${locator.bind-address}" /></bean><!-- Properties file bean - required for the LocatorFactory which creates the locator --><bean id="locatorProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean" depends-on="placeholderConfig"> <property name="properties"> <props> <prop key="locators">${locator.locators}</prop> <prop key="bind-address">${locator.bind-address}</prop> <prop key="mcast-port">${locator.mcast-port}</prop> <prop key="log-file">${locator.log-file}</prop> <prop key="log-level">${locator.log-level}</prop> <prop key="license-data-management">${locator.license-data-management}</prop> </props> </property></bean>
There was a lot of trial and error went into this, so there may be some pieces that are superfluous.
It does however work.
Ok, here's the problem.
Machine has multiple network cards.
When we try to start this up, the locator is binding to the designated port, but on all addresses, so if we wanted (say) dev on 10.2.1.1 and the locator on10001 and qa on 10:2:1.2 so we are running two different grids, it doesn't work as desired.
The first one up is bound to the port everywhere, so that's all she wrote for the second.
Is this expected behaviour?
If not, which piece of the configuration did I miss that would allow this to work as described. I had some vague hope that the bind-address controlled this.