Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

I can not run the ambari-server or ambari-agent

Highlighted

I can not run the ambari-server or ambari-agent

New Contributor

HI

I installed the ambari-server and ambari-agent and couldn't open them

for ambari-server I have this problem:

 

root@ahmad-ambari:~# ambari-server start
Using python /usr/bin/python
Starting ambari-server
Ambari Server running with administrator privileges.
ERROR: Exiting with exit code -1.
REASON: Before starting Ambari Server, you must copy the Oracle JDBC driver JAR file to /usr/share/java and set property "server.jdbc.driver.path=[path/to/custom_jdbc_driver]" in ambari.properties.

 

and for ambari-agnet my problem with open it in firefox :

 

root@ahmad-ambari:~# ambari-agent start
Verifying Python version compatibility...
Using python /usr/bin/python
Checking for previously running Ambari Agent...
ERROR: ambari-agent already running
Check /run/ambari-agent/ambari-agent.pid for PID.

 

when I write in firefox or any explore does not open (localhost:8080) or (ahmad-ambari:8080)

 

8 REPLIES 8

Re: I can not run the ambari-server or ambari-agent

Mentor

@AU 

I think you missed a step during your Ambari server setup ! Can you run the below command as the root user

Step1

Ensure that the file exists

# ls -al /usr/share/java/mysql-connector-java.jar
-rw-r--r-- 1 root root 883898 Jun 10 2014 /usr/share/java/mysql-connector-java.jar

The run the below command 

Step 2

# ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar

 

Step 3

After the above command please validate that this entry exist in the /etc/ambari-server/conf/ambari.properties file 

# cat /etc/ambari-server/conf/ambari.properties | grep mysql-connector-java.jar
custom.mysql.jdbc.name=mysql-connector-java.jar
previous.custom.mysql.jdbc.name=mysql-connector-java.jar

Step4

Restart the agent and the Ambari server 

# ambari-server stop

# ambari-server start

 

Then 

 

# ambari-agent stop

# ambari-agent start

 

Your problem should be resolved, please revert 

Re: I can not run the ambari-server or ambari-agent

New Contributor

Thanks for answering, but I'm looking in java file there are not file name mysql-connector-java.jar

and this code dose not work:

-rw-r--r-- 1 root root 883898 Jun 10 2014 /usr/share/java/mysql-connector-java.jar

 

if i remove and re-install it work !

Re: I can not run the ambari-server or ambari-agent

Mentor

@AU 

 

Assuming you are on Linux RHEL/Centos just add an extra step to my previous response do the following

Step 1

# yum install -y mysql-connector-java

Step 2

Ensure that the file exists

# ls -al /usr/share/java/mysql-connector-java.jar
-rw-r--r-- 1 root root 883898 Jun 10 2014 /usr/share/java/mysql-connector-java.jar

The run the below command

Step 3

# ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar

Step 4

After the above command please validate that this entry exist in the /etc/ambari-server/conf/ambari.properties file

# cat /etc/ambari-server/conf/ambari.properties | grep mysql-connector-java.jar
custom.mysql.jdbc.name=mysql-connector-java.jar
previous.custom.mysql.jdbc.name=mysql-connector-java.jar

Step 5

Restart the agent and the Ambari server

# ambari-server stop

# ambari-server start

Then finally

# ambari-agent stop

# ambari-agent start


Your problem should be resolved, please revert

Re: I can not run the ambari-server or ambari-agent

New Contributor

This code does not work with me yum install -y mysql-connector-java (but thanks I have use this link to download it: (https://dev.mysql.com/downloads/))

 

then every things ok

ls -al /usr/share/java/mysql-connector-java-8.0.17.jar
-rw-r--r-- 1 root root 2321795 Haz 7 14:56 /usr/share/java/mysql-connector-java-8.0.17.jar

and this

ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java-8.0.17.jar

and this

Ambari Server 'setup' completed successfully.

but

Using python /usr/bin/python
Starting ambari-server
Ambari Server running with administrator privileges.
ERROR: Exiting with exit code -1.
REASON: Before starting Ambari Server, you must copy the Oracle JDBC driver JAR file to /usr/share/java and set property "server.jdbc.driver.path=[path/to/custom_jdbc_driver]" in ambari.properties

 

The same error !!!!

 

Re: I can not run the ambari-server or ambari-agent

Mentor

@AU 

What the value of  " server.jdbc.driver.path=[path/to/custom_jdbc_driver] " if empty can you replace it with "/usr/share/java/mysql-connector-java-8.0.17.jar" Can you validate your JCE  if not download  JCE link 

Then on Ambari Server and on each host in the cluster, add the unlimited security policy JCE jars to $JAVA_HOME/jre/lib/security/.

For example, run the following to extract the policy jars into the JDK installed on your host:

unzip -o -j -q jce_policy-8.zip -d /usr/jdk64/jdk1.8.0_40/jre/lib/security/

 

 

Re: I can not run the ambari-server or ambari-agent

New Contributor

I search a lot for this path {server.jdbc.driver.path=[path/to/custom_jdbc_driver] } I could find any thing

 

for JCE I download it and use the code

unzip -o -j -q jce_policy-8.zip -d /usr/jdk64/jdk1.8.0_40/jre/lib/security/

dose not work, so I open zip file and try to copy it manually  

cp /home/ahmad/Downloads/UnlimitedJCEPolicyJDK8/local_policy.jar /usr/jdk64/jdk1.8.0_112/jre/lib/security/local_policy.jar

and i have this message 

cp: cannot create regular file '/usr/jdk64/jdk1.8.0_112/jre/lib/security/local_policy.jar': Permission denied

then i use code

ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java-8.0.17.jar

i have this

Using python /usr/bin/python
Setup ambari-server
Copying /usr/share/java/mysql-connector-java-8.0.17.jar to /var/lib/ambari-server/resources/mysql-connector-java-8.0.17.jar
Creating symlink /var/lib/ambari-server/resources/mysql-connector-java-8.0.17.jar to /var/lib/ambari-server/resources/mysql-connector-java.jar
If you are updating existing jdbc driver jar for mysql with mysql-connector-java-8.0.17.jar. Please remove the old driver jar, from all hosts. Restarting services that need the driver, will automatically copy the new jar to the hosts.
JDBC driver was successfully initialized.
Ambari Server 'setup' completed successfully.

 

and i used this code

/etc/init.d/mysql start

and i have this

[ ok ] Starting mysql (via systemctl): mysql.service.

 

but the same error

Re: I can not run the ambari-server or ambari-agent

Mentor

@AU 

As promised here is the download the document  read through and follow the steps

 

HTH

 

Re: I can not run the ambari-server or ambari-agent

New Contributor

Thank you Mr. Shelton I will visit the website 

Thanks for help

Best Regards.

Don't have an account?
Coming from Hortonworks? Activate your account here