1973
Posts
1225
Kudos Received
124
Solutions
My Accepted Solutions
| Title | Views | Posted |
|---|---|---|
| 1922 | 04-03-2024 06:39 AM | |
| 3018 | 01-12-2024 08:19 AM | |
| 1652 | 12-07-2023 01:49 PM | |
| 2423 | 08-02-2023 07:30 AM | |
| 3367 | 03-29-2023 01:22 PM |
03-27-2017
03:02 PM
You can assemble in NiFi and then store to ORC. I recommend breaking your JSON down into simpler structures since you will have to query it and use it with other data. Can you make it a wide table? Duplicate data is not a big deal for Hadoop.
... View more
03-24-2017
05:57 PM
have you connected to data from SQL?
... View more
03-19-2017
04:37 PM
6 Kudos
Phone Tracking with OwnTracks and Apache NiFi 1.x OwnTracks is an Open Source project which provides an iOS and an Android app with which your smartphone records its current location. I installed the OwnTracks application for iOS and it let's you specify your own REST JSON server to receive calls. I added Apache NiFi. It can also send via MQTT direct to mosquittio on prem to NIFI or to CloudMQTT. You just need to enter your Apache NiFi address and port.
Tell NiFi to listen for HTTP on port 9179 for the phone push, allow it to use GET, POST and PUT. No coding required. Respond to the phone with HTTP Status Code 200 and use the context map to connect the HTTP flow. We pull out the attributes from the JSON Flow File. Store our Phone Data in Apache Phoenix on HBase upsert into phone (uuid,battery,longitude ,accelerator ,velocity,vac ,latitude , tvalue ,connection , tst , altitude , messagetype , tid, httpremotehost, useragent, filename, datetime)
values ('${'uuid'}','${'battery'}','${'longitude'}','${'accelerator'}','${'velocity'}',
'${'vac'}','${'latitude'}',
'${'tvalue'}','${'connection'}','${'tst'}','${'altitude'}','${'messagetype'}','${'tid'}',
'${'http.remote.host'}','${'http.headers.User-Agent'}','${'filename'}','${now()}')
Results in Zeppelin Reference http://owntracks.org/ http://owntracks.org/booklet/ http://owntracks.org/booklet/tech/json/ http://osmand.net/build_it https://diaspod.de/posts/156379 http://owntracks.org/booklet/tech/http/ http://owntracks.org/booklet/tech/json/ https://itunes.apple.com/us/app/mqttitude/id692424691?mt=8
... View more
Labels:
03-17-2017
09:47 PM
4 Kudos
IoT Working with IoT data is a many layered process, not unlike a parfait. Scratch that, an Onion. In fact, an Onion Omega2, which is a great device that I just got yesterday does IoT really easily. This is so much easier to setup that RPI or other platforms. It also has a ton of pluggable modules that stack on top of this small chip. It's pretty small powered, but it's under $10. The device is extremely well documented at their site. Needed to run real tools, I added a USB stick and used that for storage and for extra SWAP space. opkg update
opkg install kmod-usb-storage-extras e2fsprogs kmod-fs-ext4
umount /tmp/mounts/USB-A1
mkfs.ext4 /dev/sda1
mkdir /mnt/sda1
mount /dev/sda1 /mnt/sda1
mount /dev/sda1 /mnt/ ; tar -C /overlay -cvf - . | tar -C /mnt/ -xf - ; umount /mnt/
opkg update
opkg install block-mount
opkg update
opkg install swap-utils block-mount
dd if=/dev/zero of=/tmp/mounts/USB-A1/swap.page bs=1M count=256
mkswap /tmp/mounts/USB-A1/swap.page
swapon /tmp/mounts/USB-A1/swap.page
free
block detect > /etc/config/fstab
Adding GPS ls /dev/ttyACM*
cat /dev/ttyACM0
opkg update
opkg install ogps
ubus list
/etc/init.d/rpcd restart
ubus call gps info
Using the GPS Expander, this is the JSON data returned from the utility: {"age":0,"latitude":"40.2807","longitude":"-74.6418","elevation":"38.4","course":"","speed":"N"} I then added Python and Paho MQTT Python Client for sending messages to my Cloud MQTT broker. opkg install python
https://docs.onion.io/omega2-docs/installing-and-using-python.html#onion-python-modules
opkg install python-pip
pip install --upgrade setuptools
pip install paho-mqtt
crontab -e
/etc/init.d/cron restart
*/1 * * * * /opt/demo/run.sh
Once the data was sent a MQTT broker, it was easy to ingest with Apache NiFi. I ingest MQTT messages from the broker Extra Fields from the JSON File Format some parameters for SQL build my SQL string then upsert into Phoenix/HBase. This is the beautiful Web Console that comes prerunning on the tiny Onion Omega2 device. Report from the Table in Apache Zeppelin
Reference https://docs.onion.io/omega2-docs/first-time-setup.html https://docs.onion.io/omega2-docs/expansion-dock.html https://docs.onion.io/omega2-docs/connecting-to-the-omega-terminal.html#connecting-to-the-omega-terminal-ssh https://docs.onion.io/omega2-docs/gps-expansion.html https://docs.onion.io/omega2-docs/using-gps-expansion.html#using-gps-expansion https://github.com/OnionIoT/onion-gpio-sysfs/tree/master/python/examples https://github.com/OnionIoT/Onion-Sensor-Server https://lede-project.org/docs/guide-quick-start/start https://docs.onion.io/omega2-docs/boot-from-external-storage.html https://wiki.onion.io/Tutorials/Extending-RAM-with-a-swap-file https://docs.onion.io/omega2-docs/extending-omega-memory.html
... View more
Labels:
03-15-2017
11:42 PM
this also happens in executestreamcommand when calling a shell script
... View more
03-14-2017
02:12 PM
Build your MicroSD card with www.pibakery.org it lets you pre configure boot, wifi, ...
... View more
03-12-2017
04:53 PM
2 Kudos
There are two great additions you can make to your current Hive. The first is HPL/SQL that brings stored procedure programming to the Hadoop world. The second is Hive Mall which brings advanced functions and machine learning to your Hive queries. HPL/SQL HPL/SQL is included in Hive 2.0 and will be included in Hive 2.1 on HDP 2.6.
You can manually download and install it now.
It is Hybrid Procedural SQL on Hadoop. For developers coming from Oracle and SQL Server, these procedures will feel very familiar and will allow you to port a lot of your existing PL/SQL and TSQL code over to Hive. This gives you another interface to Hive and Hadoop, it will be included in future Hadoop and be tied into the very fast Hive LLAP 2.1. HPL/SQL https://community.hortonworks.com/content/idea/43847/hplsql-make-sql-on-hadoop-more-dynamic.html http://www.hplsql.org/connections http://www.hplsql.org/cli http://www.hplsql.org/download http://www.hplsql.org/start To Run A Stored Procedure cd hplsql-0.3.17
./hplsql -f proc.pl HP/SQL Stored Procedure Example create procedure fn_test1 (VarOne char(25))
BEGIN
SET plhql
execute immediate 'set hive.exec.dynamic.partition.mode=nonstrict';
execute immediate 'set hive.exec.dynamic.partition=true';
execute immediate 'SET hive.execution.engine=tez';
print VarOne;
set VarOne = Upper(VarOne);
if (VarOne not in ('STUFF', 'STUFF2'))
BEGIN
print 'Bad Data';
RETURN -1; END
print 'Good Data';
END;
print call fn_test1('STUFF');
./hplsql -f proc.pl
Call
17/03/09 20:04:03 INFO jdbc.Utils: Supplied authorities: localhost:10000
17/03/09 20:04:03 INFO jdbc.Utils: Resolved authority:
localhost:10000
Open connection: jdbc:hive2://localhost:10000 (266 ms)
Starting SQL statementSQL statement executed successfully (2 ms)
Starting SQL statementSQL statement executed successfully (2 ms)
Starting SQL statementSQL statement executed successfully (1 ms)
*STUFF*
Good Data Apache HiveMall HiveMall was developed by developers from Treasure Data, NTT and Hortonworks. https://community.hortonworks.com/articles/67983/apache-hive-with-apache-hivemall.html https://www.slideshare.net/HadoopSummit/hivemall-scalable-machine-learning-library-for-apache-hivesparkpig http://hivemall.incubator.apache.org/userguide/getting_started/permanent-functions.html http://hivemall.incubator.apache.org/userguide/getting_started/installation.html http://github.com/myui/hivemall http://hivemall.incubator.apache.org set hivevar:hivemall_jar=hdfs:///apps/hivemall/hivemall-with-dependencies.jar;
source /opt/demo/define-all-as-permanent.hive; HiveMall is a scalable machine learning library built as a collection of Hive UDFs that you can run through Hive, Spark and Pig. It brings very cool processing to your Hive queries, Zeppelin, Pig and Spark code. You will be able to combine Hive Mall machine learning with stored procedures on in-memory fast LLAP Hive. This is revolutionary. You can run this via near real-time Apache NiFi streams.
... View more
Labels:
03-10-2017
09:30 PM
seems nltk has native stuff too. That should be explicit
... View more
03-10-2017
05:59 PM
https://community.hortonworks.com/questions/64577/nifi-metrics-in-grafanaprometheus.html https://community.hortonworks.com/articles/71839/decyphering-error-messages-in-apache-nifi.html
... View more
03-09-2017
02:17 PM
It was missing colon: https://community.hortonworks.com/questions/26622/the-node-hbase-is-not-in-zookeeper-it-should-have.html#answer-26625
... View more