From ddaf643550855f045c7e9cfc8d91df470514bc3b Mon Sep 17 00:00:00 2001 From: jialiang Date: Fri, 8 Nov 2024 14:50:05 +0800 Subject: [PATCH 1/3] for test --- ambari-server/conf/unix/ambari-env.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ambari-server/conf/unix/ambari-env.sh b/ambari-server/conf/unix/ambari-env.sh index d080f46fc70..b8f2f4f08db 100644 --- a/ambari-server/conf/unix/ambari-env.sh +++ b/ambari-server/conf/unix/ambari-env.sh @@ -19,9 +19,8 @@ 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 - # customize python binary for ambari # export PYTHON=/usr/bin/python3 # to add additional directory or jar to server classpath use SERVER_CLASSPATH variable -# export SERVER_CLASSPATH=/etc/hadoop/conf/secure +# export SERVER_CLASSPATH=/etc/hadoop/conf/secure \ No newline at end of file From e594bf3131cfeab5370ede4b1c68c5ca2879356c Mon Sep 17 00:00:00 2001 From: jialiang Date: Fri, 8 Nov 2024 16:22:00 +0800 Subject: [PATCH 2/3] fix ambari agent env after jdk upgrade --- ambari-agent/conf/unix/ambari-env.sh | 6 ------ ambari-server/conf/ambari-env.sh | 7 ++++++- ambari-server/conf/unix/ambari-env.sh | 18 +++++++++--------- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/ambari-agent/conf/unix/ambari-env.sh b/ambari-agent/conf/unix/ambari-env.sh index 9b4e3e2ab61..1a7d05e1cba 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 62fee14a5f5..ec3dab4e920 100644 --- a/ambari-server/conf/ambari-env.sh +++ b/ambari-server/conf/ambari-env.sh @@ -12,7 +12,12 @@ # 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_JVM_ARGS:=}" +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 " +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" 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 b8f2f4f08db..ef896aa40bc 100644 --- a/ambari-server/conf/unix/ambari-env.sh +++ b/ambari-server/conf/unix/ambari-env.sh @@ -13,14 +13,14 @@ # 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_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 -# customize python binary for ambari -# export PYTHON=/usr/bin/python3 - +: "${AMBARI_JVM_ARGS:=}" +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 " +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" +AMBARI_PID_DIR=/var/run/ambari-server +AMBARI_PASSPHRASE="DEV" +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 \ No newline at end of file From 79c8ba53b3924d94f10f3e6057505309991ec432 Mon Sep 17 00:00:00 2001 From: jialiang Date: Fri, 8 Nov 2024 17:39:55 +0800 Subject: [PATCH 3/3] remove incompatible jvm options which will block ambari serve start --- ambari-server/src/main/python/ambari_server_main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ambari-server/src/main/python/ambari_server_main.py b/ambari-server/src/main/python/ambari_server_main.py index c68ec8ca3ff..e7218827ac3 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 @@ 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"