You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ol...@apache.org on 2018/04/13 16:16:58 UTC

[ambari] branch trunk updated: AMBARI-23574. Log Feeder: fix startup issues (root logger + include lazy config) (#1000)

This is an automated email from the ASF dual-hosted git repository.

oleewere pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 3461d5c  AMBARI-23574. Log Feeder: fix startup issues (root logger + include lazy config) (#1000)
3461d5c is described below

commit 3461d5c3e571b0f9c87f2dfbcdb68323fe2f0a1f
Author: Olivér Szabó <ol...@gmail.com>
AuthorDate: Fri Apr 13 18:16:55 2018 +0200

    AMBARI-23574. Log Feeder: fix startup issues (root logger + include lazy config) (#1000)
---
 .../ambari/logfeeder/conf/InputSimulateConfig.java |  2 ++
 .../ambari/logfeeder/conf/LogEntryCacheConfig.java |  2 ++
 .../logfeeder/conf/LogFeederSecurityConfig.java    |  2 ++
 .../logfeeder/conf/MetricsCollectorConfig.java     |  2 ++
 .../src/main/scripts/logfeeder-env.sh~HEAD         | 40 ----------------------
 .../src/main/scripts/logfeeder-env.sh~trunk        | 40 ----------------------
 .../src/main/scripts/logfeeder.sh                  |  2 +-
 .../src/main/scripts/logsearch-env.sh~HEAD         | 40 ----------------------
 .../src/main/scripts/logsearch-env.sh~trunk        | 40 ----------------------
 .../0.5.0/properties/logfeeder-log4j.xml.j2        |  4 ++-
 10 files changed, 12 insertions(+), 162 deletions(-)

diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/conf/InputSimulateConfig.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/conf/InputSimulateConfig.java
index cf087f9..82880e2 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/conf/InputSimulateConfig.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/conf/InputSimulateConfig.java
@@ -22,8 +22,10 @@ import org.apache.ambari.logfeeder.common.LogFeederConstants;
 import org.apache.ambari.logsearch.config.api.LogSearchPropertyDescription;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Lazy;
 
 @Configuration
+@Lazy
 public class InputSimulateConfig {
 
   @LogSearchPropertyDescription(
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/conf/LogEntryCacheConfig.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/conf/LogEntryCacheConfig.java
index 92d2ebe..e93f5be 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/conf/LogEntryCacheConfig.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/conf/LogEntryCacheConfig.java
@@ -22,8 +22,10 @@ import org.apache.ambari.logfeeder.common.LogFeederConstants;
 import org.apache.ambari.logsearch.config.api.LogSearchPropertyDescription;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Lazy;
 
 @Configuration
+@Lazy
 public class LogEntryCacheConfig {
 
   @LogSearchPropertyDescription(
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/conf/LogFeederSecurityConfig.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/conf/LogFeederSecurityConfig.java
index 4c5b4dd..63fdfaf 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/conf/LogFeederSecurityConfig.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/conf/LogFeederSecurityConfig.java
@@ -27,12 +27,14 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Lazy;
 
 import javax.annotation.PostConstruct;
 import java.io.File;
 import java.nio.charset.Charset;
 
 @Configuration
+@Lazy
 public class LogFeederSecurityConfig {
 
   private static final Logger LOG = LoggerFactory.getLogger(LogFeederSecurityConfig.class);
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/conf/MetricsCollectorConfig.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/conf/MetricsCollectorConfig.java
index 4b3c6fb..23c8a8a 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/conf/MetricsCollectorConfig.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/conf/MetricsCollectorConfig.java
@@ -24,11 +24,13 @@ import org.apache.ambari.logsearch.config.api.LogSearchPropertyDescription;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Lazy;
 
 import javax.annotation.PostConstruct;
 import java.util.List;
 
 @Configuration
+@Lazy
 public class MetricsCollectorConfig {
 
   @LogSearchPropertyDescription(
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/scripts/logfeeder-env.sh~HEAD b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/scripts/logfeeder-env.sh~HEAD
deleted file mode 100755
index 37e9930..0000000
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/scripts/logfeeder-env.sh~HEAD
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/bash
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Log Feeder extra options
-export LOGFEEDER_JAVA_OPTS=${LOGFEEDER_JAVA_OPTS:-""}
-
-# Log Feeder debug options
-# export LOGFEEDER_DEBUG=true
-# exoprt LOGFEEDER_DEBUG_SUSPEND=n
-export LOGFEEDER_DEBUG_PORT=5006
-
-# Log Feeder memory
-# export LOGFEEDER_JAVA_MEM="-Xmx512m"
-
-# export LOG_PATH=/var/log/ambari-logsearch-logfeeder/
-# export LOG_FILE=logfeeder.log
-
-# Pid file of the application
-# export LOGFEEDER_PID_DIR=/var/run/ambari-logsearch-logfeeder
-# export LOGFEEDER_PID_FILE=logfeeder.pid
-
-# SSL settings"
-# export LOGFEEDER_SSL="true"
-# export LOGFEEDER_KEYSTORE_LOCATION="/my/path/keystore.jks"
-# export LOGFEEDER_KEYSTORE_TYPE="jks"
-# export LOGFEEDER_TRUSTSTORE_LOCATION="/my/path/trutstore.jks"
-# export LOGFEEDER_TRUSTSTORE_TYPE="jks"
\ No newline at end of file
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/scripts/logfeeder-env.sh~trunk b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/scripts/logfeeder-env.sh~trunk
deleted file mode 100755
index 37e9930..0000000
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/scripts/logfeeder-env.sh~trunk
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/bash
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Log Feeder extra options
-export LOGFEEDER_JAVA_OPTS=${LOGFEEDER_JAVA_OPTS:-""}
-
-# Log Feeder debug options
-# export LOGFEEDER_DEBUG=true
-# exoprt LOGFEEDER_DEBUG_SUSPEND=n
-export LOGFEEDER_DEBUG_PORT=5006
-
-# Log Feeder memory
-# export LOGFEEDER_JAVA_MEM="-Xmx512m"
-
-# export LOG_PATH=/var/log/ambari-logsearch-logfeeder/
-# export LOG_FILE=logfeeder.log
-
-# Pid file of the application
-# export LOGFEEDER_PID_DIR=/var/run/ambari-logsearch-logfeeder
-# export LOGFEEDER_PID_FILE=logfeeder.pid
-
-# SSL settings"
-# export LOGFEEDER_SSL="true"
-# export LOGFEEDER_KEYSTORE_LOCATION="/my/path/keystore.jks"
-# export LOGFEEDER_KEYSTORE_TYPE="jks"
-# export LOGFEEDER_TRUSTSTORE_LOCATION="/my/path/trutstore.jks"
-# export LOGFEEDER_TRUSTSTORE_TYPE="jks"
\ No newline at end of file
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/scripts/logfeeder.sh b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/scripts/logfeeder.sh
index e750b2a..abe062f 100755
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/scripts/logfeeder.sh
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/scripts/logfeeder.sh
@@ -33,7 +33,7 @@ LOGFEEDER_ROOT_DIR="`dirname \"$SCRIPT_DIR\"`"
 LOGFEEDER_LIBS_DIR="$LOGFEEDER_ROOT_DIR/libs"
 
 if [ "$LOGFEEDER_CONF_DIR" = "" ]; then
-  LOGFEEDER_CONF_DIR="/etc/ambari-logsearch-logfeeder/conf"
+  LOGFEEDER_CONF_DIR="/usr/lib/ambari-logsearch-logfeeder/conf"
   if [ ! -d $LOGFEEDER_CONF_DIR ]; then
     if [ -d "$LOGFEEDER_ROOT_DIR/conf" ]; then
       LOGFEEDER_CONF_DIR="$LOGFEEDER_ROOT_DIR/conf"
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/scripts/logsearch-env.sh~HEAD b/ambari-logsearch/ambari-logsearch-server/src/main/scripts/logsearch-env.sh~HEAD
deleted file mode 100755
index d8a837f..0000000
--- a/ambari-logsearch/ambari-logsearch-server/src/main/scripts/logsearch-env.sh~HEAD
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/bash
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Log Search extra options
-export LOGSEARCH_JAVA_OPTS=${LOGSEARCH_JAVA_OPTS:-""}
-
-# Log Search debug options
-# export LOGSEARCH_DEBUG=true
-# exoprt LOGSEARCH_DEBUG_SUSPEND=n
-export LOGSEARCH_DEBUG_PORT=5005
-
-# Log Search memory
-# export LOGSEARCH_JAVA_MEM="--Xmx1024m"
-
-# export LOG_PATH=/var/log/ambari-logsearch-logfeeder/
-# export LOG_FILE=logsearch.log
-
-# Pid file of the application
-# export LOGSEARCH_PID_DIR=/var/run/ambari-logsearch-logfeeder
-# export LOGSEARCH_PID_FILE=logfeeder.pid
-
-# SSL settings"
-# export LOGSEARCH_SSL="true"
-# export LOGSEARCH_KEYSTORE_LOCATION="/my/path/keystore.jks"
-# export LOGSEARCH_KEYSTORE_TYPE="jks"
-# export LOGSEARCH_TRUSTSTORE_LOCATION="/my/path/trutstore.jks"
-# export LOGSEARCH_TRUSTSTORE_TYPE="jks"
\ No newline at end of file
diff --git a/ambari-logsearch/ambari-logsearch-server/src/main/scripts/logsearch-env.sh~trunk b/ambari-logsearch/ambari-logsearch-server/src/main/scripts/logsearch-env.sh~trunk
deleted file mode 100755
index d8a837f..0000000
--- a/ambari-logsearch/ambari-logsearch-server/src/main/scripts/logsearch-env.sh~trunk
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/bash
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Log Search extra options
-export LOGSEARCH_JAVA_OPTS=${LOGSEARCH_JAVA_OPTS:-""}
-
-# Log Search debug options
-# export LOGSEARCH_DEBUG=true
-# exoprt LOGSEARCH_DEBUG_SUSPEND=n
-export LOGSEARCH_DEBUG_PORT=5005
-
-# Log Search memory
-# export LOGSEARCH_JAVA_MEM="--Xmx1024m"
-
-# export LOG_PATH=/var/log/ambari-logsearch-logfeeder/
-# export LOG_FILE=logsearch.log
-
-# Pid file of the application
-# export LOGSEARCH_PID_DIR=/var/run/ambari-logsearch-logfeeder
-# export LOGSEARCH_PID_FILE=logfeeder.pid
-
-# SSL settings"
-# export LOGSEARCH_SSL="true"
-# export LOGSEARCH_KEYSTORE_LOCATION="/my/path/keystore.jks"
-# export LOGSEARCH_KEYSTORE_TYPE="jks"
-# export LOGSEARCH_TRUSTSTORE_LOCATION="/my/path/trutstore.jks"
-# export LOGSEARCH_TRUSTSTORE_TYPE="jks"
\ No newline at end of file
diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/properties/logfeeder-log4j.xml.j2 b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/properties/logfeeder-log4j.xml.j2
index 5f06f41..0f535b2 100644
--- a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/properties/logfeeder-log4j.xml.j2
+++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/properties/logfeeder-log4j.xml.j2
@@ -65,6 +65,8 @@ limitations under the License.
 
   <root>
     <priority value="warn"/>
-    <!-- <appender-ref ref="rolling_file"/> -->
+    <!-- <appender-ref ref="console" /> -->
+    <appender-ref ref="rolling_file" />
+    <appender-ref ref="rolling_file_json"/>
   </root>
 </log4j:configuration>

-- 
To stop receiving notification emails like this one, please contact
oleewere@apache.org.