Created 01-10-2018 12:46 PM
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 ?
Created 01-10-2018 12:58 PM
Ambari Blueprints can be registered to Ambari Server only when the Ambari Server is running.
So if there is any error while registering a Blueprint to Ambari Server then we should see the error immediately.
There is no offline way to validate the Blueprint. You will need to make ambari API call to list successfully registered Blueprints
# curl -H "X-Requested-By: ambari" -X GET -u admin:admin http://c6401.ambari.apache.org:8080/api/v1/blueprints
.
You can only enable or disable topology validation and register a blueprint:
POST /api/v1/blueprints/:blueprintName?validate_topology=false
Created 01-10-2018 12:58 PM
Ambari Blueprints can be registered to Ambari Server only when the Ambari Server is running.
So if there is any error while registering a Blueprint to Ambari Server then we should see the error immediately.
There is no offline way to validate the Blueprint. You will need to make ambari API call to list successfully registered Blueprints
# curl -H "X-Requested-By: ambari" -X GET -u admin:admin http://c6401.ambari.apache.org:8080/api/v1/blueprints
.
You can only enable or disable topology validation and register a blueprint:
POST /api/v1/blueprints/:blueprintName?validate_topology=false
Created 01-10-2018 01:07 PM
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
Created 01-10-2018 01:15 PM
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
.
Created 01-10-2018 01:12 PM
if you not accept that solution maybe you can suggest some file with hadoop version or other signature file for validation
Created 01-10-2018 01:19 PM
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 )
Created 01-10-2018 01:27 PM
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
Created 01-10-2018 02:01 PM
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 ^
Created 01-10-2018 02:16 PM
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
Created 01-10-2018 02:28 PM
well done Jay you are the best