# Create clean environment
shell> rm -rf newcerts
shell> mkdir newcerts && cd newcerts
# Create CA certificate
shell> openssl genrsa 2048 > ca-key.pem
shell> openssl req -new -x509 -nodes -days 3600 \
-key ca-key.pem -out ca.pem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void createTable(String tableName, List<String> cfList) | |
throws IOException { | |
final String table = tableName; | |
final List<String> cfs = cfList; | |
try { | |
ugi.doAs(new PrivilegedExceptionAction<Void>() { | |
@Override | |
public Void run() throws Exception { | |
if (!admin.tableExists(table)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Building a parquet tools | |
git clone https://github.com/Parquet/parquet-mr.git | |
cd parquet-mr/parquet-tools/ | |
mvn clean package -Plocal | |
// know the schema of the parquet file | |
java -jar parquet-tools-1.6.0rc3-SNAPSHOT.jar schema sample.parquet | |
// Read parquet file | |
java -jar parquet-tools-1.6.0rc3-SNAPSHOT.jar cat sample.parquet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.rajkrrsingh.zk; | |
import java.io.IOException; | |
import java.util.List; | |
import java.util.concurrent.CountDownLatch; | |
import org.apache.zookeeper.CreateMode; | |
import org.apache.zookeeper.KeeperException; | |
import org.apache.zookeeper.WatchedEvent; | |
import org.apache.zookeeper.Watcher; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--get storage plugins | |
curl http://node3.mapr.com:8047/storage.json | |
--create storage plugin | |
curl --request POST --header "ContentType: application/json" --data '{"name": "dfs1", "config": { "type": "file", "enabled": false, "connection": "maprfs:///", "workspaces": null, "formats": null }}' http://node3.mapr.com:8047/storage/dfs1.json | |
{ | |
"result" : "success" | |
} | |
--get specific storage plugin | |
curl http://10.10.71.14:8047/storage/dfs1.json | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#wget http://download.redis.io/releases/redis-3.0.2.tar.gz | |
# tar xzf redis-3.0.2.tar.gz | |
# cd redis-3.0.2 | |
# make | |
Run Redis Server | |
src/redis-server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.rajkrrsingh.thrift.client; | |
import org.apache.hive.service.auth.HiveAuthFactory; | |
import org.apache.hive.service.auth.PlainSaslHelper; | |
import org.apache.hive.service.cli.thrift.*; | |
import org.apache.thrift.TException; | |
import org.apache.thrift.protocol.TBinaryProtocol; | |
import org.apache.thrift.transport.TTransport; | |
import javax.security.sasl.SaslException; |
su - hdfs
wget https://github.com/hortonworks/hive-testbench/archive/hive14.zip
unzip hive14.zip
cd hive-testbench-hive14/
vi hive-testbench-hive14/settings/load-partitioned.sql -- remove G1GC and use Parrallel GC scheme
cd hive-testbench-hive14/
yum install gcc
echo 'export JAVA_HOME=/usr/jdk64/jdk1.8.0_77' >> ~/.bashrc
echo 'PATH=$PATH:$JAVA_HOME/bin' >> ~/.bashrc
- install wget
- su - hive
cd /tmp
wget https://raw.githubusercontent.com/HortonworksUniversity/Security_Labs/master/labdata/sample_07.csv
wget https://raw.githubusercontent.com/HortonworksUniversity/Security_Labs/master/labdata/sample_08.csv
open hive cli
-- create table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import net.neoremind.sshxcute.core.SSHExec; | |
import net.neoremind.sshxcute.core.ConnBean; | |
import net.neoremind.sshxcute.task.CustomTask; | |
import net.neoremind.sshxcute.task.impl.ExecCommand; | |
public class RunSqoopCommand { | |
public static void main(String args[]) throws Exception{ | |
OlderNewer