Code Monkey home page Code Monkey logo

mapr's Introduction

MapR practice (gradle)

$ git clone https://github.com/daggerok/mapr.git --depth=1
$ cd mapr
$ gradle clean :mr1:jar
$ java -jar mr1/build/libs/mr1-1.0.jar mr1/src/test/resources/receipts.txt mr1/build/result
$ cat mr1/build/result/part-r-00000 # check job result

now try with hadoop (download and run mapr vm sandbox). copy target jar with data on maprdemo host and connect there via ssh:

$ scp mr1/build/libs/mr1-1.0.jar user01@maprdemo:~/mr1.jar
$ scp mr1/src/test/resources/receipts.txt user01@maprdemo:~/in1
$ ssh user01@maprdemo
$ hadoop jar mr1.jar in1 out1 # job should be done much faster)
$ cat out1/part-r-00000 # check result

get more information about MapR here: https://www.mapr.com/

remote debug

  1. copy your fat jar with data on maprdemo host and connect there via ssh

  2. prepare remote debug configuration on you ide. for example, idea connects to the application started with arguments:

     -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005
    
  3. remote debug in your IDE right after you run java command with neede debug arguments on remote host:

     $ java -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -jar mr1.jar in1 out1
    

note1: you must configure needed mode in build.gradle for running tasks

  1. to run job locally (ie: java -jar $jarFile) you must build fat jar file:

     $ gradle jatFar
    
  2. to run job on mapr cluster (ie: hadoop jar $jarFile) you can use regular jar file:

     $ gradle jar
    

note2: you use windows and fatJar command fails with error:

$ java -jar mr1/build/libs/mr1-1.0.jar <some_args>
SEVERE: PriviledgedActionException as:$user cause:java.io.IOException: 
Failed to set permissions of path: \tmp\hadoop-$user\mapred\staging\$user$someNumbers\.staging to 0700

solution: run it on unix:) use sandbox

note3: to build faster use gradle as daemon:

unix:

$ touch ~/.gradle/gradle.properties && echo "org.gradle.daemon=true" >> ~/.gradle/gradle.properties

windows:

$ if not exist "%HOMEPATH%/.gradle" mkdir "%HOMEPATH%/.gradle"
$ echo org.gradle.daemon=true >> "%HOMEPATH%/.gradle/gradle.properties"

mapr's People

Contributors

architectures avatar daggerok avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.