Skip to content

Instantly share code, notes, and snippets.

View asears's full-sized avatar

Andrew Sears asears

View GitHub Profile
#!/bin/bash
showopts () {
while getopts ":pq:" optname
do
case "$optname" in
"p")
echo "Option $optname is specified"
;;
"q")
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Creating subclusters and node groups within YARN queues using node labels.

  1. Create directories in HDFS for node labels
hadoop fs -mkdir -p /yarn/node-labels
hadoop fs -chown -R yarn:yarn /yarn
hadoop fs -chmod -R 700 /yarn
hadoop fs -mkdir -p /user/yarn
hadoop fs -chown -R yarn:yarn /user/yarn
hadoop fs -chmod -R 700 /user/yarn
@asears
asears / listjobs.cmd
Created May 3, 2016 21:48
Putty - Plink - Remote execute shell script / python script to list Oozie jobs
cd /d "C:\Program Files (x86)\PuTTY"
plink root@toredge -m listjobs.sh
#!/bin/bash
# airflow needs a home, ~/airflow is the default,
# but you can lay foundation somewhere else if you prefer
# (optional)
export AIRFLOW_HOME=~/airflow
# install from pypi using pip
pip install airflow
# initialize the database
curl -u admin:admin -i -H X-Requested-By: ambari http://localhost:8080/api/v1/alert_targets
@asears
asears / startmet.sh
Created June 21, 2016 00:35
start ambari metrics
/usr/sbin/ambari-metrics-collector --config /etc/ambari-metrics-collector/conf/ start
@asears
asears / payload.json
Created June 21, 2016 00:55
Ambari bulk service payload file
[
{
"RequestSchedule":{
"batch":[
{
"requests":[
{
"order_id":1,
"type":"POST",
"uri":"/api/v1/clusters/hdp/requests",
@asears
asears / ambari_conf.sh
Created June 21, 2016 01:24
Get ambari configs
/var/lib/ambari-server/resources/scripts/configs.sh get localhost hdp mapred-site
/var/lib/ambari-server/resources/scripts/configs.sh get localhost hdp hive-site
/var/lib/ambari-server/resources/scripts/configs.sh get localhost hdp hbase-site
/var/lib/ambari-server/resources/scripts/configs.sh get localhost hdp kafka-site
/var/lib/ambari-server/resources/scripts/configs.sh get localhost hdp webhcat-env
/var/lib/ambari-server/resources/scripts/configs.sh get localhost hdp capacity-scheduler
!/bin/bash
yum -y update
yum -y upgrade centos
mkdir -p /opt/ansible
cd /opt/ansible/
wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum -y install epel-release-6-8.noarch.rpm
yum repolist
yum -y update && yum -y install ansible