This is an automated email from the ASF dual-hosted git repository.
jialiang pushed a commit to branch upgrade/jdk-spring-dependencies
in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to
refs/heads/upgrade/jdk-spring-dependencies by this push:
new d324ace2b4 AMBARI-26233: Fix ambari-env.sh after jdk upgrade (#3873)
d324ace2b4 is described below
commit d324ace2b418777fba1b5a26ffe48b0cdc348ccd
Author: jialiang <[email protected]>
AuthorDate: Fri Nov 22 14:21:12 2024 +0800
AMBARI-26233: Fix ambari-env.sh after jdk upgrade (#3873)
* fix ambari agent env after jdk upgrade
---
ambari-agent/conf/unix/ambari-env.sh | 6 ----
ambari-server/conf/ambari-env.sh | 1 -
ambari-server/conf/unix/ambari-env.sh | 32 ++++++++++++++++------
.../src/main/python/ambari_server_main.py | 2 +-
4 files changed, 25 insertions(+), 16 deletions(-)
diff --git a/ambari-agent/conf/unix/ambari-env.sh
b/ambari-agent/conf/unix/ambari-env.sh
index 9b4e3e2ab6..1a7d05e1cb 100644
--- a/ambari-agent/conf/unix/ambari-env.sh
+++ b/ambari-agent/conf/unix/ambari-env.sh
@@ -16,13 +16,7 @@
# To change a passphrase used by the agent adjust the line below. This value
is used when no passphrase is
# given through environment variable
-AMBARI_JVM_ARGS="$AMBARI_JVM_ARGS --add-opens java.base/java.lang=ALL-UNNAMED "
-AMBARI_JVM_ARGS="$AMBARI_JVM_ARGS --add-opens
java.base/java.util.regex=ALL-UNNAMED "
-AMBARI_JVM_ARGS="$AMBARI_JVM_ARGS --add-opens java.base/java.util=ALL-UNNAMED "
-export AMBARI_JVM_ARGS="$AMBARI_JVM_ARGS --add-opens
java.base/java.lang.reflect=ALL-UNNAMED "
-
AMBARI_PASSPHRASE="DEV"
-export AMBARI_JVM_ARGS="$AMBARI_JVM_ARGS -Xms512m -Xmx2048m
-Djava.security.auth.login.config=$ROOT/etc/ambari-server/conf/krb5JAASLogin.conf
-Djava.security.krb5.conf=/etc/krb5.conf
-Djavax.security.auth.useSubjectCredsOnly=false
-Dcom.sun.jndi.ldap.connect.pool.protocol=\"plain ssl\"
-Dcom.sun.jndi.ldap.connect.pool.maxsize=20
-Dcom.sun.jndi.ldap.connect.pool.timeout=300000"
export PATH=$PATH:/var/lib/ambari-agent
export PYTHONPATH=/usr/lib/ambari-agent/lib:$PYTHONPATH
diff --git a/ambari-server/conf/ambari-env.sh b/ambari-server/conf/ambari-env.sh
index 62fee14a5f..23a2ad250b 100644
--- a/ambari-server/conf/ambari-env.sh
+++ b/ambari-server/conf/ambari-env.sh
@@ -12,7 +12,6 @@
# 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.
-
AMBARI_PID_DIR=/var/run/ambari-server
AMBARI_PASSPHRASE="DEV"
export PYTHONPATH=/usr/lib/ambari-server/lib:$PYTHONPATH
diff --git a/ambari-server/conf/unix/ambari-env.sh
b/ambari-server/conf/unix/ambari-env.sh
index d080f46fc7..297eee3df3 100644
--- a/ambari-server/conf/unix/ambari-env.sh
+++ b/ambari-server/conf/unix/ambari-env.sh
@@ -13,15 +13,31 @@
# 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.
+# Exit immediately if a command exits with a non-zero status
+set -e
+# Set Ambari passphrase
+AMBARI_PASSPHRASE="DEV"
+# Set JVM arguments for Ambari
+AMBARI_JVM_ARGS="--add-opens java.base/java.lang=ALL-UNNAMED "
+AMBARI_JVM_ARGS+="--add-opens java.base/java.util.regex=ALL-UNNAMED "
+AMBARI_JVM_ARGS+="--add-opens java.base/java.util=ALL-UNNAMED "
+AMBARI_JVM_ARGS+="--add-opens java.base/java.lang.reflect=ALL-UNNAMED "
+AMBARI_JVM_ARGS+="-Xms512m -Xmx2048m "
+AMBARI_JVM_ARGS+="-Djava.security.auth.login.config=$ROOT/etc/ambari-server/conf/krb5JAASLogin.conf
"
+AMBARI_JVM_ARGS+="-Djava.security.krb5.conf=/etc/krb5.conf "
+AMBARI_JVM_ARGS+="-Djavax.security.auth.useSubjectCredsOnly=false "
+AMBARI_JVM_ARGS+="-Dcom.sun.jndi.ldap.connect.pool.protocol=\"plain ssl\" "
+AMBARI_JVM_ARGS+="-Dcom.sun.jndi.ldap.connect.pool.maxsize=20 "
+AMBARI_JVM_ARGS+="-Dcom.sun.jndi.ldap.connect.pool.timeout=300000"
+export AMBARI_JVM_ARGS
-AMBARI_PASSHPHRASE="DEV"
-export AMBARI_JVM_ARGS="$AMBARI_JVM_ARGS -Xms512m -Xmx2048m
-XX:MaxPermSize=128m -Djdk.tls.ephemeralDHKeySize=2048
-Djava.security.auth.login.config=$ROOT/etc/ambari-server/conf/krb5JAASLogin.conf
-Djava.security.krb5.conf=/etc/krb5.conf
-Djavax.security.auth.useSubjectCredsOnly=false
-Dcom.sun.jndi.ldap.connect.pool.protocol=\"plain ssl\"
-Dcom.sun.jndi.ldap.connect.pool.maxsize=20
-Dcom.sun.jndi.ldap.connect.pool.timeout=300000"
-export PATH=$PATH:$ROOT/var/lib/ambari-server
-export PYTHONPATH=$ROOT/usr/lib/ambari-server/lib:$PYTHONPATH
+# Update PATH to include Ambari server directory
+export PATH="$PATH:$ROOT/var/lib/ambari-server"
-# customize python binary for ambari
-# export PYTHON=/usr/bin/python3
+# Set Python path for Ambari server
+export PYTHONPATH="/usr/lib/ambari-server/lib:$PYTHONPATH"
-# to add additional directory or jar to server classpath use SERVER_CLASSPATH
variable
-# export SERVER_CLASSPATH=/etc/hadoop/conf/secure
+# Additional server classpath can be set using SERVER_CLASSPATH
+# Uncomment the following line to add additional directories or jars
+# export SERVER_CLASSPATH=/etc/hadoop/conf/secure
\ No newline at end of file
diff --git a/ambari-server/src/main/python/ambari_server_main.py
b/ambari-server/src/main/python/ambari_server_main.py
index c68ec8ca3f..e7218827ac 100644
--- a/ambari-server/src/main/python/ambari_server_main.py
+++ b/ambari-server/src/main/python/ambari_server_main.py
@@ -56,7 +56,7 @@ if ambari_provider_module is not None:
ambari_provider_module_option = "-Dprovider.module.class=" + \
ambari_provider_module + " "
-jvm_args = os.getenv('AMBARI_JVM_ARGS', '-Xms512m -Xmx2048m
-XX:MaxPermSize=128m')
+jvm_args = os.getenv('AMBARI_JVM_ARGS', '-Xms512m -Xmx2048m')
ENV_FOREGROUND_KEY = "AMBARI_SERVER_RUN_IN_FOREGROUND"
CHECK_DATABASE_HELPER_CMD = "{0} -cp {1}
org.apache.ambari.server.checks.DatabaseConsistencyChecker"
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]