Member since
11-07-2016
637
Posts
253
Kudos Received
144
Solutions
My Accepted Solutions
Title | Views | Posted |
---|---|---|
2224 | 12-06-2018 12:25 PM | |
2281 | 11-27-2018 06:00 PM | |
1775 | 11-22-2018 03:42 PM | |
2831 | 11-20-2018 02:00 PM | |
5134 | 11-19-2018 03:24 PM |
10-05-2017
10:56 AM
Hi @Ismael Boumedien, Is the cluster kerberized ? If yes, then the connection string should be "jdbc:phoenix:localhost:2181:/hbase-secure:<keytab path>:<principal>" ex: "jdbc:phoenix:localhost:2181:/hbase-secure:/keytab/ISMAEL.keytab:ISMAEL@MOCK" In the commented code , I see that you were using /hbase-unsecure. Thanks, Aditya
... View more
10-03-2017
10:48 AM
Hi @D Giri, Can you try re-generating the keytabs and check if it works. Ambari=>Admin=>Kerberos => Regenerate keytabs Thanks, Aditya
... View more
10-03-2017
07:34 AM
Hi @uri ben-ari, Check if you are running Kafka with DEBUG mode. It can generate tons of logs. You can modify these settings under Kafka -> Configs -> Advanced Kafka-log4j set log4j.rootLogger=INFO, stdout Additionally check Kafka Controller Log: # of backup files, Kafka Controller Log: # of backup file size, Kafka Log: # of backup files, Kafka Log: # of backup file size Thanks, Aditya
... View more
10-01-2017
12:04 PM
9 Kudos
This article describes how to add a new custom script and execute the script through Ambari. In this article, I took a simple use case to install kerberos packages through custom scripts. 1) Below is the code to install kerberos packages (install_kerberos_package.py) #!/usr/bin/env python
from resource_management import Script, Execute, format
from ambari_commons.os_check import OSCheck
from resource_management.core import shell
from resource_management.core.logger import Logger
class InstallKerberosPackage(Script):
def actionexecute(self, env):
config = Script.get_config()
structured_output = {}
cmd = self.get_install_cmd()
Logger.info("Installing Kerberos Package")
code, output = shell.call(cmd, sudo = True)
if 0 == code:
structured_output["install_kerberos_package"] = {"exit_code" : 0, "message": format("Packages installed successfully")}
else:
structured_output["install_kerberos_package"] = {"exit_code": code, "message": "Failed to install packages! {0}".format(str(output))}
self.put_structured_out(structured_output)
def get_install_cmd(self):
if OSCheck.is_redhat_family():
Logger.info("Installing kerberos package for the RedHat OS family");
return ("/usr/bin/yum", "install", "-y", "krb5-server", "krb5-libs", "krb5-workstation")
elif OSCheck.is_suse_family():
Logger.info("Installing kerberos package for the SUSE OS family");
return ('/usr/bin/zypper', '-n','install', 'krb5', 'krb5-server', 'krb5-client')
elif OSCheck.is_ubuntu_family():
Logger.info("Installing kerberos package for the Ubuntu OS family");
return ('/usr/bin/apt-get', 'install', '-y', 'krb5-kdc', 'krb5-admin-server')
else:
raise Exception("Unsupported OS family: '{0}' ".format(OSCheck.get_os_family()))
if __name__ == "__main__":
InstallKerberosPackage().execute() 2) Save the file with install_kerberos_package.py and put it in the custom actions folder of ambari and change the permissions cp install_kerberos_package.py /var/lib/ambari-server/resources/custom_actions/scripts/
chmod 755 /var/lib/ambari-server/resources/custom_actions/scripts/install_kerberos_package.py
chown root:root /var/lib/ambari-server/resources/custom_actions/scripts/install_kerberos_package.py 3) The next step is to add the definition for this action. Open the file system_action_definitions.xml located under "/var/lib/ambari-server/resources/custom_action_definitions/" folder using your favourite editor and add the below content alertDefinitions tag <actionDefinition>
<actionName>install_kerberos_package</actionName>
<actionType>SYSTEM</actionType>
<inputs></inputs>
<targetService/>
<targetComponent/>
<defaultTimeout>60</defaultTimeout>
<description>Install kerberos packages</description>
<targetType>ALL</targetType>
<permissions>HOST.ADD_DELETE_COMPONENTS, HOST.ADD_DELETE_HOSTS, SERVICE.ADD_DELETE_SERVICES</permissions>
</actionDefinition> Note: You can add comma separated inputs if you need any inputs for the script. 4) Now that the action is defined, restart ambari server for the changes to reflect. ambari-server restart 5) Check if your action is listed by calling the Ambari REST API. curl -u <username>:<password> "http://<ambari-host>:<ambari-port>/api/v1/actions" 6) Now you are ready to run the custom script which you have created. curl -u <username>:<password> -X POST -H 'X-Requested-By:ambari' -d'{"RequestInfo":{"context":"Execute an action", "action" : "install_kerberos_package", "service_name" : "", "component_name":"", "hosts":"<comma-separated-hosts>"}}' http://<ambari-host>:<ambari-port>/api/v1/clusters/<cluster-name>/requests You can check the output in the Ambari UI. Please check the screenshot(sample-output.png) for reference
... View more
Labels:
09-29-2017
11:51 AM
@Sen Ke, can you please accept the answer if it worked for you. This will be helpful for the community. Thanks, Aditya
... View more
09-29-2017
07:02 AM
Hi @Sen Ke, Do you have webhdfs defined in your topology file? If you are using sandbox, open /usr/hdp/current/knox-server/conf/topologies/knox_sample.xml and add <service>
<role>WEBHDFS</role>
http://sandbox.hortonworks.com:50070/webhdfs
</service> If you are not using a sandbox, go to Knox->Configs->Advanced Config->Advanced topology and add <service>
<role>WEBHDFS</role>
http://<namenode-host>:<namenode-port>/webhdfs
</service> Thanks, Aditya
... View more
09-27-2017
03:09 PM
1 Kudo
You have to run it as hdfs user Run su hdfs and run the chmod command Thanks, Aditya
... View more
09-27-2017
10:51 AM
@Mohammad Shazreen Bin Haini, ssh to the node where Ambari is installed / HDFS client is installed and you can run the command there. As @Peter Kim mentioned , check the permissions of those directories before changing. Thanks, Aditya
... View more
09-26-2017
07:14 PM
Hi @Akrem Latiwesh, Can you just try giving "/app/XTA0/hivedb" instead of hdfs:/// . It will pick the defaultFS from hadoop's core-site.xml. Thanks, Aditya
... View more
09-26-2017
06:58 PM
1 Kudo
Hi @Mohammad Shazreen Bin Haini, Your query is trying to write to /apps location to which "hive" user doesn't have permission. Change the permission of the folder and try running the query. hdfs dfs -chmod 777 /apps Thanks, Aditya
... View more