Dive into the community: get started with the basics, connect with peers, share your feedback, and discover helpful technical articles.
Recently active
Cloudera Machine Learning (and Cloudera Data Science Workbench) is built on a very robust and flexible framework to ease integration with third parties. In this article, I decided to explore the integration of Teradata with CML via ODBC. A few notes before I dive in: I could have easily used JDBC via JayDeBeApi (see my previous article), but where is the fun in that This article could be generalized to more ODBC connections, provided proper parameters are setup To get a fully rounded tutorial, I will go through these 3 steps: Step 1 (optional if you already have a Teradata instance): Setting up Teradata Vantage in AWS Step 2: Create a custom image with Teradata driver Step 3: Configure and run python to Teradata ODBC Step 1: Setting up Teradata Vantage in AWS If you want to do development testing of Teradata, you can use Teradata Vantage Developer on the AWS Market Place. I am not going to dive too much into this as this configuration may change as Teradata evolves
Interacting with Hadoop HDFS using Python codesThis post will go through the following: Introducing python “subprocess” module Running HDFS commands with Python Examples of HDFS commands from Python1-Introducing python “subprocess” moduleThe Python “subprocess” module allows us to: spawn new Unix processes connect to their input/output/error pipes obtain their return codesTo run UNIX commands we need to create a subprocess that runs the command. The recommended approach to invoking subprocesses is to use the convenience functions for all use cases they can handle. Or we can use the underlying Popen interface can be used directly.2-Running HDFS commands with PythonWe will create a Python function called run_cmd that will effectively allow us to run any unix or linux commands or in our case hdfs dfs commands as linux pipe capturing stdout and stderr and piping the input as list of arguments of the elements of the native unix or HDFS command. It is passed as a Python list rather than a s
In this article, the requirement is to have simple tag names that will be applied to attributes in a Hive table. Here, tags such as “Hashed” and “Masked” will be used in many tables. Different groups may need access to the data in the clear, while others will not be granted access. The opposite may apply for a different table. Table name atlas_tag_test has the columns ssn that will be shown for hr_users and masked for power_users. The value will be a comma-separated list of groups, in this case, we only have a single group. Now in Ranger, we have a policy for masked. For each group we are adding a condition, we check if power_users are set in the group's attribute like the following:if ( ctx.getAttributeValue("Masked","groups").indexOf("power_users") !== -1 ){ ctx.result = false; } else { ctx.result = true; } If it is, the data will be available to the user to see in the clear. It is not, the users will not be able to see the data. We will add
Short Description: A quick tutorial on how to mask columns in Hive for regulatory purposes Abstract: This tutorial will cover how to apply tags to Atlas entities and subsequently leverage tagging policies in Ranger to mask Personally Identifiable Information (PII). Atlas serves as a common metadata store designed to exchange metadata both within and outside of the Hadoop stack. It features a simple user interface and a REST API for ease of access and integration. The Atlas-Ranger paradigm unites data classification with policy enforcement. Figures will be used as a graphical aid. Steps will be provided in between figures via bullet points. Note: This tutorial assumes the user has successfully installed Ranger, enabled Ranger audit to Solr, installed Atlas, installed Hive, configured Atlas to work with Hive, and configured Atlas to work with Ranger. It also assumes the user has dummy data for development purposes. For detailed instructions on how to accomplish these steps please
Masking of Hive columns could be achieved using Hive resource-based policies and masking policies for databases, tables, and columns. However, dynamic masking could be achieved using Atlas tags or collections (from HDP-3.x), which empowers users to regulate the visibility of sensitive data by leveraging Atlas tag-based policies in Ranger. Prerequisites of this tutorial include a healthy HDP cluster with existing tables/databases in Hive, Atlas configuration with Hive and Ranger, and Audit to Solr enabled for Ranger. Open the video on YouTube here This video is based on the original article How to Mask Columns in Hive with Atlas and Ranger. Other references:Providing Authorization with Apache Ranger
These steps have been successfully tried and tested on Ambari-2.4.2.0 and HDP-2.5.3..When you install and configure Solr cloud via Ambari or embedded solr via Ambari Infra on a kerberized cluster, SPNEGO authentication gets enabled by default. There is not direct switch to disable only SPNEGO authentication..Please follow below method to disable it..Step 1 - Login to Ambari server.Step 2 - Please take backup of below script/var/lib/ambari-server/resources/common-services/SOLR/<version>/package/scripts/setup_solr_kerberos_auth.py.Step 3 - Edit above script and do the modifications as belowOriginal value: command += '\'{"authentication":{"class": "org.apache.solr.security.KerberosPlugin"}}\'' Recommended value: command += '\'{ }\''.Step 4 - Please replace cached script with below command and restart ambari-agent followed by Solr service(via Ambari)cp /var/lib/ambari-server/resources/mpacks/solr-ambari-mpack-5.5.2.2.5/common-services/SOLR/5.5.2.2.5/package/scripts/setup_solr_kerbe
1.Prerequisites Enable HDFS location access for the HIve table Enable HDFS Policy in Ranger Restrict POSIX access in HDFS File system Grant Hive table access in Ranger 2. Enable HDFS location access for the user Login to Ranger and select HDFS Policy Make sure to mention the Hive table location (In below example “Resource Path” points to default Hive Warehouse location) Validate the HDFS location access is restricted to ensure Ranger policy is working as expected 3. Create table policy in Hive Access if not exists Select the Hive Policy Add a new policy if not exists Grant table access to required users and validate the access by querying the table 4. Enable table policy in Hive Row Level Filter Select “Row level filter” under Hive policy Select “Add New Policy” Provide the required information in the Policy Details. Enter “Where” clause condition in “Row Level Filter” Below example grants access to “Alice” user only to rows that has a condition of “state = ca” Bef
CML provides some nice high-level session, model, and experiment auditing. But sometimes a situation arises where you would like audit logs at the level of file modification and user logins. This article provides a quick walkthrough of accessing the underlying RDBMS for this information. This page gives details on the tables and information available. This guide presupposes you are using AWS. Thanks to @fletch_jeff for the help. Step 1 - Install aws-iam-authenticator Install according to your OS as per these instructions. Step 2 - Grab your User ARN From the command line: ==> aws sts get-caller-identity{ "Account": "012345678910", "UserId": "ABBBBBBBBB BXXXXXXXXXX", "Arn": "arn:aws:iam::012345678910:user/cperro"} From AWS Console Open the AWS Console. Navigate to IAM. Navigate to Users. Select your user name. Copy the ARN. Step 3 - Add your ARN to your Workspace Navigate to Machine Learning Worksp
This article explains how to setup Hive Warehouse Connector (HWC), in CDP Public Cloud CML (tested with CDP Public Cloud runtime 7.1). Step 1 - Start a Virtual Warehouse Navigate to Data Warehouses in CDP. If you haven't activated your environment, ensure you have activated it first. Once activated, provision a new Hive Virtual Warehouse: Step 2 - Find your HiveServer2 JDBC URL Once your Virtual Warehouse has been created, find it in the list of Virtual Warehouses. Click the Options icon (three vertical dots) for your Virtual Warehouse. Select the Copy JDBC URL option and note what is copied to the clipboard: Step 3 - Find your Hive Metastore URI Navigate back to your environment Overview page and select the Data Lake tab. Click on the CM-UI Service: Click on the Options icon (three vertical dots) for the Hive Metastore Service and click Configuration: Click the Actions dropdown menu and select the Download Client Configuration item: Extrac
Go here for the latest Prototype - Fraud Detection See the webinar for this Prototype here: https://www.cloudera.com/about/events/webinars/build-a-customer-churn-insights-application-with-cdp.html The complexity of creating an end-to-end machine learning workflow is one of the biggest hurdles data science and machine learning engineers are facing. It's not a running model.fit() that is hard, but it is ingesting data, getting the data in the right format for the model training process, deploying the model in a way that is accessible to other parts of the business, and running applications that consume the model that is hard. Machine Learning is useful when it's deployed with an end-to-end workflow. We have been working to create Applied Machine Learning Prototypes for CML that will help you build a fully working machine learning example in CML. The Prototypes will include source data, and walk through various steps: Ingest data into a useful place in CDP
Introduction How do we quickly gain insight and start working with data in a secure, governed, and scalable environment in the cloud? This article explains how to achieve this using the Cloudera Data Warehouse platform connected with Apache Superset. Cloudera Data Warehouse in CDP (Cloudera Data Platform) is an enterprise solution for modern analytics. It's an auto-scaling, highly concurrent, and cost-effective hybrid, a multi-cloud analytics solution that ingests data anywhere, at massive scale, from structured, unstructured, and edge sources. Apache Superset (incubating) is a modern, enterprise-ready business intelligence web application. Pre-Requisites This exercise is performed on a Mac OS. The versions below were tested at the moment of writing this article and may change in the future: Python Python 3.7.5 pip 20.0.2 After Python/pip installation, install the following packages/versions in Python
JSON Batch to Single Row PhoenixI grabbed open data on Crime from Philly's Open Data (https://www.opendataphilly.org/dataset/crime-incidents), after a free sign up you get access to JSON crime data (https://data.phila.gov/resource/sspu-uyfa.json) You can grab individual dates or ranges for thousands of records. I wanted to spool each JSON record as a separate HBase row. With the flexibility of Apache NiFi 1.0.0, I can specify run times via cron or other familiar setup. This is my master flow.First I use GetHTTP to retrieve the SSL JSON messages, I split the records up and store them as RAW JSON in HDFS as well as send some of them via Email, format them for Phoenix SQL and store them in Phoenix/HBase. All with no coding and in a simple flow. For extra output, I can send them to Reimann server for monitoring.Setting up SSL for accessing HTTPS data like Philly Crime, require a little configuration and knowing what Java JRE you are using to run NiFi. You can run service nifi s
Hey Everyone, This video will show you how to create a Cloudera AI Workspace. A Workspace in CML is where all of your data science work will take place and allow you to collaborate with your team easily. Creating a basic Workspace is quick and simple if you already have an environment set up. Also, I cover the different advanced options available to help admins and users manage costs and stay secure when creating a new Workspace. More information: Cloudera Machine Learning – What You Should Know https://community.cloudera.com/t5/Community-Articles/Cloudera-Machine-Learning-What-You-Should-Know/ta-p/292935 More information on Cloudera AI https://www.cloudera.com/products/machine-learning.html Documentation on CDP https://docs.cloudera.com/
Short Description:This sample code helps to connect to Kerberos enabled HBase cluster from Java program. Code Walkthrough:Create HBaseConfiguration and pass HBase cluster parameters. Configuration hbaseConfig = HBaseConfiguration.create();hbaseConfig.addResource("/path_to_hbase_conf/hbase-site.xml");hbaseConfig.addResource("/path_to_hbase_conf/core-site.xml");hbaseConfig.set("hadoop.security.authentication", "Kerberos"); User principal and key tab file names. Please make sure key tab files are in the respective folder. String principal = System.getProperty("kerberosPrincipal", "hbaseuser@EXAMPLE.COM");String keytab = System.getProperty("kerberosKeytab", "/path_to_keytab/hbase-client.keytab"); The essential Kerberos configuration information is the default realm and the default KDC. As with most Kerberos installations, a Kerberos configuration file krb5.conf is consulted to determine such things as the default realm and KDC. The default location i
It's very easy to integrate Apache Flume with Apache NiFi, either as a source or destination (sink).An example of using ExecuteFlumeSource and ExecuteFlumeSink in Apache NiFi. We use a Flume source to read Netcat and send to Slack. So you can send messages from Linux to a Slack chat. For the Flume sink to HDFS, we read data from a web feed. We can also connect our Flume Source to Flume Sink.Configuring a Flume SourceIf you have configured Apache Flume configuration files, this is the same thing. Data Received in Slack (Join and See Messages Live)Checking Provenance EventConfigure The ExecuteFlumeSink to Store to HDFS-rw-r--r-- 3 flume hdfs 28 2016-07-25 16:14 /flume/events/16-07-25/1610/00/events-.1469463242392To monitor what's going on in the Flume side of the process: tail -f /var/log/flume/flume-a1.log25 Jul 2016 16:14:38,854 INFO [agent-shutdown-hook] (org.apache.flume.instrumentation.MonitoredCounterGroup.stop:177) - Shutdown Metric for type: SINK, name: k1. si
To set up health_percent of LLAP, do the following: On the Hiveserver2Interactive server nodes, edit /usr/hdp/<hdp-version>/hive/scripts/llap/yarn/package.pyExample: /usr/hdp/3.1.0.224-3/hive/scripts/llap/yarn/package.pyThe --health-percent defaults to 80. Change this to desired-number. Move the following to a temporary backup location: a. /usr/hdp/<hdp-version>/hive/scripts/llap/yarn/package.pyc b. /usr/hdp/<hdp-version>/hive/scripts/llap/yarn/package.pyo Restart Hive.
Note: Cloudera does not support antivirus software of any kind. This article contains general recommendations for excluding ZooKeeper components and directories from antivirus scans and monitoring. The three primary locations you will want to exclude from antivirus are: Data directories: These can be very large, and therefore take a long time to scan; they can also be very write-heavy, and therefore suffer performance impacts or failures if the antivirus holds up writes. Log directories: These are write-heavy. Scratch directories: These are internal locations used by some services for writing temporary data, and can also cause performance impacts or failures if the antivirus holds up writes. Note: ZooKeeper has a user-configurable data directory. I recommend you exclude it. This directory can be found by running the following command: # grep dataDir /etc/zookeeper/conf/zoo.cfg Consider excluding the following directories and all of their subdirectories
Note: Cloudera does not support antivirus software of any kind. This article contains general recommendations for excluding MapReduce components and directories from antivirus scans and monitoring. The three primary locations you will want to exclude from antivirus are: Data directories: These can be very large, and therefore take a long time to scan; they can also be very write-heavy, and therefore suffer performance impacts or failures if the antivirus holds up writes. Log directories: These are write-heavy. Scratch directories: These are internal locations used by some services for writing temporary data, and can also cause performance impacts or failures if the antivirus holds up writes. Note: Some directories in MapReduce are user-configurable. I recommend you exclude them. These properties can be found in Ambari > YARN > Configs > Advanced, and this one in particular should be excluded: mapreduce.jobhistory.recovery.store.leveldb.path &nbs
Note: Cloudera does not support antivirus software of any kind. This article contains general recommendations for excluding YARN components and directories from antivirus scans and monitoring. The three primary locations you will want to exclude from antivirus are: Data directories: These can be very large, and therefore take a long time to scan; they can also be very write-heavy, and therefore suffer performance impacts or failures if the antivirus holds up writes. Log directories: These are write-heavy. Scratch directories: These are internal locations used by some services for writing temporary data, and can also cause performance impacts or failures if the antivirus holds up writes. Note: The directories YARN uses are user-configurable. I recommend you exclude them. These properties can be found in Ambari > YARN > Configs > Advanced: yarn.nodemanager.local-dirsyarn.nodemanager.log-dirsyarn.nodemanager.recovery.diryarn.timeline-servic
Note: Cloudera does not support antivirus software of any kind. This article contains general recommendations for excluding HDFS components and directories from antivirus scans and monitoring. The three primary locations you will want to exclude from antivirus are: Data directories: These can be very large, and therefore take a long time to scan; they can also be very write-heavy, and therefore suffer performance impacts or failures if the antivirus holds up writes. Log directories: These are write-heavy. Scratch directories: These are internal locations used by some services for writing temporary data, and can also cause performance impacts or failures if the antivirus holds up writes. Note: The directories in HDFS are user-configurable. I recommend you exclude these, especially the data directory for the DataNode and the meta directories for the NameNode and JournalNode. These details can be found in the “hdfs-site.xml” file: # grep -A
Note: Cloudera does not support antivirus software of any kind. This article contains general recommendations for excluding Ambari components and directories from antivirus scans and monitoring. The three primary locations you will want to exclude from antivirus are: Data directories: These can be very large, and therefore take a long time to scan; they can also be very write-heavy, and therefore suffer performance impacts or failures if the AV holds up writes. Log directories: These are write-heavy. Scratch directories: These are internal locations used by some services for writing temporary data, and can also cause performance impacts or failures if the AV holds up writes. Note: Ambari has a special requirement in the form of a user-configurable database. I recommend you exclude this database. However, the details of this database are set on installation; the database may be colocated with ambari-server, or on a remote host. Consult with your database adm
ExtractText NiFi Custom Processor Powered by Apache Tika Apache Tika is amazing, it is very easy to use it to analyze file and then to extract text with it. Apache Tika uses other powerful Apache projects like Apache PDFBox and Apache POI.Example Usage Feed in documents, I use my LinkProcessor which grabs links from a website and returns a JSON List.Split the resulting JSON list into individual JSON rows with SplitJSON.EvaluateJSONPath to extract just the URLs.InvokeHTTP to do a GET on that parsed URL.RouteOnAttribute to only process file types I am interested in like Microsoft Word.The new ExtractTextProcessor to extract the text of the document.Then we save the text as a file in some data store, perhaps HDFS.If you have a directory of files, you can just use GetFile to ingest them en masse.LinkProcessor (https://github.com/tspannhw/linkextractorprocessor)URL: http://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.5.3/index.htmlThis is an example of a URL that I want to grab all the do
In Part 1, I shared an alternative architecture for Prometheus that increases scalability and flexibility of time series metric monitoring. In part 2, I will walk through an extension of the architecture that unites metric and log data with a unified, scalable data pipeline. Part 1 Architecture Part 2 Architecture By adding log collection agents (e.g. MiNiFi) and a search cluster (e.g. Solr), the solution architecture can be extended to support log data in addition to time series metrics. This has the advantage of reducing duplicated infrastructure components for a more efficient and supportable solution. Additional NiFi processors can be added to the flow for pre-processing (e.g. filtering, routing, scoring) the incoming data (e.g. ERROR vs INFO messages). Rulesets (e.g. Drools) from expert systems can be embedded directly into the flow, while ML models can be either directly embedded or hosted as a service that NiFi calls. Further downstream, Flink can be used to apply stat
This article explains how to setup Hive Warehouse Connector (HWC), in CDP Public Cloud (tested with CDP Public Cloud Datahub runtime 7.1). Note: you must have admin privileges on your datahub cluster do this configuration. Step 1: Whitelist the path to the HWC jar In your CDP Datahub, open Cloudera Manager (CM) via the link in the management console: In CM, go to your cluster > Livy > Configuration, and search for livy-conf/livy.conf: Add the following safety valve to the configuration file:livy.file.local-dir-whitelist=/path_for_hwc/ In our example, we are using the /tmp/ folder. Restart the Livy service via CM to propagate the configuration. Step 2: Copy the HWC jar to the whitelisted location Find the hostname of the node where Livy is installed (master3 here): Connect to the node using your user/workload password, e.g.:ssh pvidal@viz-data-engineering-master3.viz-cdp.a465-9q4k.cloudera.site Find the HWC jar:[pvidal@viz-data-engineering-master3 /]$ find / -name
The EFM (Edge Flow Manager) makes it super simple to write flows for MiNiFi to execute where ever it may be located (laptops, refineries, phones, OpenShift,etc). All agents (MiNiFi) are assigned an agentClass. Once the agent is turned on, it will phone home to EFM for run-time instructions. The run-time instructions are set at the Class level. Meaning all agents within a class, run the same instruction (flow) set. There can be 0 to many Classes. In this example, I will capture Windows Security Events via MiNiFi and ship them to NiFi over Site2Site Download MiNiFi MSI and set the classname. In this example, I set the classname to test6. This property is set at install time (MSI) or by going directly into minifi.properties. Also, notice the setting nifi.c2.enable=true. This informs MiNFi that run time flow instructions will be received from EFM. Start MiNiFi. MiNiFi can be configured to send data to multi endpoint (ie Kafka, N
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.