Support Questions

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

how to check that blueprint installed but not by curl API

avatar

how to check that blueprint installed on ambari-server machine but not by curl API

we need that because we need to identify from bash script that blueprint is installed or not

since ambari-server can be stop then we cant verify BY API

so please suggest if we can validate for sure blueprint installation by search some files or folder on the ambari-server machine

or other approtch ?

Michael-Bronson
1 ACCEPTED SOLUTION

avatar
Master Mentor
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login
9 REPLIES 9

avatar
Master Mentor
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login

avatar

I see an other way to check if BP installed - by hdp-select

what you think? ( if BP not installed then this command will not be exsist )

 hdp-select | grep hadoop-client
hadoop-client - 2.6.0.3-8
Michael-Bronson

avatar
Master Mentor

@Michael Bronson

You can also check the successfully registered Blueprints details inside the Ambari DB

Example:

# psql -U ambari ambari -c "select * from blueprint"
Password for user ambari: bigdata
 blueprint_name | security_type | security_descriptor_reference | stack_id 
----------------+---------------+-------------------------------+----------
 BlueprintTest  | NONE  |  |  6
(1 row)

.

"hdp-select" sets a given version to be the current version, by creating appropriate symlinks to the folder with appropriate version number. This utility "hdp-select" also lists the installed component versions based on the symlink info. So we can not rely on it to validate the blueprint registration. And this command is installed when the HDP components are installed on the host.

So it can not be used for blueprint installation validation as installation might fail on some hosts or might be incomplete installation Or symlinks might be broken ...etc

.

avatar

if you not accept that solution maybe you can suggest some file with hadoop version or other signature file for validation

Michael-Bronson

avatar

please show me the fulll syntax because I get (Password for user ambari:) , can we run this command without enter pass?

or maybe set the password in command ( because I need to set it in the script )

Michael-Bronson

avatar
Master Mentor

@Michael Bronson

You can refer to Standard Postgres Documentation in order to know how to pass the password in Non Interactive mode.

Following doc shows a way: https://www.postgresql.org/docs/8.3/static/libpq-pgpass.html

avatar

I just want to ask - why this approach not works ?


su - postgres -c " psql -tc \"select * from blueprint\" " ERROR: relation "blueprint" does not exist LINE 1: select * from blueprint ^
Michael-Bronson

avatar
Master Mentor

@Michael Bronson

Please try this "-d ambari" to tell the database name as "ambari"

# su - postgres -c "psql -d ambari -tc 'select * from ambari.blueprint' 

.

Example:

# su - postgres -c "psql -d ambari -tc 'select * from ambari.blueprint' "
 BlueprintTest  | NONE          |                               |        6

.

avatar

well done Jay you are the best

Michael-Bronson