Member since
06-20-2016
308
Posts
103
Kudos Received
29
Solutions
05-21-2019
09:49 PM
1. Get the output from Ambari server http://AMBARI-HOST:8080/api/v1/stacks/HDP/versions?fields=repository_versions/operating_systems/repositories/*,repository_versions/operating_systems/OperatingSystems/*&repository_versions/RepositoryVersions/repository_version=3.1.0.0-78 2. Copy the json of "operating_systems" outer block of step1 output and create repo.json file - it would looks like repo.json 3. update repo.json file to reflect your changes/modifications. 4. now run below API call to update. curl -insecure -H "X-Requested-By:ambari" --user admin:admin --data @repo.json -X PUT http://AMBARI-HOST:8080/api/v1/stacks/HDP/versions/3.1/repository_versions/1 Note: please make sure you include correct repo version id at the end. in this case it is 1 5. Now go and check in UI to see if those changes reflects. Note: This tried and tested in Ambari2.7.x
... View more
Labels:
11-14-2018
06:33 PM
3 Kudos
Steps to fix below Database consistency WARNINGs in Ambari 2.7.x WARN - You have config(s): webhcat-site-version1540591929056,webhcat-log4j-version1540591928580,hive-exec-log4j-version1540591929168,webhcat-env-version1540591929289,hive-log4j-version1540591929465,hcat-env-version1540591928892 that is(are) not mapped (in serviceconfigmapping table) to any service! CREATE TEMPORARY TABLE orphaned_configs AS
(select config_id,type_name,version_tag from clusterconfig where unmapped != 1 and type_name not in ('cluster-env') and config_id not in (
SELECT
cc.config_id
FROM clusterconfig cc, serviceconfig sc, serviceconfigmapping scm
WHERE cc.type_name != 'cluster-env'
AND cc.config_id = scm.config_id
AND scm.service_config_id = sc.service_config_id));
Update clusterconfig set unmapped = 1 where config_id in (select config_id from orphaned_configs);
drop table orphaned_configs;
If it is 2.6.x then following query can be used SELECT cc.config_id, cc.type_name, cc.version_tag
FROM ambari.clusterconfig cc, ambari.clusterconfig ccm
WHERE cc.config_id NOT IN (SELECT scm.config_id FROM ambari.serviceconfigmapping scm)
AND cc.type_name != 'cluster-env' AND cc.type_name = ccm.type_name AND cc.version_tag =
ccm.version_tag;
CREATE TEMPORARY TABLE orphaned_configs AS
(SELECT cc.config_id FROM ambari.clusterconfig cc WHERE cc.config_id NOT IN
(SELECT scm.config_id FROM ambari.serviceconfigmapping scm) AND cc.type_name !=
'cluster-env');
DELETE FROM ambari.clusterconfig WHERE config_id IN
(SELECT config_id from orphaned_configs);
... View more
Labels:
09-18-2018
10:13 PM
If cluster is installed with Ambari 2.5 , Upgrading to Ambari2.6.x cause service re-start ( client) failure and Add service also fails with installation. with above combination, you might be hitting https://issues.apache.org/jira/browse/AMBARI-24629 if you see error like below 2018-09-15 08:37:13,748 - Looking for matching packages in the following repositories: HDP-2.6, HDP-UTILS-1.1.0.21 2018-09-15
08:37:15,841 - No package found for hive_${stack_version}(hive_(\d|_)+$) 2018-09-15
08:37:15,844 - The repository with version 2.6.1.0-129 for this command has been marked as resolved. It will be used to report the version of the component which was installed root cause is already explained in the BUG. How to fix the issue: 1. First find out what is your current version repo version id. in browser go to http://apappu3.hdp.com:8080/api/v1/stacks/HDP/versions/2.6/repository_versions?fields=operating_systems/repositories/Repositories/base_url From the response find out the repository_version_id for the version. 2. Now create /tmp/data.json with below content {
"operating_systems" : [
{
"OperatingSystems" : {
"ambari_managed_repositories": false,
"os_type" : "redhat6",
"stack_name" : "HDP",
"stack_version" : "2.6"
},
"repositories" : [
{
"Repositories" : {
"base_url" : "",
"repo_id" : "MY-ID",
"repo_name" : "MY_name"
}
},
{
"Repositories" : {
"base_url" : "",
"repo_id" : "MY-UTILS",
"repo_name" : "MY-UTILS_name"
}
}
]
}
]
}
Note: replace "MY-ID"/"MY-UTILS" with the actual sateliterepotag and os_type as well. 3. now run below curl call to update it. curl -u admin -H "X-Requested-By: ambari" --data @data.json -X PUT /api/v1/stacks/HDP/versions/2.6/repository_versions/ID Now - refresh the UI and see if the updated tags are visible in version definition. Note: Please take Ambari database backup before running the CURL call
... View more
Labels:
09-18-2018
09:51 PM
Many times Ambari throws installation errors like "No package found for hive_${stack_version}(hive_(\d|_)+$) ..." There can be many reasons for this failure. The root cause for this issue is, basically Ambari could not be able to determine the installable package. Reason1: Check if the same package is already installed using different repoid/sateliterepotag. that can be check using below command yum list installed | grep packagename
Ex: yum list installed | grep hive If it shows the entries then determine if those are installed with different repoid/sateliterepotag. In Ambari task logs you can find what tag/repo Ambari is using to install Now see "yum list installed" has the correct repoId - if it is not matching then manually uninstall that library and let Ambari install it. Reason2: If you are using Satelite repository - Ambari should show the repo tag name at "Applicable repositories: Satelitehdp265.." If it is not showing correctly, that means you repo version definition is incorrect. Make sure sateliterepo tag is defined correctly. Reason3: If you have installed the cluster with Ambari 2.5.x and then upgraded to Ambari2.6.x then you might encounter AMBARI-24629 bug. please follow https://community.hortonworks.com/articles/223111/service-restartadd-fails-after-upgrading-to-ambari.html to fix that issue.
... View more
Labels:
09-13-2018
11:26 PM
When Ambari executes tasks like START/STOP/RESTART/... , it timeouts after waiting 20mins ( 1200 seconds). For example Namenode START command waits for 20mins and then mark the service is Failed/Timeout - in larger clusters NameNodes takes much longer time - How to tell Ambari to wait for much longer? Add below 2 configs and re-start the service - this change increases the timeout value to 1Hour. agent.task.timeout=3600
server.task.timeout=3600
Note: This change may not take affect during the Upgrade If it is already scheduled.
... View more
Labels:
09-13-2018
10:35 PM
While Upgrading/Downgrading HDP in Ambari, if you see "Unable to determine the stack and stack version" it is possible the repo version has some inconsistency. Post Ambari2.6.x, should have repo_version table "resolved" column as 1 - If it shows "0" then run below update query. update repo_version set resolved = 1 Re-start Ambari and then attempt the operation again - it should go through. Note: As of now it is not a BUG as we could not able to reproduce the issue.
... View more
Labels:
08-29-2018
10:40 PM
In Ambari when try to upgrade to HDP/HDF versions - after adding a new repo version, some times it might show disabled "install packages" button. There can be multiple reasons for this. 1. Check to stack_id which stack_id clusters table is pointing to. it should be pointed to correct current stack_id if not correct with update query 2. check clusterstate table - it should be pointing to correct current stack_id if not correct with update query 3. How to find my correct current stack_id run "select stack_id, version from repo_version" query - check the stack_id for your current hdp/hdf version. 4. so step1 and step2 should be pointing to stack_id returned in step3. There can be many other reasons like not having "upgrades" folder in stack folder or some other.
... View more
Labels:
08-22-2018
11:05 PM
While installing HDP components using Ambari some times it fails with below errors. raise Fail("Cannot match package for regexp name {0}. Available packages: {1}".format(name, self.available_packages_in_repos))
resource_management.core.exceptions.Fail: Cannot match package for regexp name zookeeper_${stack_version}. Available packages: [] What does this mean? basically Ambari is unable to find the packages. the possible reasons can be, Reason1: Is that host already have that binaries installed? If it is already installed using different repo-name then Ambari would not be able to determine those binaries. You can find out that by running yum list installed | grep zookeeper This tells using which tag/repo it was installed (look for specific HDP version). If you find entry and it was installed different tag/repo then manually remove above packages and attempt to install again. Reason2: Its possible that provided URL does not have those binaries. you can determine by running below command yum list available | grep zookeeper If it is not returning any list for that version then check tag/repoURL defined in Ambari to make sure it is correct.
... View more
Labels:
08-22-2018
10:29 PM
1 Kudo
Ambari 2.7 provides UI for API to learn and perform many of the operations. You can launch the UI and play - http://AMBARI-UI:8080/api-docs/ For example: You can delete the Host by simply entering the hostname in the UI. 1. Go to http://AMBARI-HOST:8080/api-docs/#!/Hosts/deleteHost 2. Move to "Delete a host" section 3. Enter the "hostname" 4. click on "Try" . Window popup shows the API response with response (errors) message and code like below. Similar many other Services/Groups/users API can be tried in the same page. This feature makes life easies to find and use the APIs.
... View more
Labels:
08-22-2018
10:07 PM
1 Kudo
Starting from Ambari 2.7 there are 2 new features to track who did what. 1. In operations history - for every operation there is a user name associated. 2. In Prior versions there is no way to find out who launched Install/Add wizards. Starting from 2.7 there is Username name being shows in the UI. These features make Administrators life easier to track who did what.
... View more
Labels: