Skip to content

Instantly share code, notes, and snippets.

View zoo1.yml
version: '3.1'
services:
zoo1:
image: zookeeper:latest
restart: always
hostname: zoo1
ports:
- 2181:2181
- 2888:2888
View datanode3
docker run -dit --env-file datanode_env -p 50075:50075 -p 50020:50020 -p 41430:41430 -p 50010:50010 --network generic-class-net -h datanode3 --name datanode3 uhopper/hadoop-datanode
View datanode2
docker run -dit --env-file datanode_env -p 50075:50075 -p 50020:50020 -p 41430:41430 -p 50010:50010 --network generic-class-net -h datanode2 --name datanode2 uhopper/hadoop-datanode
View datanode1
docker run -dit --env-file datanode_env -p 50075:50075 -p 50020:50020 -p 41430:41430 -p 50010:50010 --network generic-class-net -h datanode1 --name datanode1 uhopper/hadoop-datanode
View datanode_env
CLUSTER_NAME=GenericClasss
HDFS_CONF_dfs_namenode_datanode_registration_ip___hostname___check=false
CORE_CONF_fs_defaultFS=hdfs://namenode:8020
HDFS_CONF_dfs_client_use_datanode_hostname=false
network.host=_eth0_
HDFS_CONF_dfs_namenode_avoid_read_stale_datanode=true
HDFS_CONF_dfs_namenode_avoid_write_stale_datanode=true
HDFS_CONF_dfs_namenode_write_stale_datanode_ratio=1.0f
HDFS_CONF_dfs_namenode_check_stale_datanode=true
View namenode_env
CLUSTER_NAME=GenericClasss
HDFS_CONF_dfs_namenode_datanode_registration_ip___hostname___check=false
HDFS_CONF_dfs_datanode_max_transfer_threads=16000
HDFS_CONF_dfs_replication=3
HDFS_CONF_dfs_namenode_avoid_read_stale_datanode=true
HDFS_CONF_dfs_namenode_avoid_write_stale_datanode=true
HDFS_CONF_dfs_namenode_write_stale_datanode_ratio=1.0f
HDFS_CONF_dfs_namenode_check_stale_datanode=true
CORE_CONF_fs_defaultFS=hdfs://namenode:8020
View NameNode
docker run -dit --name namenode -p 50070:50070 -p 8020:8020 --env-file namenode_env --network generic-class-net -h namenode uhopper/hadoop-namenode
View Docker Swarm
docker swarm init --advertise-addr <Node1 IP>
$ docker swarm init --advertise-addr 192.168.99.100
Swarm initialized: current node (dxn1zf6l61qsb1josjja83ngz) is now a manager.
To add a worker to this swarm, run the following command:
docker swarm join \
--token SWMTKN-1-49nj1cmql0jkz5s954yi3oex3nedyz0fb0xx14ie39trti4wxv-8vxv8rssmk743ojnwacrr2e7c \
192.168.99.100:2377
View gist:7092c14d8f5b9d2c57e412f397786b7e
package com.genericclass.decorator.design.pattern;
public interface Gadget {
Gadget addGadget();
void showGadget();
}
View MainActivity.java
package com.nitinranjan.callingapp;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;