분산 검색 엔진 관련 오픈 소스들
Distributed Search Engine
1. Katta
- Lucene-Based, and support for distributed, scalable, fault-tolerant, real-time search.
- http://katta.sourceforge.net
2. ElasticSearch
- Lucene-Based, distributed, cloud, providing rest interface search solution.
- http://www.elasticsearch.com
3. LinkedIn five open-source program
- Zoie - Realtime indexing/search system.
- Bobo - Faceted Search Engine.
- Sensei - distributed realtime searchable database with dynamic clustering. Leverages Zoie and Bobo.
- Decomposer - machine learning algorithms.
- Krati - simple persistent data store.
- http://sna-projects.com/
4. Lucandra
- Lucene-Based, an index exists Cassandra database.
- https://github.com/tjake/Lucandra
5. Hbasene
- Lucene-Based, an index exists HBase database.
- https://github.com/akkumar/hbasene
- Lucene-Based, and support for distributed, scalable, fault-tolerant, real-time search.
- http://katta.sourceforge.net
2. ElasticSearch
- Lucene-Based, distributed, cloud, providing rest interface search solution.
- http://www.elasticsearch.com
3. LinkedIn five open-source program
- Zoie - Realtime indexing/search system.
- Bobo - Faceted Search Engine.
- Sensei - distributed realtime searchable database with dynamic clustering. Leverages Zoie and Bobo.
- Decomposer - machine learning algorithms.
- Krati - simple persistent data store.
- http://sna-projects.com/
4. Lucandra
- Lucene-Based, an index exists Cassandra database.
- https://github.com/tjake/Lucandra
5. Hbasene
- Lucene-Based, an index exists HBase database.
- https://github.com/akkumar/hbasene
Mime Type 정보 추출하기
Mime Type Detection
파일의 Mime Type 추출해 주는 오픈소스에 대해서 살펴봅니다. 파일 업로드와 다운로드, 스트리밍이 있는 비즈니스에서 유용할 듯합니다.
1. jmimemagic
- 방식 : 파일 확장자와 헤더를 읽어서 확인.
- URL : https://github.com/arimus/jmimemagic
- 특징 : 성능 좋으나, 정확성이 좀 떨어짐.
2. Apache Tika
- 방식 : File MetaData와 파일 내용을 파싱해서 확인.
- URL : http://lucene.apache.org/tika/
- 특징 : Office 2007등 지원, 업데이트 활발, 정확성 높으나, 성능 이슈가 존재함(많이 향상됨).
3. mime-util
- 방식 : 파일 확장자와 헤더를 읽어서 확인.
- URL : http://sourceforge.net/projects/mime-util/
- 특징 : 성능 좋으나, 정확성이 좀 떨어짐.
4. 샘플
5. 테스트 결과
1. jmimemagic
- 방식 : 파일 확장자와 헤더를 읽어서 확인.
- URL : https://github.com/arimus/jmimemagic
- 특징 : 성능 좋으나, 정확성이 좀 떨어짐.
2. Apache Tika
- 방식 : File MetaData와 파일 내용을 파싱해서 확인.
- URL : http://lucene.apache.org/tika/
- 특징 : Office 2007등 지원, 업데이트 활발, 정확성 높으나, 성능 이슈가 존재함(많이 향상됨).
3. mime-util
- 방식 : 파일 확장자와 헤더를 읽어서 확인.
- URL : http://sourceforge.net/projects/mime-util/
- 특징 : 성능 좋으나, 정확성이 좀 떨어짐.
4. 샘플
public static void main(String[] args)
{
FileInputStream fis = null;
File f = null;
String mimeType = null;
try {
f = new File("C:\\Project\\workspace\\Documents\\t3\\Maven.ppt");
// jmimemagic getMagicMatch accepts Files or byte[], extension Hint,
MagicMatch match = Magic.getMagicMatch(f, false, false);
if (match != null) {
mimeType = match.getMimeType();
System.out.println("Mime: " + mimeType) ;
} else {
System.out.print("failed");
}
//
Tika tika = new Tika();
mimeType = tika.detect(f);
if (mimeType.equals("application/x-tika-ooxml")) {
fis = new FileInputStream(f);
ContentHandler contenthandler = new BodyContentHandler();
Metadata metadata = new Metadata();
metadata.set(Metadata.RESOURCE_NAME_KEY, f.getName());
Parser parser = new OOXMLParser();
fis = new FileInputStream(f);
parser.parse(fis, contenthandler, metadata, new ParseContext());
mimeType = metadata.get(Metadata.CONTENT_TYPE);
}
System.out.println("Mime: " + mimeType);
//mime-util
MimeUtil.registerMimeDetector("eu.medsea.mimeutil.
detector.MagicMimeMimeDetector");
Collection> mimeTypes = MimeUtil.getMimeTypes(f);
System.out.println("Mime: " + mimeTypes);
} catch (Exception e) {
e.printStackTrace();
} finally {
try { if (fis != null) fis.close(); } catch (IOException e) {}
}
}
5. 테스트 결과
Mime: application/zip Mime: application/vnd.openxmlformats-officedocument. presentationml.presentation Mime: application/mspowerpoint,application/powerpoint, application/vndms-powerpoint,application/x-mspowerpoint
고참(리더)이란?
기교 부리고, 정치적으로 행동하고, 현란한 수사나 주워 담고, 실수에도 예우를 받고, 술 먹고 타협하고, 내 나와바리만 지키고, 능력을 뽐내는 것이 아니라..
아랫 사람들이 능력을 발휘할 수 있는 환경을 제공하고, 서로 유기적인 협업에 동기를 부여하여 팀웤의 능력치를 올리며, 자신의 지식 깊이와 경험의 넓이를 활용하여 문제 해결 능력을 가지며, 항상 긴장하고, 늘 새로운 시각으로 배우는 자세를 가져, 아랫 사람들에게 귀감이 되는 것이다.
이히히. 어려우니 난 군대 고참이나 되어야겟다. 맛나는 거 사주고 놀아주는..
아랫 사람들이 능력을 발휘할 수 있는 환경을 제공하고, 서로 유기적인 협업에 동기를 부여하여 팀웤의 능력치를 올리며, 자신의 지식 깊이와 경험의 넓이를 활용하여 문제 해결 능력을 가지며, 항상 긴장하고, 늘 새로운 시각으로 배우는 자세를 가져, 아랫 사람들에게 귀감이 되는 것이다.
이히히. 어려우니 난 군대 고참이나 되어야겟다. 맛나는 거 사주고 놀아주는..
Selenium을 이용한 웹 페이지 캡처
Screenshot and Website Capture with Selenium
웹 화면 캡쳐하는 오픈 소스인 Selenium에 대한 샘플 테스트한 내용을 공유합니다. 화면 캡쳐용 목적으로 살펴보았어요.
1. Chrome Driver Download
- Chrome 브라우저로 사용하고자 ChromeDriver를 설치해야 합니다.
- Chrome Driver 다운로드
2. Samples
3. 테스트 이미지
[참조 사이트]
1. Chrome Driver Download
- Chrome 브라우저로 사용하고자 ChromeDriver를 설치해야 합니다.
- Chrome Driver 다운로드
2. Samples
public class SeleniumScreenshot {
public static void main(String[] args) {
String url = System.getProperty("site", "http://www.google.com");
String path = System.getProperty("path", "C:\\logs\\");
String os = System.getProperty("os", "linux");
String browser = System.getProperty("browser", "chrome");
System.setProperty("webdriver.chrome.driver",
"C:\\Project\\tools\\driver\\chromedriver.exe");
String filename = "screenshot_" + os + "_" + browser + ".png";
WebDriver driver = new ChromeDriver();
// Google 사이트 방문
driver.get(url);
//페이지 제목
System.out.println("Page title is: " + driver.getTitle());
System.out.println("Filename: " + path + filename);
// 스냅샷 생성
File scrFile =
((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
try {
FileUtils.copyFile(scrFile, new File(path + filename));
} catch (IOException e) {
e.printStackTrace();
}
driver.quit();
}
}
3. 테스트 이미지
[참조 사이트]
입이 열개라도 할 말이 없다.
먼저 시작했다고 자랑은 하지만, 진화시키지 못한건 생각 못하는 관료.
자양분을 주지 않고 기존에 있는 기득권 나무에서 나오는 열매만 계속 따먹었더니 황무지가 되어 허허 벌판에서 고립을 자초했고, 신기술을 검증하지 않고 기존 솔루션, 레퍼런스, 규모를 더 따지는 기업.
관리를 통해 열정을 노동으로 퇴화시키는 리더, 그들이 있는 기업 문화.
최고의 기반과 최적의 기술력이 있다고 떠벌리는 나라.
빈수레가 요란할 수밖에.
기초 지식이 없고, 생각만 많고, 부정적이면서, 기교만 부리는 머리에
실행력도 없는 어디에도 도움되지 않는 내 몸뚱아리.
이게 나이기에 할 말이 없다.
자양분을 주지 않고 기존에 있는 기득권 나무에서 나오는 열매만 계속 따먹었더니 황무지가 되어 허허 벌판에서 고립을 자초했고, 신기술을 검증하지 않고 기존 솔루션, 레퍼런스, 규모를 더 따지는 기업.
관리를 통해 열정을 노동으로 퇴화시키는 리더, 그들이 있는 기업 문화.
최고의 기반과 최적의 기술력이 있다고 떠벌리는 나라.
빈수레가 요란할 수밖에.
기초 지식이 없고, 생각만 많고, 부정적이면서, 기교만 부리는 머리에
실행력도 없는 어디에도 도움되지 않는 내 몸뚱아리.
이게 나이기에 할 말이 없다.
High school jam - 지루함을 떨친 교실 이데아를 꿈꾸는 이들
- 동기와 호기심을 주지 못하는 내신.
- 정답 맞히기만 강요하는 수능.
- 토론이 성립되지 않는 논술.
Azkaban - Hadoop Workflow Management System(Opensource by LinkedIn)
설치 간단하고, 심플하게 스케쥴링, 로깅, 알림, 의존성 관리가 가능한, 심플하지만 WorkFlow 개념의 Azkaban에 대해 설치하고 사용하는 방법을 알아봅니다.
1. 설치
- 구동은 Azkaban은 jetty가 내장되어 있어 standalone방식으로 자체 구동도 가능하고, 기존 Tomcat이 있다면 Tomcat에 플러그인해서도 구동이 가능하다. 아래는 Tomcat에 플러그인 된 방식의 설치 방법을 설명한다.
2. 설치 화면 URL
- http://your_domain_name:port/azkaban/
- 설치 화면
3. Job 실행
Job 등록은 Create Job 버튼과 Upload Job 버튼 두가지 중에 하나를 선택해서 등록이 가능하고 각각의 방법은 아래에 기술한다.
- Job 등록(Create Job)
. 직접 웹 인터페이스에 key=value 형태로 입력해서 등록하는 방식
- Upload job
. job 파일과 실행파일을 직업 압축해서 업로드 형태로 등록하는 방식
. word_count.job, , mapper.py, reducer.py 파일을 압축해서 등록
- job 관련 파일 정보
. word_count.job
. mapper.py
. reducer.py
- 실행 결과
4. Workflow Management Systems
- 종류
- 비교
5. Troubleshooting
- HDFS 버튼 클릭스 오류
. java.lang.ClassNotFoundException: org.apache.commons.configuration.Configuration
. 해결책 : cp commons-configuration-1.7.jar {tomcat_home}/webapps/azkaban/WEB-INF/lib
[참조 사이트]
1. 설치
- 구동은 Azkaban은 jetty가 내장되어 있어 standalone방식으로 자체 구동도 가능하고, 기존 Tomcat이 있다면 Tomcat에 플러그인해서도 구동이 가능하다. 아래는 Tomcat에 플러그인 된 방식의 설치 방법을 설명한다.
> wget --no-check-certificate https://github.com/downloads/azkaban/azkaban/azkaban-0.10.tar.gz > tar xvfz azkaban-0.10.tar.gz > cd azkaban-0.10/ > cd dist/war > cp azkaban.war ~/server/apache-tomcat-6.0.XX/webapps > vi ~/.bashrc AZKABAN_HOME=/database/server/azkaban-0.10;export AZKABAN_HOME 추가 > source ~/.bashrc > cp hadoop-core-0.20.205.0.jar /home/k2/server/apache-tomcat-6.0.13/ webapps/azkaban/WEB-INF/lib > shudown.sh -force;./startup.sh(Tomcat 재구동)
2. 설치 화면 URL
- http://your_domain_name:port/azkaban/
- 설치 화면
3. Job 실행
Job 등록은 Create Job 버튼과 Upload Job 버튼 두가지 중에 하나를 선택해서 등록이 가능하고 각각의 방법은 아래에 기술한다.
- Job 등록(Create Job)
. 직접 웹 인터페이스에 key=value 형태로 입력해서 등록하는 방식
- Upload job
. job 파일과 실행파일을 직업 압축해서 업로드 형태로 등록하는 방식
. word_count.job, , mapper.py, reducer.py 파일을 압축해서 등록
- job 관련 파일 정보
. word_count.job
type=command command=$HADOOP_HOME/bin/hadoop jar $HADOOP_HOME/contrib/streaming/ hadoop-streaming-0.20.204.0.jar -file mapper.py -mapper mapper.py -file reducer.py -reducer reducer.py -input wordcount_input/* -output wordcount-output-2011-12-30 failure.email=pepsi@paran.com
. mapper.py
#!/usr/bin/env python
import sys
# input comes from STDIN (standard input)
for line in sys.stdin:
# remove leading and trailing whitespace
line = line.strip()
# split the line into words
words = line.split()
# increase counters
for word in words:
# write the results to STDOUT (standard output);
# what we output here will be the input for the
# Reduce step, i.e. the input for reducer.py
#
# tab-delimited; the trivial word count is 1
print '%s\t%s' % (word, 1)
. reducer.py
#!/usr/bin/env python
from operator import itemgetter
import sys
current_word = None
current_count = 0
word = None
# input comes from STDIN
for line in sys.stdin:
# remove leading and trailing whitespace
line = line.strip()
# parse the input we got from mapper.py
word, count = line.split('\t', 1)
# convert count (currently a string) to int
try:
count = int(count)
except ValueError:
# count was not a number, so silently
# ignore/discard this line
continue
# this IF-switch only works because Hadoop sorts map output
# by key (here: word) before it is passed to the reducer
if current_word == word:
current_count += count
else:
if current_word:
# write result to STDOUT
print '%s\t%s' % (current_word, current_count)
current_count = count
current_word = word
# do not forget to output the last word if needed!
if current_word == word:
print '%s\t%s' % (current_word, current_count)
- 실행 결과
4. Workflow Management Systems
- 종류
- Oozie: http://yahoo.github.com/oozie/ - Azkaban: http://sna-projects.com/azkaban/ - Cascading: http://www.cascading.org/ - HMake: http://code.google.com/p/hamake/
- 비교
| Feature | Hamake | Oozie | Azkaban | Cascading |
| workflow discription language | XML | XML (xPDL based) | text file with key/value pairs | Java API |
| dependencies mechanism | data-driven | explicit | explicit | explicit |
| requires Servlet/JSP container | No | Yes | Yes | No |
| allows to track a workflow progress | console/log messages | web page | web page | Java API |
| ability to schedule a Hadoop job execution at given time | no | yes | yes | yes |
| execution model | command line utility | daemon | daemon | API |
| allows to run Pig Latin scripts | yes | yes | yes | yes |
| event notification | no | no | no | yes |
| requires installation | no | yes | yes | no |
| supported Hadoop version | 0.18+ | 0.20+ | currently unknown | 0.18+ |
| retries | no | at workflow node level | yes | yes |
| ability to run arbitrary commands | yes | yes | yes | yes |
| can be run on Amazon EMR | yes | no | currently unknown | yes |
5. Troubleshooting
- HDFS 버튼 클릭스 오류
. java.lang.ClassNotFoundException: org.apache.commons.configuration.Configuration
. 해결책 : cp commons-configuration-1.7.jar {tomcat_home}/webapps/azkaban/WEB-INF/lib
[참조 사이트]







