BigDATA/Hadoop(18)
-
하둡명령어로 삭제하기(fs -rm)
하둡 hdfs 삭제 하기! #!/bin/bash # 주기적으로 hdfs 데이터를 삭제한다. # crontab 에 등록하여 실행시킨다. # 2일 전 데이터 삭제 date=`date -d "2 days ago" "+%Y%m%d"` /home/acet/program/hadoop/bin/hadoop fs -rm -r -skipTrash "/HADOOP경로/하둡path/*.txt.$date*" # 하둡 temp 데이터 삭제 find /home/acet/data/ -ctime +2 -type f -exec rm -f {} \;
2016.12.06 -
hadoop distcp
$ ./hadoop distcpusage: distcp OPTIONS [source_path...] OPTIONS -append Reuse existing data in target files and append new data to them if possible -async Should distcp execution be blocking -atomic Commit all changes or none -bandwidth Specify bandwidth per map in MB -delete Delete from target, files missing in source -diff Use snapshot diff report to identify the difference between source and ..
2016.10.28 -
(info) vagrant commands
내역1. 로컬에서 하둡을 간단히 돌려서 프로그래밍을할 수 있는 환경을 만들고 싶음.2. vagrant로 단일 하둡 셋팅 함.3. 우분투 관련 오류 발생 함. 오류recommended that you fix the library with 'execstack -c ', or link it with '-z noexecstack'. http://www.michael-noll.com/tutorials/running-hadoop-on-ubuntu-linux-single-node-cluster/ vagrant 명령어Usage: vagrant [options] [] -v, --version Print the version and exit. -h, --help Print this help. Common commands:..
2015.02.04 -
[꿀팁] 하둡 inputPath로 다중 File 작업하기
[그림 - 1 : 안구정화용~~] // 참고 소스~~ // 아래처럼 path 들을 list에 넣어준다.List inputPath = new ArrayList(); inputPath.add(otherArgs[0]+"/01_acet.clicklog_mo"); inputPath.add(otherArgs[0]+"/02_acet.clicklog_mo"); // 입출력 데이터 경로 설정 //FileInputFormat.addInputPath(job, new Path(otherArgs[0]));for(String input : inputPath){ // list에 담겨져있는 path들을 하나씩 넣어준다. FileInputFormat.addInputPath(job, new Path(input)); } 나의 의문은 현재..
2015.02.04 -
[Hadoop] 하둡 맵-리듀스 따라잡기
맵-리듀스! 이녀석을 알아가기 위해 정리를 하나씩 해보려고 한다. 가장 쉬우면서도 어려운 맵-리듀스 소스 짜보기! 1. Maven 설정 org.apache.hadoop hadoop-core 1.2.1 junit junit 4.11 2. runner : runner는 우선 map, reduce, data format등 그리고 run을 통해 시작 시킬수 있는 친구라고 생각하고 넘어가자. 아래의 소스는 가장 단순한 형태 이다. 보통 책에 나오거나 튜토리얼에 나오는 소스 형태! 중요한 것은 runner보다 map과reduce!public class MoClickDistributionChartRunner extends Configured implements Tool { public MoClickDistributi..
2015.02.02 -
하둡 configuration으로 객체 넘기기!
음....하둡 MR작업 중...configuration에서 객체를 넘겨주고 싶어서 아래와 같이 인터페이스(QueryCodeList)와 구현체(QueryCodeListImpl)을 만든 뒤setClass를 해주었다..conf.setClass("queryCodeList", QueryCodeListImpl.class, QueryCodeList.class);아래처럼 setClass시에 잘 생성 된 것을 알수가 있다. 그런 뒤 getClass를 통해 해당 객체를 가져오려고 하는데...잘안된다 ㅋㅋㅋㅋㅋ 널포인트 예외..ㄷㄷㄷ new 연산자를 통해 생성한 뒤에는 getClass로 가져올 수가 있었지만 아무 의미 없다~ 내가 하고자하는 것은 객체에 이미 데이터가 들어가 있는 상태이기 때문이다.어떻게 해서 객체를 전달할..
2015.01.12