Member since
11-07-2016
637
Posts
253
Kudos Received
144
Solutions
My Accepted Solutions
Title | Views | Posted |
---|---|---|
2287 | 12-06-2018 12:25 PM | |
2341 | 11-27-2018 06:00 PM | |
1814 | 11-22-2018 03:42 PM | |
2881 | 11-20-2018 02:00 PM | |
5230 | 11-19-2018 03:24 PM |
03-17-2018
04:42 PM
2 Kudos
@Santanu Ghosh, You have to use PARALLEL with any operator that starts a reduce phase like GROUP, JOIN, CROSS, DISTINCT etc. I have mentioned usage of PARALLEL with an example data set 1) Put the data.csv into hdfs [qa@vnode-68 root]$ hdfs dfs -put data.csv /user/qa/ . 2) Check the content of the data file [qa@vnode-68 root]$ hdfs dfs -cat /user/qa/data.csv
abhi,34,brown,5
john,35,green,6
amy,30,brown,6
Steve,38,blue,6
Brett,35,brown,6
Andy,34,brown,6
. 3) Run the pig script which will group users by color and dump the output into hdfs [qa@vnode-68 root]$ pig
grunt> data = LOAD '/user/qa/data.csv' using PigStorage(',') as (name:chararray,age:int, color:chararray,height:int);
grunt> b = group data by color parallel 3;
grunt> store b into '/user/qa/new' using PigStorage(',');
grunt> quit . 4) Check the output folder to make sure that 3 files are created [qa@vnode-68 root]$ hdfs dfs -ls /user/qa/new
Found 4 items
-rw-r--r-- 3 qa hdfs 0 2018-03-17 16:28 /user/qa/new/_SUCCESS
-rw-r--r-- 3 qa hdfs 0 2018-03-17 16:28 /user/qa/new/part-r-00000
-rw-r--r-- 3 qa hdfs 80 2018-03-17 16:28 /user/qa/new/part-r-00001
-rw-r--r-- 3 qa hdfs 51 2018-03-17 16:28 /user/qa/new/part-r-00002 Additional reference : https://pig.apache.org/docs/r0.15.0/perf.html#parallel If this helps you, please click on the Accept button to accept the answer. This will be really useful for other community users. . -Aditya
... View more
03-14-2018
06:09 AM
1 Kudo
@Abhijnan Kundu, Can you please modify the script as below and try running I have changed PigStorage() to PigStorage(',') and used my_data.brown_eyes instead of brown_eyes my_data = LOAD 'customers.txt' using PigStorage(',') as (name:chararray, age:int, eye_color:chararray, height:int);
my_data = FOREACH my_data GENERATE name, age, height, (eye_color == 'brown' ? 1 : 0) AS brown_eyes, (eye_color == 'blue' ? 1 : 0) AS blue_eyes, (eye_color == 'green' ? 1 : 0 ) AS green_eyes;
by_age = group my_data by age;
final_data = FOREACH by_age GENERATE group as age, COUNT(my_data) as num_people, AVG(my_data.height) as avg_height, SUM(my_data.brown_eyes) as num_brown_eyes, SUM(my_data.blue_eyes) as num_blue_eyes, SUM(my_data.green_eyes) as num_green_eyes; If this worked for you, please click on the Accept button to accept the answer. This will be helpful for other community users. . -Aditya
... View more
03-13-2018
05:38 PM
@sk kumar, Did u try running the steps @bmasna has mentioned. That should work
... View more
03-13-2018
08:51 AM
1 Kudo
Issue: Knox Gateway fails to start with "org.apache.hadoop.gateway.services.security.KeystoreServiceException: java.io.IOException: Keystore was tampered with, or password was incorrect" Below are the startup logs. 2018-03-13 05:17:47,189 INFO hadoop.gateway (GatewayServer.java:logSysProp(193)) - System Property: user.name=knox
2018-03-13 05:17:47,193 INFO hadoop.gateway (GatewayServer.java:logSysProp(193)) - System Property: user.dir=/var/lib/knox
2018-03-13 05:25:26,853 INFO hadoop.gateway (GatewayServer.java:logSysProp(193)) - System Property: java.runtime.name=OpenJDK Runtime Environment
2018-03-13 05:25:26,853 INFO hadoop.gateway (GatewayServer.java:logSysProp(193)) - System Property: java.runtime.version=1.8.0_131-b11
2018-03-13 05:25:26,854 INFO hadoop.gateway (GatewayServer.java:logSysProp(193)) - System Property: java.home=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.131-2.b11.el7_3.x86_64/jre
2018-03-13 05:25:27,230 INFO hadoop.gateway (GatewayConfigImpl.java:loadConfigResource(322)) - Loading configuration resource jar:file:/usr/hdp/2.5.5.0-157/knox/bin/../lib/gateway-server-0.9.0.2.5.5.0-157.jar!/conf/gateway-default.xml
2018-03-13 05:25:27,244 INFO hadoop.gateway (GatewayConfigImpl.java:loadConfigFile(310)) - Loading configuration file /usr/hdp/2.5.5.0-157/knox/bin/../conf/gateway-site.xml
2018-03-13 05:25:27,302 INFO hadoop.gateway (GatewayConfigImpl.java:initGatewayHomeDir(254)) - Using /usr/hdp/2.5.5.0-157/knox/bin/.. as GATEWAY_HOME via system property.
2018-03-13 05:25:28,000 ERROR hadoop.gateway (BaseKeystoreService.java:getKeystore(161)) - Failed to load keystore [filename=__gateway-credentials.jceks, type=JCEKS]: java.io.IOException: Keystore was tampered with, or password was incorrect
2018-03-13 05:25:28,000 ERROR hadoop.gateway (DefaultAliasService.java:getPasswordFromAliasForCluster(100)) - Failed to get credential for cluster __gateway: org.apache.hadoop.gateway.services.security.KeystoreServiceException: java.io.IOException: Keystore was tampered with, or password was incorrect
2018-03-13 05:25:28,001 FATAL hadoop.gateway (GatewayServer.java:main(151)) - Failed to start gateway: org.apache.hadoop.gateway.services.ServiceLifecycleException: Provisioned signing key passphrase cannot be acquired. . Root cause: Keystore file was corrupted. . Resolution: Move the corrupted files to a temp directory and restart Knox. Knox will create the files again and restart will be successful. ssh knoxhost
mkdir /tmp/keystores
mv /usr/hdp/current/knox-server/data/security/keystores/* /tmp/keystores Hope this helps 🙂
... View more
Labels:
03-08-2018
10:54 AM
1 Kudo
@Jalender, You can use this command to print all the hosts on which HIVE_CLIENT is installed curl -k -u {ambari-username}:{ambari-password} -H "X-Requested-By:ambari" http://{ambari-host}:{ambari-port}/api/v1/clusters/{cluster-name}/services/HIVE/components/HIVE_CLIENT | grep host_name | awk '{ print $3 }' Replace all the placeholders before running. If this worked for you, please click on the Accept button to accept the answer. This will be really helpful for other community users Thanks, Aditya
... View more
03-05-2018
05:22 PM
1 Kudo
@Michael Bronson, url should be "http://master02.sys56.com:8080/api/v1/clusters/hdp/requests" not "http://master02.sys56.com:8080/api/v1/clusters/hdp/request". 's' is missing in requests. Thanks, Aditya
... View more
03-05-2018
04:44 PM
@Michael Bronson, You can use this curl call to do zookeeper service check curl -u {ambari-username}:{ambari-password} -H "X-Requested-By: ambari" -X POST -d '{"RequestInfo":{"context":"ZooKeeper Service Check","command":"ZOOKEEPER_QUORUM_SERVICE_CHECK"},"Requests/resource_filters":[{"service_name":"ZOOKEEPER"}]}' http://{ambari-host}:{ambari-port}/api/v1/clusters/{clustername}/requests Replace all the placeholders before running the curl call. Thanks, Aditya
... View more
02-26-2018
10:32 AM
1 Kudo
@Michael Bronson, From HDP 2.6.4, HDP-UTILS will not include GPL licensed packages. While doing ambari server setup, if you have selected 'yes' while Reviewing the GPL license agreement, then you will have HDP-2.6-GPL repo will have lzo packages which are GPL licensed. Thanks, Aditya
... View more
02-21-2018
09:01 AM
3 Kudos
Issue: When running hive shell in a docker you will be getting a message "mbind: Operation not permitted" printed on the console but the operations will pass. . Root Cause: mbind syscall is used for NUMA (non-uniform memory access) operations which is blocked by docker by default. But in hive opts there is an option which specifies '+UseNUMA'. . Resolution: Go to Ambari -> Hive -> Configs -> Advanced 1) Remove '-XX:+UseNUMA' from 'hive.tez.java.opts'. 2) Remove '-XX:+UseNUMA' from hive-env template. Hope this helps 🙂
... View more
Labels:
02-06-2018
03:50 PM
3 Kudos
@Michael Bronson, You can use the below API curl -u {ambari-username}:{ambari-password} -H "X-Requested-By: ambari" -X PUT -d '{"RequestInfo":{"context":"_PARSE_.START.ALL_SERVICES","operation_level":{"level":"CLUSTER","cluster_name":"hdp"}},"Body":{"ServiceInfo":{"state":"STARTED"}}}' http://{ambari-host}:{ambari-port}/api/v1/clusters/{cluster-name}/services Replace ambari-username, ambari-password, ambari-host, ambari-port, cluster-name with respective values Note: Cluster Name should be replaced in 2 places. One in the url {cluster-name} and the other one in the json which I put as hdp Thanks, Aditya
... View more