Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

how to resolve this error Unable to determine server PID. Retrying...???

avatar
Explorer

when i was fire command

 ->  sudo ambari-server start

show error

 

Using python /usr/bin/python
Starting ambari-server
Ambari Server running with administrator privileges.
Organizing resource files at /var/lib/ambari-server/resources...
Ambari database consistency check started...
Server PID at: /var/run/ambari-server/ambari-server.pid
Server out at: /var/log/ambari-server/ambari-server.out
Server log at: /var/log/ambari-server/ambari-server.log
sudo ambari-server start
Using python /usr/bin/python
Starting ambari-server
Ambari Server running with administrator privileges.
Organizing resource files at /var/lib/ambari-server/resources...
Ambari database consistency check started...
Server PID at: /var/run/ambari-server/ambari-server.pid
Server out at: /var/log/ambari-server/ambari-server.out
Server log at: /var/log/ambari-server/ambari-server.log
Waiting for server start.........Unable to determine server PID. Retrying...
......Unable to determine server PID. Retrying...
......Unable to determine server PID. Retrying...
ERROR: Exiting with exit code -1.
REASON: Ambari Server java process died with exitcode 1. Check /var/log/ambari-server/ambari-server.out for more information.

1 ACCEPTED SOLUTION

avatar
Master Mentor

@AarifAkhter 

 

As you can see that ambari is saying that you may find more detailed cause of failure inside the logs :

REASON: Ambari Server java process died with exitcode 1. 
Check /var/log/ambari-server/ambari-server.out for more information.


Can you please share the output of "/var/log/ambari-server/ambari-server.log" and "/var/log/ambari-server/ambari-server.out" file it will show some errors.

 

Also please let us know if you are running ambari server as root user or non root user?

View solution in original post

7 REPLIES 7

avatar
Master Mentor

@AarifAkhter 

 

As you can see that ambari is saying that you may find more detailed cause of failure inside the logs :

REASON: Ambari Server java process died with exitcode 1. 
Check /var/log/ambari-server/ambari-server.out for more information.


Can you please share the output of "/var/log/ambari-server/ambari-server.log" and "/var/log/ambari-server/ambari-server.out" file it will show some errors.

 

Also please let us know if you are running ambari server as root user or non root user?

avatar
Explorer

30 Jan 2020 10:13:19,734 ERROR [main] DBAccessorImpl:119 - Error while creating database accessor
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database 'MariaDB'
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.Util.getInstance(Util.java:386)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4187)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4119)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:927)
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1709)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1252)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2488)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2521)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2306)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:839)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:49)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:421)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:350)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at org.apache.ambari.server.orm.DBAccessorImpl.<init>(DBAccessorImpl.java:93)
at org.apache.ambari.server.orm.DBAccessorImpl$$FastClassByGuice$$86dbc63e.newInstance(<generated>)
at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)
at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:60)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.Scopes$1$1.get(Scopes.java:65)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:54)
at com.google.inject.internal.SingleFieldInjector.inject(SingleFieldInjector.java:53)
at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:110)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:94)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.Scopes$1$1.get(Scopes.java:65)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
at com.google.inject.internal.SingleFieldInjector.inject(SingleFieldInjector.java:53)
at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:110)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:94)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.Scopes$1$1.get(Scopes.java:65)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
at com.google.inject.internal.SingleFieldInjector.inject(SingleFieldInjector.java:53)
at com.google.inject.internal.InjectionRequestProcessor$StaticInjection$1.call(InjectionRequestProcessor.java:116)
at com.google.inject.internal.InjectionRequestProcessor$StaticInjection$1.call(InjectionRequestProcessor.java:110)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1024)
at com.google.inject.internal.InjectionRequestProcessor$StaticInjection.injectMembers(InjectionRequestProcessor.java:110)
at com.google.inject.internal.InjectionRequestProcessor.injectMembers(InjectionRequestProcessor.java:78)
at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:170)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:109)
at com.google.inject.Guice.createInjector(Guice.java:95)
at com.google.inject.Guice.createInjector(Guice.java:72)
at com.google.inject.Guice.createInjector(Guice.java:62)
at org.apache.ambari.server.controller.AmbariServer.main(AmbariServer.java:992)
30 Jan 2020 10:13:19,740 ERROR [main] DBAccessorImpl:119 - Error while creating database accessor
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database 'MariaDB'

avatar
Master Mentor

@AarifAkhter 

Looks like you have  not done the Database setup correctly  thats the reason it is failing to determine the MariaDB settings

 

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database 'MariaDB'

 

Please share the exact ambari server version and the output of the following commands:

# grep 'jdbc' /etc/ambari-server/conf/ambari.properties

# ambari-server --version

Have you setup the maria Db correctly?  
Is MariaDB supported version listed for your Ambari version in Support matrix?  
https://supportmatrix.hortonworks.com/

avatar
Master Mentor

@AarifAkhter 

Please check the below doc if you ahve specified the Maria DB type correctly as mentioned in the following doc:

https://docs.cloudera.com/HDPDocuments/Ambari-2.7.5.0/administering-ambari/content/amb_using_ambari_...

# ambari-server setup --jdbc-db=mysql --jdbc-driver=/path/to/mysql/mysql-connector-java.jar

avatar
Master Mentor

@AarifAkhter 
For MariaDB as well can you chose the --jdbc-db=mysql while setting up the Ambari DB.
Or please update the ambari.properties  to  mysql where you might have selected as MariaDB

server.jdbc.database=mysql

 

https://github.com/apache/ambari/blob/branch-2.7/ambari-server/src/main/python/ambari_server/dbConfi...

Reference Doc: https://docs.cloudera.com/HDPDocuments/Ambari-2.7.5.0/administering-ambari/content/amb_using_ambari_...

avatar
Explorer

[centos@iplocalhost ~]$ grep 'jdbc' /etc/ambari-server/conf/ambari.properties
custom.mysql.jdbc.name=mysql-connector-java.jar
previous.custom.mysql.jdbc.name=mysql-connector-java.jar
server.jdbc.connection-pool=c3p0
server.jdbc.connection-pool.acquisition-size=5
server.jdbc.connection-pool.idle-test-interval=7200
server.jdbc.connection-pool.max-age=0
server.jdbc.connection-pool.max-idle-time=14400
server.jdbc.connection-pool.max-idle-time-excess=0
server.jdbc.database=mysql
server.jdbc.database_name=MariaDB
server.jdbc.driver=com.mysql.jdbc.Driver
server.jdbc.hostname=localhost
server.jdbc.port=3306
server.jdbc.rca.driver=com.mysql.jdbc.Driver
server.jdbc.rca.url=jdbc:mysql://ip-172-31-9-188.us-east-2.compute.internal:3306/MariaDB
server.jdbc.rca.user.name=ambari
server.jdbc.rca.user.passwd=/etc/ambari-server/conf/password.dat
server.jdbc.url=jdbc:mysql://ip-172-31-9-188.us-east-2.compute.internal:3306/MariaDB
server.jdbc.user.name=ambari
server.jdbc.user.passwd=/etc/ambari-server/conf/password.dat

 

[centos@iplocalhost ~]$ ambari-server --version
2.5.2.0-298

 

database is correctly setup no error in database

avatar
Master Mentor

@AarifAkhter 

While setting up your maria DB have you performed the step mentioned in the doc as
https://docs.cloudera.com/HDPDocuments/Ambari-2.5.2.0/bk_ambari-administration/content/using_ambari_...

 

 

You must pre-load the Ambari database schema into your MySQL database using the schema script. Run the script in the same location where you find the Ambari-DDL-MySQL-CREATE.sql file. You should find the Ambari-DDL-MySQL-CREATE.sql file in the /var/lib/ambari-server/resources/ directory of the Ambari Server host, after you have installed Ambari Server.

 

 


Ambari also shows this kind of message whenuser performs "ambari-server setup" while setting up the database.

 

 

WARNING: Before starting Ambari Server, you must run the following DDL directly from the database shell to create the schema: /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql

 

 

 

.

 

Also please let us know if  your MariaDB instance running on  "localhost"  Or on "ip-172-31-9-188.xxxxxxxxxxxxxxx.internal"

Can you please change the "localhost" to the hostname of the DB.

 

 

server.jdbc.hostname=ip-172-31-9-188.xxxxxxxxxxxxxxx.internal

 

 

 

Also please verify if the "MariaDB" exist on the mariaDB running on host 'ip-172-31-9-188.xxxxxxxxxxxxxxx.internal'

 

 

# mysql -u ambari -p
Enter password: 

show databases;

 

 

.