Commits

timemachine  committed 370d409

Default scheduler node name to #{hostname}.

  • Participants
  • Parent commits 83ad837
  • Branches 1.1.x

Comments (0)

Files changed (2)

File timemachine-scheduler/src/main/java/timemachine/scheduler/service/SchedulerNodeService.java

 	protected void initService() {
 		Props props = configPropsService.getConfigProps();
 		String schedulerName = props.getString("timemachine.scheduler.schedulerName");
-		String nodeName = props.getString("timemachine.scheduler.nodeName");
+		String nodeName = props.getString("timemachine.scheduler.nodeName", "#{hostname}");
+		if (nodeName.equals("#{hostname}")) {
+			nodeName = Utils.getIpHost().getItem2();
+		}		
 		schedulerNode = dataStoreService.getOrCreateSchedulerNode(nodeName, schedulerName);
 		
 		Tuple<String, String> ipHost = Utils.getIpHost();

File timemachine-scheduler/src/main/resources/timemachine/scheduler/default.properties

 # Default TimeMachine scheduler configuration properties.
 #
 
-# Logical Scheduler and Clustering Nodes
+# Unique logical scheduler and JVM node names (#{hostname} is a var replace by actual host name.)
 timemachine.scheduler.schedulerName = TimeMachineScheduler
-timemachine.scheduler.nodeName = ${timemachine.scheduler.schedulerName}
+timemachine.scheduler.nodeName = #{hostname}
 
 # System core service implementations
 timemachine.scheduler.dataStore.class = timemachine.scheduler.service.MemoryDataStore