Member since
11-07-2016
637
Posts
253
Kudos Received
144
Solutions
My Accepted Solutions
| Title | Views | Posted |
|---|---|---|
| 2720 | 12-06-2018 12:25 PM | |
| 2862 | 11-27-2018 06:00 PM | |
| 2193 | 11-22-2018 03:42 PM | |
| 3567 | 11-20-2018 02:00 PM | |
| 6273 | 11-19-2018 03:24 PM |
11-29-2017
04:51 AM
1 Kudo
I tried this and it worked for me. Please let me know how it goes for you import requests
from requests.auth import HTTPBasicAuth
import json
ambari_username = "admin"
ambari_password = "admin"
base_url = "http://ambari_host:8080/api/v1/clusters/clustername/hosts"
basic_auth = HTTPBasicAuth(ambari_username, ambari_password)
data = {"RequestInfo":{"context":"Turn OFF Maintenance Mode for host","query":"Hosts/host_name.in(host1,host2)"},"Body":{"Hosts":{"maintenance_state":"ON"}}}
headers = {'X-Requested-By' : 'ambari'}
response = requests.put(base_url, data=json.dumps(data), auth=basic_auth, headers=headers,verify=False)
print response.status_code
assert response.status_code == 200 Thanks, Aditya
... View more
11-29-2017
04:07 AM
1 Kudo
@Meena Rajani, The API returns empty content on success. You can check the response code to make sure that it passed. assert response.status_code == 200 However if you still want to have more validations you can do the below import requests
from requests.auth import HTTPBasicAuth
ambari_username = "admin"
ambari_password = "admin"
base_url = "http://ambari_host:8080/api/v1/clusters/clustername/hosts/host1"
basic_auth = HTTPBasicAuth(ambari_username, ambari_password)
headers = {'X-Requested-By' : 'ambari'}
response = requests.get(base_url, auth=basic_auth, headers=headers,verify=False)
print response.status_code
maint_state = response.json()["Hosts"]["maintenance_state"]
print maint_state
assert maint_state == "OFF"
Thanks, Aditya
... View more
11-28-2017
01:33 PM
@Anurag Mishra, Can you make a small change to @Jay Kumar SenSharma's script as below and run the script and paste the output from subprocess import Popen, PIPE, STDOUT
p = Popen("mount", stdout=PIPE, stderr=STDOUT, shell=True)
out,err = p.communicate()
print "return code is :: " + str(p.returncode)
if out:
print "stdout is :: " + out
if err:
print "stderr is :: " + err
... View more
11-28-2017
12:40 PM
1 Kudo
@Sedat Kestepe, Is this a kerberized cluster?. Can you please check the below values. 1)zeppelin.notebook.storage is set to 'org.apache.zeppelin.notebook.repo.FileSystemNotebookRepo' in Advanced zeppelin-config 2) If it is a kerberized cluster then add these two configs in Custom zeppelin-config zeppelin.server.kerberos.keytab= /etc/security/keytabs/zeppelin.server.kerberos.keytab (default) zeppelin.server.kerberos.principal=zeppelin@REALM.COM (default) 3) Check if this folder exist in HDFS /user/zeppelin/notebook Make these changes and restart zeppelin.
... View more
11-23-2017
04:24 PM
1 Kudo
@Nirmal J, Can you please change the ResourceManager , NodeManager, Timeline service address to proper hostnames instead of localhost and try restarting the services. yarn.timeline-service.webapp.address: localhost:8188 to {timeline server hostname}:8188 yarn.timeline-service.address : localhost:10200 to {timeline server hostname}:10200 yarn.resourcemanager.address: localhost:8050 to {rmhostname}:8050 yarn.resourcemanager.hostname: localhost to {rmhostname} Make sure to remove all localhost and replace with proper hostnames.
... View more
11-23-2017
04:18 PM
@Nirmal J, Can you run the command and check if it giving all the node managers. yarn node -list
... View more
11-23-2017
02:49 PM
@Nisha, I'm not sure if we can add MySQL commands to a blueprint. The idea is to install and setup MySQL server and then trigger the blueprint as Ranger has this as a pre-requisite. If you have a MySQL server installed and set 'create_db_users' as true, then ranger will create the users for you provided you give MySQL's root credentials.
... View more
11-23-2017
01:57 PM
@Nirmal J, Looks like all your NodeManagers are down or you dont have any nodemanagers. Go to Yarn and check if node managers are running or not. Start them if they are not running. If you do not have node managers add a node manager and start it. Adding a Nodemanager: Click on Hosts -> Select a Host -> Add -> NodeManager. Thanks, Aditya
... View more
11-23-2017
11:30 AM
Can you please accept the answer if this helped. It will be useful for other community users.
... View more
11-23-2017
11:22 AM
@M B, Atlas will by default use the HBase installed as part of the cluster. If you want to use another instance of Hbase may be a standalone version of HBase which is not part of HDP then you have to update the property 'HBASE_CONF_DIR' to point it to another version of HBase. This has nothing to do with Ranger installation. You should have seen this initially while adding atlas as well and you will be seeing this while adding other services. Just make sure you use the right value for HBASE_CONF_DIR if you are using other instance of HBase. Else you can just ignore the warning. Thanks, Aditya
... View more