Author: rkanter
Date: Thu Oct 10 00:17:46 2013
New Revision: 1530833

URL: http://svn.apache.org/r1530833
Log:
OOZIE-1560 Log messages should have a way of identifying which server they came 
from when using HA (rkanter)

Modified:
    oozie/trunk/core/src/main/conf/oozie-env.sh
    oozie/trunk/core/src/main/conf/oozie-log4j.properties
    
oozie/trunk/core/src/main/java/org/apache/oozie/service/ConfigurationService.java
    
oozie/trunk/core/src/main/java/org/apache/oozie/service/JobsConcurrencyService.java
    
oozie/trunk/core/src/main/java/org/apache/oozie/service/ZKJobsConcurrencyService.java
    oozie/trunk/core/src/main/java/org/apache/oozie/util/ZKUtils.java
    oozie/trunk/core/src/main/resources/oozie-default.xml
    
oozie/trunk/core/src/test/java/org/apache/oozie/service/TestJobsConcurrencyService.java
    
oozie/trunk/core/src/test/java/org/apache/oozie/service/TestXLogStreamingService.java
    
oozie/trunk/core/src/test/java/org/apache/oozie/service/TestZKXLogStreamingService.java
    oozie/trunk/core/src/test/java/org/apache/oozie/test/ZKXTestCase.java
    oozie/trunk/distro/src/main/bin/oozie-sys.sh
    oozie/trunk/distro/src/main/bin/oozied.sh
    oozie/trunk/docs/src/site/twiki/AG_Install.twiki
    oozie/trunk/release-log.txt

Modified: oozie/trunk/core/src/main/conf/oozie-env.sh
URL: 
http://svn.apache.org/viewvc/oozie/trunk/core/src/main/conf/oozie-env.sh?rev=1530833&r1=1530832&r2=1530833&view=diff
==============================================================================
--- oozie/trunk/core/src/main/conf/oozie-env.sh (original)
+++ oozie/trunk/core/src/main/conf/oozie-env.sh Thu Oct 10 00:17:46 2013
@@ -63,3 +63,7 @@ export CATALINA_OPTS="$CATALINA_OPTS -Xm
 # The password of the keystore for the Oozie server if using SSL (HTTPS)
 #
 # export OOZIE_HTTPS_KEYSTORE_PASS=password
+
+# The Oozie Instance ID
+#
+# export OOZIE_INSTANCE_ID="${OOZIE_HTTP_HOSTNAME}"
\ No newline at end of file

Modified: oozie/trunk/core/src/main/conf/oozie-log4j.properties
URL: 
http://svn.apache.org/viewvc/oozie/trunk/core/src/main/conf/oozie-log4j.properties?rev=1530833&r1=1530832&r2=1530833&view=diff
==============================================================================
--- oozie/trunk/core/src/main/conf/oozie-log4j.properties (original)
+++ oozie/trunk/core/src/main/conf/oozie-log4j.properties Thu Oct 10 00:17:46 
2013
@@ -37,7 +37,7 @@ log4j.appender.oozie.RollingPolicy=org.a
 log4j.appender.oozie.File=${oozie.log.dir}/oozie.log
 log4j.appender.oozie.Append=true
 log4j.appender.oozie.layout=org.apache.log4j.PatternLayout
-log4j.appender.oozie.layout.ConversionPattern=%d{ISO8601} %5p %c{1}:%L - %m%n
+log4j.appender.oozie.layout.ConversionPattern=%d{ISO8601} %5p %c{1}:%L - 
SERVER[${oozie.instance.id}] %m%n
 # The FileNamePattern must end with "-%d{yyyy-MM-dd-HH}.gz" or 
"-%d{yyyy-MM-dd-HH}" and also start with the 
 # value of log4j.appender.oozie.File
 
log4j.appender.oozie.RollingPolicy.FileNamePattern=${log4j.appender.oozie.File}-%d{yyyy-MM-dd-HH}

Modified: 
oozie/trunk/core/src/main/java/org/apache/oozie/service/ConfigurationService.java
URL: 
http://svn.apache.org/viewvc/oozie/trunk/core/src/main/java/org/apache/oozie/service/ConfigurationService.java?rev=1530833&r1=1530832&r2=1530833&view=diff
==============================================================================
--- 
oozie/trunk/core/src/main/java/org/apache/oozie/service/ConfigurationService.java
 (original)
+++ 
oozie/trunk/core/src/main/java/org/apache/oozie/service/ConfigurationService.java
 Thu Oct 10 00:17:46 2013
@@ -33,6 +33,7 @@ import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
 import java.util.Arrays;
+import org.apache.oozie.util.ZKUtils;
 
 /**
  * Built in service that initializes the services configuration.
@@ -90,6 +91,7 @@ public class ConfigurationService implem
         //all this properties are seeded as system properties, no need to log 
changes
         IGNORE_SYS_PROPS.add("oozie.http.hostname");
         IGNORE_SYS_PROPS.add("oozie.http.port");
+        IGNORE_SYS_PROPS.add(ZKUtils.OOZIE_INSTANCE_ID);
 
         IGNORE_SYS_PROPS.add(Services.OOZIE_HOME_DIR);
         IGNORE_SYS_PROPS.add(OOZIE_CONFIG_DIR);

Modified: 
oozie/trunk/core/src/main/java/org/apache/oozie/service/JobsConcurrencyService.java
URL: 
http://svn.apache.org/viewvc/oozie/trunk/core/src/main/java/org/apache/oozie/service/JobsConcurrencyService.java?rev=1530833&r1=1530832&r2=1530833&view=diff
==============================================================================
--- 
oozie/trunk/core/src/main/java/org/apache/oozie/service/JobsConcurrencyService.java
 (original)
+++ 
oozie/trunk/core/src/main/java/org/apache/oozie/service/JobsConcurrencyService.java
 Thu Oct 10 00:17:46 2013
@@ -23,6 +23,7 @@ import java.util.Map;
 import org.apache.oozie.util.ConfigUtils;
 import org.apache.oozie.util.Instrumentable;
 import org.apache.oozie.util.Instrumentation;
+import org.apache.oozie.util.ZKUtils;
 
 /**
  * This Service helps coordinate other Services to prevent duplicate 
processing of Jobs if there are multiple Oozie Servers.  This
@@ -34,7 +35,7 @@ public class JobsConcurrencyService impl
     private static final Map<String, String> urls;
     static {
         urls = new HashMap<String, String>();
-        urls.put(System.getProperty("oozie.http.hostname"), 
ConfigUtils.getOozieEffectiveUrl());
+        urls.put(System.getProperty(ZKUtils.OOZIE_INSTANCE_ID), 
ConfigUtils.getOozieEffectiveUrl());
     }
 
     /**
@@ -103,10 +104,10 @@ public class JobsConcurrencyService impl
     }
 
     /**
-     * Return a map of server id to Oozie server URL.  This implementation 
always returns a map with a single entry where the key is
-     * the hostname and the value is the URL (of this Oozie server).
+     * Return a map of instance id to Oozie server URL.  This implementation 
always returns a map with a single entry where the key
+     * is the OOZIE_INSTANCE_ID env var and the value is the URL (of this 
Oozie server).
      *
-     * @return A map of Oozie server ids and URLs
+     * @return A map of Oozie instance ids and URLs
      * @throws Exception
      */
     public Map<String, String> getServerUrls() {

Modified: 
oozie/trunk/core/src/main/java/org/apache/oozie/service/ZKJobsConcurrencyService.java
URL: 
http://svn.apache.org/viewvc/oozie/trunk/core/src/main/java/org/apache/oozie/service/ZKJobsConcurrencyService.java?rev=1530833&r1=1530832&r2=1530833&view=diff
==============================================================================
--- 
oozie/trunk/core/src/main/java/org/apache/oozie/service/ZKJobsConcurrencyService.java
 (original)
+++ 
oozie/trunk/core/src/main/java/org/apache/oozie/service/ZKJobsConcurrencyService.java
 Thu Oct 10 00:17:46 2013
@@ -153,10 +153,10 @@ public class ZKJobsConcurrencyService ex
     }
 
     /**
-     * Return a map of server id to Oozie server URL.  This implementation 
always returns a map with where the key is the ZooKeeper
+     * Return a map of instance id to Oozie server URL.  This implementation 
always returns a map with where the key is the instance
      * id and the value is the URL of each Oozie server that we can see in the 
service discovery in ZooKeeper.
      *
-     * @return A map of Oozie server ids and URLs
+     * @return A map of Oozie instance ids and URLs
      */
     @Override
     public Map<String, String> getServerUrls() {

Modified: oozie/trunk/core/src/main/java/org/apache/oozie/util/ZKUtils.java
URL: 
http://svn.apache.org/viewvc/oozie/trunk/core/src/main/java/org/apache/oozie/util/ZKUtils.java?rev=1530833&r1=1530832&r2=1530833&view=diff
==============================================================================
--- oozie/trunk/core/src/main/java/org/apache/oozie/util/ZKUtils.java (original)
+++ oozie/trunk/core/src/main/java/org/apache/oozie/util/ZKUtils.java Thu Oct 
10 00:17:46 2013
@@ -49,9 +49,9 @@ import org.apache.oozie.service.Services
  * to add additional metadata in the future, we share a Map.  They keys are 
defined in {@link ZKMetadataKeys}.
  * <p>
  * For the service discovery, the structure in ZooKeeper is 
/oozie.zookeeper.namespace/ZK_BASE_PATH/ (default is /oozie/services/).
- * There is currently only one service, named "servers" under which each Oozie 
server creates a ZNode named oozie.zookeeper.oozie.id
- * (default is the hostname) that contains the metadata payload.  For example, 
with the default settings, an Oozie server named
- * "foo" would create a ZNode at /oozie/services/servers/foo where the foo 
ZNode contains the metadata.
+ * There is currently only one service, named "servers" under which each Oozie 
server creates a ZNode named
+ * ${OOZIE_SERVICE_INSTANCE} (default is the hostname) that contains the 
metadata payload.  For example, with the default settings,
+ * an Oozie server named "foo" would create a ZNode at 
/oozie/services/servers/foo where the foo ZNode contains the metadata.
  */
 public class ZKUtils {
     /**
@@ -64,10 +64,12 @@ public class ZKUtils {
      * on talking to each other should have the same value for this.
      */
     public static final String ZK_NAMESPACE = "oozie.zookeeper.namespace";
+
     /**
-     * oozie-site property for specifying the ID for this Oozie Server.  Each 
Oozie server should have a unique ID.
+     * oozie-env environment variable for specifying the Oozie instance ID
      */
-    public static final String ZK_ID = "oozie.zookeeper.oozie.id";
+    public static final String OOZIE_INSTANCE_ID = "oozie.instance.id";
+
     private static final String ZK_OOZIE_SERVICE = "servers";
     private static final String ZK_BASE_PATH = "/services";
 
@@ -88,10 +90,7 @@ public class ZKUtils {
      */
     private ZKUtils() throws Exception {
         log = XLog.getLog(getClass());
-        zkId = Services.get().getConf().get(ZK_ID, "").trim();
-        if (zkId.length() == 0) {
-            zkId = System.getProperty("oozie.http.hostname");
-        }
+        zkId = System.getProperty(OOZIE_INSTANCE_ID);
         createClient();
         advertiseService();
     }

Modified: oozie/trunk/core/src/main/resources/oozie-default.xml
URL: 
http://svn.apache.org/viewvc/oozie/trunk/core/src/main/resources/oozie-default.xml?rev=1530833&r1=1530832&r2=1530833&view=diff
==============================================================================
--- oozie/trunk/core/src/main/resources/oozie-default.xml (original)
+++ oozie/trunk/core/src/main/resources/oozie-default.xml Thu Oct 10 00:17:46 
2013
@@ -1946,13 +1946,4 @@
         </description>
     </property>
 
-    <property>
-        <name>oozie.zookeeper.oozie.id</name>
-        <value></value>
-        <description>
-            The ID for the Oozie server to use.  Each Oozie server must have a 
unique ID.
-            If empty, Oozie will use the hostname.
-        </description>
-    </property>
-
 </configuration>

Modified: 
oozie/trunk/core/src/test/java/org/apache/oozie/service/TestJobsConcurrencyService.java
URL: 
http://svn.apache.org/viewvc/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestJobsConcurrencyService.java?rev=1530833&r1=1530832&r2=1530833&view=diff
==============================================================================
--- 
oozie/trunk/core/src/test/java/org/apache/oozie/service/TestJobsConcurrencyService.java
 (original)
+++ 
oozie/trunk/core/src/test/java/org/apache/oozie/service/TestJobsConcurrencyService.java
 Thu Oct 10 00:17:46 2013
@@ -80,8 +80,8 @@ public class TestJobsConcurrencyService 
             jcs.init(null);
             Map<String, String> map = jcs.getServerUrls();
             assertEquals(1, map.size());
-            assertEquals(System.getProperty("oozie.http.hostname"), 
map.keySet().iterator().next());
-            assertEquals(ConfigUtils.getOozieURL(false), 
map.get(System.getProperty("oozie.http.hostname")));
+            assertEquals(System.getProperty("oozie.instance.id"), 
map.keySet().iterator().next());
+            assertEquals(ConfigUtils.getOozieURL(false), 
map.get(System.getProperty("oozie.instance.id")));
         }
         finally {
             jcs.destroy();

Modified: 
oozie/trunk/core/src/test/java/org/apache/oozie/service/TestXLogStreamingService.java
URL: 
http://svn.apache.org/viewvc/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestXLogStreamingService.java?rev=1530833&r1=1530832&r2=1530833&view=diff
==============================================================================
--- 
oozie/trunk/core/src/test/java/org/apache/oozie/service/TestXLogStreamingService.java
 (original)
+++ 
oozie/trunk/core/src/test/java/org/apache/oozie/service/TestXLogStreamingService.java
 Thu Oct 10 00:17:46 2013
@@ -152,14 +152,14 @@ public class TestXLogStreamingService ex
         try {
             new Services().init();
             assertFalse(doStreamDisabledCheck());
-            LogFactory.getLog("a").info("2009-06-24 02:43:14,505 INFO _L1_:317 
- USER[oozie] GROUP[oozie] TOKEN[-] APP[-] JOB[-] "
-                    + "ACTION[-] Released Lock");
-            LogFactory.getLog("a").info("2009-06-24 02:43:14,505 INFO _L2_:317 
- USER[blah] GROUP[oozie] TOKEN[-] APP[-] JOB[-] "
-                    + "ACTION[-] Released Lock");
-            LogFactory.getLog("a").info("2009-06-24 02:43:14,505 INFO _L3_:317 
USER[oozie] GROUP[oozie] TOKEN[-] APP[-] JOB[-] "
-                    + "ACTION[-] Released Lock");
-            LogFactory.getLog("a").info("2009-06-24 02:43:14,505 INFO _L4_:317 
USER[blah] GROUP[oozie] TOKEN[-] APP[-] JOB[-] "
-                    + "ACTION[-] Released Lock");
+            LogFactory.getLog("a").info("2009-06-24 02:43:14,505 INFO _L1_:317 
- SERVER[foo] USER[oozie] GROUP[oozie] TOKEN[-] "
+                    + "APP[-] JOB[-] ACTION[-] Released Lock");
+            LogFactory.getLog("a").info("2009-06-24 02:43:14,505 INFO _L2_:317 
- SERVER[foo] USER[blah] GROUP[oozie] TOKEN[-]"
+                    + "APP[-] JOB[-] ACTION[-] Released Lock");
+            LogFactory.getLog("a").info("2009-06-24 02:43:14,505 INFO _L3_:317 
SERVER[foo] USER[oozie] GROUP[oozie] TOKEN[-] APP[-]"
+                    + " JOB[-] ACTION[-] Released Lock");
+            LogFactory.getLog("a").info("2009-06-24 02:43:14,505 INFO _L4_:317 
SERVER[foo] USER[blah] GROUP[oozie] TOKEN[-] APP[-] "
+                    + "JOB[-] ACTION[-] Released Lock");
             String out = doStreamLog(xf);
             String outArr[] = out.split("\n");
             // Lines 2 and 4 are filtered out because they have the wrong user

Modified: 
oozie/trunk/core/src/test/java/org/apache/oozie/service/TestZKXLogStreamingService.java
URL: 
http://svn.apache.org/viewvc/oozie/trunk/core/src/test/java/org/apache/oozie/service/TestZKXLogStreamingService.java?rev=1530833&r1=1530832&r2=1530833&view=diff
==============================================================================
--- 
oozie/trunk/core/src/test/java/org/apache/oozie/service/TestZKXLogStreamingService.java
 (original)
+++ 
oozie/trunk/core/src/test/java/org/apache/oozie/service/TestZKXLogStreamingService.java
 Thu Oct 10 00:17:46 2013
@@ -168,14 +168,14 @@ public class TestZKXLogStreamingService 
         log4jProps.store(new FileOutputStream(log4jFile), "");
         setSystemProperty(XLogService.LOG4J_FILE, log4jFile.getName());
         assertFalse(doStreamDisabledCheck());
-        LogFactory.getLog("a").info("2009-06-24 02:43:14,505 INFO _L1_:317 - 
USER[oozie] GROUP[oozie] TOKEN[-] APP[-] JOB[-] "
-                + "ACTION[-] Released Lock");
-        LogFactory.getLog("a").info("2009-06-24 02:43:14,505 INFO _L2_:317 - 
USER[blah] GROUP[oozie] TOKEN[-] APP[-] JOB[-] "
-                + "ACTION[-] Released Lock");
-        LogFactory.getLog("a").info("2009-06-24 02:43:14,505 INFO _L3_:317 
USER[oozie] GROUP[oozie] TOKEN[-] APP[-] JOB[-] "
-                + "ACTION[-] Released Lock");
-        LogFactory.getLog("a").info("2009-06-24 02:43:14,505 INFO _L4_:317 
USER[blah] GROUP[oozie] TOKEN[-] APP[-] JOB[-] "
-                + "ACTION[-] Released Lock");
+        LogFactory.getLog("a").info("2009-06-24 02:43:14,505 INFO _L1_:317 - 
SERVER[foo] USER[oozie] GROUP[oozie] TOKEN[-] APP[-] "
+                + "JOB[-] ACTION[-] Released Lock");
+        LogFactory.getLog("a").info("2009-06-24 02:43:14,505 INFO _L2_:317 - 
SERVER[foo] USER[blah] GROUP[oozie] TOKEN[-] APP[-] "
+                + "JOB[-] ACTION[-] Released Lock");
+        LogFactory.getLog("a").info("2009-06-24 02:43:14,505 INFO _L3_:317 
SERVER[foo] USER[oozie] GROUP[oozie] TOKEN[-] APP[-] "
+                + "JOB[-] ACTION[-] Released Lock");
+        LogFactory.getLog("a").info("2009-06-24 02:43:14,505 INFO _L4_:317 
SERVER[foo] USER[blah] GROUP[oozie] TOKEN[-] APP[-] "
+                + "JOB[-] ACTION[-] Released Lock");
         String out = doStreamLog(xf);
         String outArr[] = out.split("\n");
         // Lines 2 and 4 are filtered out because they have the wrong user
@@ -233,10 +233,10 @@ public class TestZKXLogStreamingService 
         logFile.getParentFile().mkdirs();
         FileWriter logWriter = new FileWriter(logFile);
         // local logs
-        logWriter.append("2013-06-10 10:25:44,008 WARN HiveActionExecutor:542 
USER[rkanter] GROUP[-] TOKEN[] "
+        logWriter.append("2013-06-10 10:25:44,008 WARN HiveActionExecutor:542 
SERVER[foo] USER[rkanter] GROUP[-] TOKEN[] "
                 + "APP[hive-wf] JOB[0000003-130610102426873-oozie-rkan-W] 
ACTION[0000003-130610102426873-oozie-rkan-W@hive-node] "
                 + "credentials is null for the action _L3_").append("\n")
-                .append("2013-06-10 10:26:10,008 INFO HiveActionExecutor:539 
USER[rkanter] GROUP[-] TOKEN[] "
+                .append("2013-06-10 10:26:10,008 INFO HiveActionExecutor:539 
SERVER[foo] USER[rkanter] GROUP[-] TOKEN[] "
                 + "APP[hive-wf] JOB[0000003-130610102426873-oozie-rkan-W] 
ACTION[0000003-130610102426873-oozie-rkan-W@hive-node] "
                 + "action completed, external ID [job_201306101021_0005] 
_L4_").append("\n")
                 .append("2013-06-10 10:26:10,341 WARN ActionStartXCommand:542 
USER[rkanter] GROUP[-] TOKEN[] "
@@ -245,20 +245,20 @@ public class TestZKXLogStreamingService 
         logWriter.close();
         // logs to be returned by another "Oozie server"
         DummyLogStreamingServlet.logs =
-                "2013-06-10 10:25:43,575 WARN ActionStartXCommand:542 
USER[rkanter] GROUP[-] TOKEN[] APP[hive-wf] "
+                "2013-06-10 10:25:43,575 WARN ActionStartXCommand:542 
SERVER[foo] USER[rkanter] GROUP[-] TOKEN[] APP[hive-wf] "
                 + "JOB[0000003-130610102426873-oozie-rkan-W] 
ACTION[0000003-130610102426873-oozie-rkan-W@:start:] "
                 + "[***0000003-130610102426873-oozie-rkan-W@:start:***]Action 
status=DONE _L1_"
                 + "\n"
-                + "2013-06-10 10:25:43,575 WARN ActionStartXCommand:542 
USER[rkanter] GROUP[-] TOKEN[] APP[hive-wf] "
+                + "2013-06-10 10:25:43,575 WARN ActionStartXCommand:542 
SERVER[foo] USER[rkanter] GROUP[-] TOKEN[] APP[hive-wf] "
                 + "JOB[0000003-130610102426873-oozie-rkan-W] 
ACTION[0000003-130610102426873-oozie-rkan-W@:start:] "
                 + "[***0000003-130610102426873-oozie-rkan-W@:start:***]Action 
updated in DB! _L2_"
                 + "\n"
-                + "2013-06-10 10:26:10,148 INFO HiveActionExecutor:539 
USER[rkanter] GROUP[-] TOKEN[] APP[hive-wf] "
+                + "2013-06-10 10:26:10,148 INFO HiveActionExecutor:539 
SERVER[foo] USER[rkanter] GROUP[-] TOKEN[] APP[hive-wf] "
                 + "JOB[0000003-130610102426873-oozie-rkan-W] 
ACTION[0000003-130610102426873-oozie-rkan-W@hive-node] action produced"
                 + " output _L5_"
                 + "\n"
                 // a multiline message with a stack trace
-                + "2013-06-10 10:26:30,202  WARN ActionStartXCommand:542 - 
USER[rkanter] GROUP[-] TOKEN[] APP[hive-wf] "
+                + "2013-06-10 10:26:30,202  WARN ActionStartXCommand:542 - 
SERVER[foo] USER[rkanter] GROUP[-] TOKEN[] APP[hive-wf] "
                 + "JOB[0000003-130610102426873-oozie-rkan-W] 
ACTION[0000003-130610102426873-oozie-rkan-W@hive-node] Error starting "
                 + "action [hive-node]. ErrorType [TRANSIENT], ErrorCode 
[JA009], Message [JA009: java.io.IOException: Unknown "
                 + "protocol to name node: 
org.apache.hadoop.mapred.JobSubmissionProtocol _L7_\n"

Modified: oozie/trunk/core/src/test/java/org/apache/oozie/test/ZKXTestCase.java
URL: 
http://svn.apache.org/viewvc/oozie/trunk/core/src/test/java/org/apache/oozie/test/ZKXTestCase.java?rev=1530833&r1=1530832&r2=1530833&view=diff
==============================================================================
--- oozie/trunk/core/src/test/java/org/apache/oozie/test/ZKXTestCase.java 
(original)
+++ oozie/trunk/core/src/test/java/org/apache/oozie/test/ZKXTestCase.java Thu 
Oct 10 00:17:46 2013
@@ -36,7 +36,7 @@ import org.apache.oozie.util.FixedJsonIn
 
 /**
  * Provides a version of XTestCase that also runs a ZooKeeper server and 
provides some utilities for interacting and simulating ZK
- * related things.  By default, the ZooKeeper ID of this Oozie server will be 
"1234" (instead of the hostname).
+ * related things.  By default, the Instance ID of this Oozie server will be 
"1234" (instead of the hostname).
  * <p>
  * Unlike the code, which uses ZKUtils for interacting with ZK, this class 
doesn't to make sure that (a) we test ZKUtils and (b) so
  * that the test class doesn't advertise on the ZK service discovery; the test 
class has access to a CuratorFramework (client) and
@@ -61,7 +61,7 @@ public abstract class ZKXTestCase extend
         // Start the ZooKeeper server and set Oozie ZK properties
         zkServer = new TestingServer();
         Services.get().getConf().set("oozie.zookeeper.connection.string", 
zkServer.getConnectString());
-        Services.get().getConf().set("oozie.zookeeper.oozie.id", ZK_ID);
+        setSystemProperty("oozie.instance.id", ZK_ID);
         createClient();
         createServiceDiscovery();
     }

Modified: oozie/trunk/distro/src/main/bin/oozie-sys.sh
URL: 
http://svn.apache.org/viewvc/oozie/trunk/distro/src/main/bin/oozie-sys.sh?rev=1530833&r1=1530832&r2=1530833&view=diff
==============================================================================
--- oozie/trunk/distro/src/main/bin/oozie-sys.sh (original)
+++ oozie/trunk/distro/src/main/bin/oozie-sys.sh Thu Oct 10 00:17:46 2013
@@ -216,6 +216,13 @@ else
   print "Using   OOZIE_HTTPS_KEYSTORE_PASS:     ${OOZIE_HTTPS_KEYSTORE_PASS}"
 fi
 
+if [ "${OOZIE_INSTANCE_ID}" = "" ]; then
+  export OOZIE_INSTANCE_ID="${OOZIE_HTTP_HOSTNAME}"
+  print "Setting OOZIE_INSTANCE_ID:       ${OOZIE_INSTANCE_ID}"
+else
+  print "Using   OOZIE_INSTANCE_ID:       ${OOZIE_INSTANCE_ID}"
+fi
+
 if [ "${CATALINA_OUT}" = "" ]; then
   export CATALINA_OUT=${OOZIE_LOG}/catalina.out
   print "Setting CATALINA_OUT:        ${CATALINA_OUT}"

Modified: oozie/trunk/distro/src/main/bin/oozied.sh
URL: 
http://svn.apache.org/viewvc/oozie/trunk/distro/src/main/bin/oozied.sh?rev=1530833&r1=1530832&r2=1530833&view=diff
==============================================================================
--- oozie/trunk/distro/src/main/bin/oozied.sh (original)
+++ oozie/trunk/distro/src/main/bin/oozied.sh Thu Oct 10 00:17:46 2013
@@ -55,6 +55,7 @@ setup_catalina_opts() {
   catalina_opts="${catalina_opts} -Doozie.config.dir=${OOZIE_CONFIG}";
   catalina_opts="${catalina_opts} -Doozie.log.dir=${OOZIE_LOG}";
   catalina_opts="${catalina_opts} -Doozie.data.dir=${OOZIE_DATA}";
+  catalina_opts="${catalina_opts} -Doozie.instance.id=${OOZIE_INSTANCE_ID}"
 
   catalina_opts="${catalina_opts} -Doozie.config.file=${OOZIE_CONFIG_FILE}";
 

Modified: oozie/trunk/docs/src/site/twiki/AG_Install.twiki
URL: 
http://svn.apache.org/viewvc/oozie/trunk/docs/src/site/twiki/AG_Install.twiki?rev=1530833&r1=1530832&r2=1530833&view=diff
==============================================================================
--- oozie/trunk/docs/src/site/twiki/AG_Install.twiki (original)
+++ oozie/trunk/docs/src/site/twiki/AG_Install.twiki Thu Oct 10 00:17:46 2013
@@ -55,6 +55,9 @@ Default value =${HOME}/.keystore= (i.e. 
 
 *OOZIE_HTTPS_KEYSTORE_PASS* : The password of the keystore file. Default value 
=password=.
 
+*OOZIE_INSTANCE_ID* : The instance id of the Oozie server.  When using HA, 
each server instance should have a unique instance id.
+Default value =${OOZIE_HTTP_HOSTNAME}=
+
 ---++ Oozie Server Setup
 
 The =oozie-setup.sh= script prepares the embedded Tomcat server to run Oozie.
@@ -753,10 +756,9 @@ ZooKeeper servers.  The default value is
 </property>
 </verbatim>
 
-4. (Optional) Add the following properties to oozie-site.xml in all Oozie 
servers.
-
-The namespace to use.  All of the Oozie Servers that are planning on talking 
to each other should have the same namespace.  If there
-are multiple Oozie setups each doing their own HA, they should have their own 
namespace.  The default value is shown below.
+4. (Optional) Add the following property to oozie-site.xml in all Oozie 
servers to specify the namespace to use.  All of the Oozie
+Servers that are planning on talking to each other should have the same 
namespace.  If there are multiple Oozie setups each doing
+their own HA, they should have their own namespace.  The default value is 
shown below.
 
 <verbatim>
 <property>
@@ -765,25 +767,22 @@ are multiple Oozie setups each doing the
 </property>
 </verbatim>
 
-The ID for the Oozie server to use when talking to ZooKeeper and other Oozie 
servers.  Each Oozie server must have a unique ID.  If
-empty, Oozie will use the hostname.
+5. Change the value of OOZIE_BASE_URL in oozie-env.sh to point to the 
loadbalancer or virtual IP, for example:
 
 <verbatim>
-<property>
-    <name>oozie.zookeeper.oozie.id</name>
-    <value></value>
-</property>
+export OOZIE_BASE_URL="http://my.loadbalancer.hostname:11000/oozie";
 </verbatim>
 
-5. Change the value of OOZIE_BASE_URL in oozie-env.sh to point to the 
loadbalancer or virtual IP, for example:
+6. (Optional) Change the value of OOZIE_INSTANCE_ID in oozie-env.sh.  Each 
Oozie server should have its own unique instance id.  The
+default is =${OOZIE_HTTP_HOSTNAME}= (i.e. the hostname).
 
 <verbatim>
-export OOZIE_BASE_URL="http://my.loadbalancer.hostname:11000/oozie";
+export OOZIE_INSTANCE_ID="${OOZIE_HTTP_HOSTNAME}"
 </verbatim>
 
-6. Start the ZooKeeper servers.
+7. Start the ZooKeeper servers.
 
-7. Start the Oozie servers.
+8. Start the Oozie servers.
 
 Note: If one of the Oozie servers becomes unavailable, querying Oozie for the 
logs from a job in the Web UI, REST API, or client may
 be missing information until that server comes back up.

Modified: oozie/trunk/release-log.txt
URL: 
http://svn.apache.org/viewvc/oozie/trunk/release-log.txt?rev=1530833&r1=1530832&r2=1530833&view=diff
==============================================================================
--- oozie/trunk/release-log.txt (original)
+++ oozie/trunk/release-log.txt Thu Oct 10 00:17:46 2013
@@ -1,5 +1,6 @@
 -- Oozie 4.1.0 release (trunk - unreleased)
 
+OOZIE-1560 Log messages should have a way of identifying which server they 
came from when using HA (rkanter)
 OOZIE-1566 Add reference to Quartz module in cron documentation (bowenzhangusa 
via rkanter)
 OOZIE-1454 Documentation for cron syntax scheduling of coordinator job 
(bowenzhangusa via rkanter)
 OOZIE-1306 add flexibility to oozie coordinator job scheduling (bowenzhangusa 
via rohini)


Reply via email to