Support Questions
Find answers, ask questions, and share your expertise

Re-installing ambari-server on existing HDF platform without any data loss

New Contributor

Hi!

I have a 7 node HDF cluster installed on local repo (without internet access)

Is there any way to "re install" ambari-server after it has been removed by the command:

sudo yum erase ambari-server

 

None of the other files were removed, I just reinstalled ambari-server

sudo yum install ambari-server

 

Is there any way this can be undone / reconfigured / reinstalled? I noticed that the services are still up and running, and only the ambari-server UI is not starting.

This is in production and I do not want to lose any data. Kindly help me find a solution for the same!

 

I used sudo ambari-server setup to configure Java Home and JDBC connection.

I even used sudo ambari-server setup-security to enable HTTPS and setup truststore for ambari (like it used to be)

 

When I run the command sudo ambari-server start it gives following message:

 

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..............ERROR: Exiting with exit code -1.
REASON: Ambari Server java process has stopped. Please check the logs for more information.

 

ambari-server.out

 

OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
An unexpected error occured during starting Ambari Server.
com.google.inject.ProvisionException: Guice provision errors:

1) Error injecting method, java.lang.RuntimeException: Trying to create a ServiceComponent not recognized in stack info, clusterName=cluster_name, serviceName=NIFI, componentName=NIFI_MASTER, stackInfo=HDF-3.1
at org.apache.ambari.server.state.cluster.ClustersImpl.loadClustersAndHosts(ClustersImpl.java:173)
at org.apache.ambari.server.state.cluster.ClustersImpl.class(ClustersImpl.java:95)
while locating org.apache.ambari.server.state.cluster.ClustersImpl
while locating org.apache.ambari.server.state.Clusters
for parameter 0 at org.apache.ambari.server.agent.HeartBeatHandler.<init>(HeartBeatHandler.java:115)
at org.apache.ambari.server.agent.HeartBeatHandler.class(HeartBeatHandler.java:79)
while locating org.apache.ambari.server.agent.HeartBeatHandler

1 error
at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:987)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1013)
at org.apache.ambari.server.controller.AmbariServer.performStaticInjection(AmbariServer.java:903)
at org.apache.ambari.server.controller.AmbariServer.run(AmbariServer.java:307)
at org.apache.ambari.server.controller.AmbariServer.main(AmbariServer.java:1072)
Caused by: java.lang.RuntimeException: Trying to create a ServiceComponent not recognized in stack info, clusterName=cluster_name, serviceName=NIFI, componentName=NIFI_MASTER, stackInfo=HDF-3.1

at org.apache.ambari.server.state.ServiceComponentImpl.updateComponentInfo(ServiceComponentImpl.java:141)
at org.apache.ambari.server.state.ServiceComponentImpl.<init>(ServiceComponentImpl.java:170)
at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)
at com.google.inject.internal.ProxyFactory$ProxyConstructor.newInstance(ProxyFactory.java:260)
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.InjectorImpl$4$1.call(InjectorImpl.java:978)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:974)
at com.google.inject.assistedinject.FactoryProvider2.invoke(FactoryProvider2.java:632)
at com.sun.proxy.$Proxy19.createExisting(Unknown Source)
at org.apache.ambari.server.state.ServiceImpl.<init>(ServiceImpl.java:162)
at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)
at com.google.inject.internal.ProxyFactory$ProxyConstructor.newInstance(ProxyFactory.java:260)
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.InjectorImpl$4$1.call(InjectorImpl.java:978)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:974)
at com.google.inject.assistedinject.FactoryProvider2.invoke(FactoryProvider2.java:632)
at com.sun.proxy.$Proxy15.createExisting(Unknown Source)
at org.apache.ambari.server.state.cluster.ClusterImpl.loadServices(ClusterImpl.java:427)
at org.apache.ambari.server.state.cluster.ClusterImpl.<init>(ClusterImpl.java:318)
at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)
at com.google.inject.internal.ProxyFactory$ProxyConstructor.newInstance(ProxyFactory.java:260)
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.InjectorImpl$4$1.call(InjectorImpl.java:978)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:974)
at com.google.inject.assistedinject.FactoryProvider2.invoke(FactoryProvider2.java:632)
at com.sun.proxy.$Proxy11.create(Unknown Source)
at org.apache.ambari.server.state.cluster.ClustersImpl.loadClustersAndHosts(ClustersImpl.java:181)
at org.apache.ambari.server.orm.AmbariJpaLocalTxnInterceptor.invoke(AmbariJpaLocalTxnInterceptor.java:128)
at org.apache.ambari.server.state.cluster.ClustersImpl$$FastClassByGuice$$7d58855f.invoke(<generated>)
at com.google.inject.internal.cglib.reflect.$FastMethod.invoke(FastMethod.java:53)
at com.google.inject.internal.SingleMethodInjector$1.invoke(SingleMethodInjector.java:56)
at com.google.inject.internal.SingleMethodInjector.inject(SingleMethodInjector.java:90)
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.FactoryProxy.get(FactoryProxy.java:54)
at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38)
at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:84)
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.InjectorImpl$4$1.call(InjectorImpl.java:978)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1024)
at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:974)
... 4 more
Exception in thread "main" org.apache.ambari.server.AmbariException: Error stopping the server
at org.apache.ambari.server.controller.AmbariServer.stop(AmbariServer.java:884)
at org.apache.ambari.server.controller.AmbariServer.main(AmbariServer.java:1080)

2 REPLIES 2

Cloudera Employee

Hi 

 

This issue occurs when there are residual records in Ambari database although the value added service is cleared from Ambari during the upgrade.

 

To resolve this issue, do the following:

  1. Take a backup of the database.
  2. Run the following statement in database CLI: 
    DELETE FROM servicedesiredstate WHERE service_name in ('WEBUIFRAMEWORK','DATASERVERMANAGER');
    DELETE FROM hostcomponentstate WHERE service_name in ('WEBUIFRAMEWORK','DATASERVERMANAGER');
    DELETE FROM hostcomponentdesiredstate WHERE service_name in ('WEBUIFRAMEWORK','DATASERVERMANAGER');
    DELETE FROM servicecomponentdesiredstate WHERE service_name in ('WEBUIFRAMEWORK','DATASERVERMANAGER');
    DELETE FROM clusterservices WHERE service_name in ('WEBUIFRAMEWORK','DATASERVERMANAGER');
  3. Restart Ambari server.

If you are still facing the issue after the above steps, please the the complete ambari server log from /var/log/ambari-server directory on ambari server host

 

Refer the below article

https://my.cloudera.com/knowledge/ERROR-quot-Can-not-get-service-info-stackName-HDP?id=272879

Mentor

@iPanda 

Adding Ambari for management purposes over an existing cluster is called as "Ambari Takeover". I did a write on that some years back Ambari take-over 

Here is another source of good info to try out referenced from Adaltas  

Please read carefully to fully understand the steps required

; ;