Uploaded image for project: 'Apache Gobblin'
  1. Apache Gobblin
  2. GOBBLIN-322

Cluster mode failed to start. Failed to find a log4j config file

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.12.0
    • Component/s: gobblin-cluster
    • Labels:
      None

      Description

      *Issue:
      *
      When running the bin/gobblin-cluster-master.sh
      I got an exception below:
      Exception in thread "main" java.io.FileNotFoundException: log4j-cluster.properties (No such file or directory)
      at java.io.FileInputStream.open0(Native Method)
      at java.io.FileInputStream.open(FileInputStream.java:195)
      at java.io.FileInputStream.<init>(FileInputStream.java:138)
      at java.io.FileInputStream.<init>(FileInputStream.java:93)
      at org.apache.gobblin.util.logs.Log4jConfigurationHelper.updateLog4jConfiguration(Log4jConfigurationHelper.java:51)
      at org.apache.gobblin.cluster.GobblinClusterManager.main(GobblinClusterManager.java:724)

      bin/gobblin-cluster-worker.sh has a similar issue.

      Analysis:

      public static void updateLog4jConfiguration(Class<?> targetClass, String log4jPath, String log4jFileName)
      throws IOException {
      Closer closer = Closer.create();
      try {
      InputStream fileInputStream = closer.register(new FileInputStream(log4jPath));

      The caller passes a simple file name

      Log4jConfigurationHelper.updateLog4jConfiguration(GobblinClusterManager.class,
      GobblinClusterConfigurationKeys.GOBBLIN_CLUSTER_LOG4J_CONFIGURATION_FILE,
      GobblinClusterConfigurationKeys.GOBBLIN_CLUSTER_LOG4J_CONFIGURATION_FILE);

      Solution:

      This logic can be removed.

      Users can simply pass in a custom log4j configuration directly if needed.
      e.g.
      -Dlog4j.configuration=file:/Users/foo/oss/gobblin/temp/my-log4j.properties
      Or
      add a custom log4j.properties file in the class path.

        Attachments

          Activity

            People

            • Assignee:
              hutran Hung Tran
              Reporter:
              HappyRay Ray Yang
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: