Member since
05-30-2018
1322
Posts
715
Kudos Received
148
Solutions
My Accepted Solutions
| Title | Views | Posted |
|---|---|---|
| 10065 | 07-20-2016 07:06 PM |
11-30-2016
10:42 PM
3 Kudos
Apache NiFi 1.1.0 is now available and once again I want to test it in a isolated environment. Docker! The steps to do this are extremely similar to what has been detailed here (https://community.hortonworks.com/articles/69043/launching-a-nifi-docker-instance.html) Pull the image docker pull sunileman/nifi1.1.0 You may find the mirror site is not optimal based on your location. Go here and grab your mirror site. Update MIRROR_SITE parameter in the Dockerfile with your mirror site. The Dockerfile is available here. If you update the Dockerfile you will have to build an image. Do this by running docker build --no-cache -t sunileman/nifi1.1.0 . Whether you pulled the image or built a new one, run this to launch Apache NiFi 1.1.0 docker run -it --rm -p 8080-8081:8080-8081 sunileman/nifi1.1.0 NiFi UI should be available here http://localhost:8080/nifi/ Have fun!
... View more
Labels:
11-29-2016
07:56 PM
7 Kudos
This article describes how to launch Apache NiFi 1.0.0 on docker. To launch Apache NiFi 1.1.0 on docker go here. During my development of the Json2CSV processor here, I quickly found a need for an environment to test my processor. I don't want to build and install NiFi from my laptop since I need all my applications isolated from each other for ease of maintenance. Docker to the rescue! Similar to how I launch a PyCharm IDE from a docker image here which will rerender back to my laptop. Isolation! I like to keep it simply. Put everything in a Dockerfile and allow myself to quickly launch a NiFi Docker image. Here are the steps to get you up and running Prerequisites Download latest virtualbox from here. To run docker containers or build images a docker machine is required. Download docker machine from here. First pull the prebuilt and complied docker image (https://hub.docker.com/r/sunileman/dockernifi/) by running this command: docker pull sunileman/dockernifi Now you have the docker image simply run it docker run -it --rm -p 8080-8081:8080-8081 sunileman/dockernifi Here you are exposing ports 8080 and 8081 and mapping to your local ports 8080 and 8081 respectively. During my development of this docker image I found sometimes virtualbox will not create port-forwarding rules even though I have created them during my docker run. To simplify this process grab portforward shell script from here.
Name it portforward.sh Verify you can execute script by issuing chmod on it then run this command ./portforward.sh 8080 ./portforward.sh 8081 If you do not want to download and execute the script, simply go to virtualbox and create a port forwarding rules for the 8080 and 8081 ports Your done. Go to localhost:8080/nifi/ To shut down nifi simply hit control+c and nifi will shut down gracefully. That is too easy. Now go build some cool stuff!
... View more
Labels:
11-18-2016
04:07 PM
awesome @Binu Mathew
... View more
10-20-2016
03:30 PM
1 Kudo
HDP 2.5 GA'd phoenix query server. This makes connecting to phoenix much easier. Article will walk through steps on how to connect to phoenix Phoenix Query Server via DBVisualizer. Grab the phoenix thin jdbc driver onto your desktop. On the HDP 2.5 here is the location of the jdbc driver Start up DBVisualizer. From the top menu bar select Tools->Driver Manager Popoluate the fields: Name:Apache Phoenix Thin Client I used phoenixthin. URL Format: jdbc:phoenix:thin:url=<scheme>://<server-hostname>:<port>[...] Client on the folder icon Locate your phoenix thin jdbc driver you downloaded to your desktop. Once selected click on ok and and now you have the driver loaded. Lets connect to phoenix. Click on the icon shown below which creates a new db connection. Then select "Use Wizard". Enter a connection name. I used phoenix-QPS Now select the driver you loaded in the previous steps. I named my driver phoenixthin Next enter your userid & password. For this example I use the root user ID Now a data connection has been created. Lets connect to phoenix using that connection alias. Go to your connection alias shown on the left pane. Right click and select "Connect" You are now connected! Start having fun and open up some name spaces. Select * from tables It is clear connecting to Phoenix is much easier now thanks to the community building Phoenix Query Server. Happy Phoenix-ing
... View more
Labels:
10-14-2016
11:47 PM
8 Kudos
Phoenix secondary indexes are often misunderstood. Those coming from the relational world mistakenly apply the same prinples to apache phoenix. A simple data model will be used for this article. Airplane table with attributes carrier ID, Tail Number, Origin airport code, destination airport code, and flight date. The physical data model has been identified with primary access path of carreirID and TailNum, essentially the rowkey. note - it is important to understand the order the "primary access path" in which fields will be accessed. Here I have identified the first key in the access path is carrierID. If that is not the case, benefits from the underline database capabilities, HBase may be realized. Think of primary access path not as primary key but more as the core identified access pattern for reads & writes. Secondary indexes enrich & extend this functionality. What are Apache Phoenix secondary indexes? "Secondary indexes are an orthogonal way to access data from its primary access path." Orthogonal is key here. Think of this as an intersection. Personally I would argue this is different then RDBMS as RDBMS adheres to relational theory. HBase/Phoenix does not. So start training your mind to think of intersections when it comes to secondary indexes Use case example: For the airline table, origin airport code is starting to emerge as alternate intersection pattern. Meaning frequently the core access path + origin airport code are used for various processing and/or access. Options are either create a new phoenix table using this core access path pattern or create/apply secondary. Lets go with secondary index So what are my options?
Global Index
Single Value Local Index
Single Value Covered Index
Global Local Global Index Lets start with global. Global indexes are used for read heavy use cases. why? Global indexes are not co-located (region server) with the primary table. Therefore with global indexes are dispersing the read load by have the main and secondary index table on different region servers and serving different set of access patterns. Think of it as load balancing. Simply create a secondary index on origin airport code CREATE INDEX indexname ON airline(origin_airport_code); This new secondary index is orthogonal. Meaning an intersection of the primary row key and secondary key (s). Now the data model will support this query SELECT * FROM AIRLINE WHERE CARRIERID = 'A12' AND TAILNUM = '123' AND ORGIN_AIRPORT_CODE = 'ORD'
Perfect point lookup SELECT * FROM AIRLINE WHERE CARRIERID = 'A12' AND TAILNUM = '123' AND ORGIN_AIRPORT_CODE = 'ORD' AND DEST_AIRPORT_CODE = 'DFW'
Perfect point lookup with server filter on DFW Notice the secondary index is an INTERSECTION of the primary key. What if I ran this: SELECT * FROM AIRLINE WHERE ORGIN_AIRPORT_CODE = 'ORD'
This would run a full table scan. Why? This is not an intersection of primary row key with secondary row key. To solve this challenge you have options such as covered index or using a hint. Hints SELECT /*+ /*+ INDEX(AIRLINE indexname) */ * FROM AIRLINE WHERE ORGIN_AIRPORT_CODE = 'ORD' This will cause each data row to be retrieved when the index is traversed to find the missing column values. Use this with care as you may find performance is better with covered index. You can always force hints to the optimizer to use the index of your choice. Covered index Covered index is a way to bundle data based on alternative access path. If the index can "cover" all fields in your select statement then only the index will be hit during the query. To continue from previous example, I would create covered index as follows CREATE INDEX indexname ON airline(origin_airport_code) INCLUDE (ALL THE FIELDS YOU WILL COVER IN YOUR SELECT STATEMENT) Issuing SELECT * FROM AIRLINE WHERE ORGIN_AIRPORT_CODE = 'ORD' will only hit the index table. Local index Local indexes are used for write heavy use cases. why? Local indexes are co-located (Region server) with the primary table. "Unlike global indexes, local indexes will use an index even when all columns referenced in the query are not contained in the index. This is done by default for local indexes because we know that the table and index data co-reside on the same region server thus ensuring the lookup is local." CREATE LOCAL INDEX indexname ON airline(origin_airport_code) Running SELECT * FROM AIRLINE WHERE ORGIN_AIRPORT_CODE = 'ORD' should take advantage of the secondary index That is a ton of info. It is important to understand secondary indexes on NoSQL databases do not adhere to relational theory. There is no substitute for understanding the principles. Now go create some smart secondary indexes 🙂
... View more
Labels:
10-14-2016
02:51 PM
@ScipioTheYounger most definitely. Simply use exact same process and connect to yarn jvm. you will get all attributes (metrics) available.
... View more
10-12-2016
04:43 PM
2 Kudos
To start pulling jmx metrics from hadoop you need to first enable it via jvm parameters. Go to ambari-->Yarn-->config-->yarn-env Enable jmx by adding the following params to YARN_RESOURCEMANAGER_OPTS "-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=8001" Set the port to whatever port is available on your cluster Save the new config. This will require restart of yarn. Now you have jmx enabled but you need to client to start pulling jmx metrics. Go to your data node and and download (from here http://wiki.cyclopsgroup.org/jmxterm/download.html) the latest jxmterm-xxx-xxx-uber.jar. For this article I use jmxterm-1.0-alpha-4-uber.jar Once you have the jmxterm client downloaded lets connect to jxm using java -jar jmxterm-1.0-alpha-4-uber.jar -l service:jmx:rmi:///jndi/rmi://localhost:<YOURPORT>/jmxrmi In this example I am set port to 8012. java -jar jmxterm-1.0-alpha-4-uber.jar -l service:jmx:rmi:///jndi/rmi://localhost:8012/jmxrmi Now I am connected to jxm. Lets look at all the beans available by issuing beans commands Well now I see all the beans available to pull metrics from. Lets say I want to pull metrics about resourcemanager cluster metrics. That is bean Hadoop:name=ClusterMetrics,service=ResourceManager. Lets find all the attributes available for that beans by issuing info -b Hadoop:name=ClusterMetrics,service=ResourceManager All the attributes are shown and notice there is a notification attribute. You can use this for notification into your enterprise operational system. To pull metrics for a specific attribute within a bean use get -b bean_name attribute For this example I want to know number of active Node Managers which is attribute NumActiveNMs. get -b Hadoop:name=ClusterMetrics,service=ResourceManager NumActiveNMs So there are 4 active node managers. I want to know how many node managers are down. That is attribute NumLostNMs get -b Hadoop:name=ClusterMetrics,service=ResourceManager NumLostNMs Returns 0 meaning all my node managers are available. Hope this helps you get started on interacting with JMX.
... View more
09-29-2016
09:54 PM
@Josh Elser extremely helpful article. nice work
... View more
09-28-2016
03:09 AM
@Ali Bajwa tons of great stuff in this article
... View more