Support Questions

Find answers, ask questions, and share your expertise

I could not log in in the Abari

avatar

Hello every body

I start with the VM Sandbox and I could not log in in the Abari

11050-ambari.png

netstat -taupen |grep 8080

tcp 0 0 :::18080 :::* LISTEN 513 65820 2221/java

tcp 0 0 :::8080 :::* LISTEN 0 162604 20044/java

[root@sandbox ~]#

So that looks god for me

Then I look at the server log and I find that!

I hope that someone could help me bat I had no idea wat I should do as next!

I also restart the Amari service twice, but the same ;-(

tail /var/log/ambari-server/ambari-server.log

aused by: org.postgresql.util.PSQLException: ERROR: could not read block 0 of relation base/16384/2704: read only 0 of 8192 bytes  
 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2161)   
 at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1890)   
 at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)  
 at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:559)  
 at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:417)  
 at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:302)   
 at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeSelect(DatabaseAccessor.java:1009)   
 at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:644)  
1 ACCEPTED SOLUTION

avatar
@jay SenSharma 

I run the ambari-server setup 
And ambari-admin-password-reset But the same log entry and the same ;-( 
I check the pg_hba.conf file and maybe there is the problem!

cat /var/lib/pgsql/data/pg_hba.conf

# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD 
# "local" is for Unix domain socket connections only         
local   all   postgres                               ident   
# IPv4 local connections:                                    
host    all   postgres         127.0.0.1/32          ident   
# IPv6 local connections:                                    
host    all   postgres         ::1/128               ident   
local  all  ambari,mapred md5                                
host  all   ambari,mapred 0.0.0.0/0  md5                     
host  all   ambari,mapred ::/0 md5                           

View solution in original post

8 REPLIES 8

avatar
Super Collaborator
@bob human

Problem seems to be at postgres. Can you please try to connect to postgres and check if you can query any table.

#df -h

#psql -U ambari ambari

ambari>select * from host;

avatar

@rguruvannagari

Thanks for your help!

I try to connect but I don’t know the Password for user ambari !

Where I can find it or where can I set it?

[root@sandbox /]# psql -U ambari ambari                                                                                                                                                                            
Password for user ambari:                                                                                                                                                                                          
psql: FATAL:  password authentication failed for user "ambari" 

avatar
Master Mentor

@bob human

The default ambari DB password should be "bigdata". Did you try the same?

As your error clearly indicates DB corruption (need a DB fix). Hence if it is fresh installation then we will suggest you to reinstall the Ambari Server.As while performing the "ambari-server setup" it will freshly setup an Embedded Postgres Database (with all the required configurations).

Or else you can choose some external non default Databases as well if you want.

http://docs.hortonworks.com/HDPDocuments/Ambari-2.2.2.0/bk_ambari_reference_guide/content/ch_amb_ref...

.

avatar
@jay SenSharma 

I run the ambari-server setup 
And ambari-admin-password-reset But the same log entry and the same ;-( 
I check the pg_hba.conf file and maybe there is the problem!

cat /var/lib/pgsql/data/pg_hba.conf

# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD 
# "local" is for Unix domain socket connections only         
local   all   postgres                               ident   
# IPv4 local connections:                                    
host    all   postgres         127.0.0.1/32          ident   
# IPv6 local connections:                                    
host    all   postgres         ::1/128               ident   
local  all  ambari,mapred md5                                
host  all   ambari,mapred 0.0.0.0/0  md5                     
host  all   ambari,mapred ::/0 md5                           

avatar
[root@sandbox /]# psql -U raj_ops ambari                                                           
psql: FATAL:  no pg_hba.conf entry for host "[local]", user "raj_ops", database "ambari", SSL off

Now I try to connect with raj_ops to ambari and I get that error!

avatar

I solve this problem whit update the file /var/lib/pgsql/data/pg_hba.conf

to

# "local" is for Unix domain socket connections only                                            
local   all   postgres                               trust                               
# IPv4 local connections:                                                                                                                                                                      
host    all   postgres         127.0.0.1/32          trust                                     
host    all   all              172.16.4.183/24       trust                                                                                           
# IPv6 local connections:                                                                                                                                                                                          
host    all   postgres         ::1/128               trust                                      
local  all   all md5                                                                           
host  all   ambari,mapred 0.0.0.0/0  md5                                                       
host  all   ambari,mapred ::/0 md5              

It is a work around!

but anyway the ambari login did not work !

avatar

@Jay SenSharma

I try to reindex the table but i need Superuser rights to do this !

ambari=> select oid,relname from pg_class where oid =16384 or oid=2704;                               
 oid  |          relname                                                                              
------+---------------------------                                                                                                                                                                           
 2704 | pg_type_typname_nsp_index                                                                                                  
(1 row)                                                                                                 

Then I try to REINDEX how I can get own rights to the index ?

ambari=> REINDEX INDEX pg_type_typname_nsp_index;                                                      
ERROR:  must be owner of relation pg_type_typname_nsp_index                                                                                                                                          
ambari=> \du                                                                                                        List of roles                                                                         
 Role name  | Attributes  | Member of                                                               
------------+-------------+-----------                                                                 
 ambari     |             | {}                                                                     
 kappacherr |             | {}                                                                      
 postgres   | Superuser   | {}                                                                         
            : Create role                                                                              
            : Create DB                          

avatar

I solve the problem now !!!!!!

it is working ! 😉

I reindex the index withe the posgres user and it works now!

ambari=# REINDEX INDEX pg_type_typname_nsp_index;                                                     
REINDEX                                                                                               
ambari=# \di pg_type_typname_nsp_index;                                                                                                                                                                       
                          List of relations                                                                                                                                                                   
   Schema   |           Name            | Type  |  Owner   |  Table                                    -----------+---------------------------+-------+----------+---------                                  pg_catalog | pg_type_typname_nsp_index | index | postgres | pg_type                                                                                                                                          
(1 row)                                                     

Many thanks to all for the great support!

special thanx to Jay SenSharma

BOB