Posts

Set up Cloudera CDH 5.13 todo

sudo /etc/resolv.conf Edit Virtual Box forwarding, add port 22

Troubleshooting Hive

https://www.cloudera.com/documentation/enterprise/5-14-x/topics/cdh_ig_hiveserver2_start_stop.html Check if Hive metastore is running sudo service hive-metastore status sudo service hive-metastore stop sudo service hive-metastore start sudo service hive-metastore restart sudo service hive-server2 stop Check if Hive Server2 is running $ sudo service hive-server2 status Start HiveServer2: $ sudo service hive-server2 start To stop HiveServer2: $ sudo service hive-server2 stop Check Hive warehouse hadoop fs -ls /user/hive/warehouse Connect using Beeline beeline -u jdbc:hive2:// !connect -u jdbc:hive2://

Login Hortonworks Sandbox with WinSCP

ssh root@sandbox-hdp.hortonworks.com -p 2222 First-time login, use hadoop as password You will be asked to change password upon first login C:\Users\<username>\.ssh

kill yum process

yum list ps -ef | grep 13023 kill -9 13023

Troubleshoot DNS on CDH

sudo nano /etc/resolv.conf nameserver 8.8.8.8 # /etc/init.d/network stop # /etc/init.d/network start sudo systemctl restart network https://www.cyberciti.biz/faq/linux-restart-network-interface/

Download zip file using Python

https://www.zerotosingularity.com/blog/downloading-datasets-introducting-pdl/ import requests import zipfile import os # download file resp = requests.get(f"{url}{file}", allow_redirects=True, stream=True) filename = f"{download_dir}{file}" zfile = open(filename, 'wb') zfile.write(resp.content) zfile.close() zipf = zipfile.ZipFile(filename, 'r') zipf.extractall(download_dir) zipf.close() os.remove(filename) YEAR=2015 for MONTH=`seq -w 1 12`; do PARAMS="UserTableName... RESPONSE=$(curl -X POST --data "$PARAMS" http://www.transtats.bts.gov/DownLoad_Table.asp?Table_ID=236&Has_Group=3&Is_ Zipped=0) echo "Received $RESPONSE" ZIPFILE=$(echo $RESPONSE | tr '\"' '\n' | grep zip) echo $ZIPFILE curl -o $YEAR$MONTH.zip $ZIPFILE done Is this useful? https://stackoverflow.com/questions/51665087/python-download-zip-file-from-restapi

Get a book from Gutenberg

wget http://www.gutenberg.org/cache/epub/11/pg11.txt