restful api 서버에서 평균 응답시간, 호출횟수, Min, Max 구하기

app에서 데이타 통신을하는 api서버가 있다 각 인터페이스별 평균 응답시간을 아파치 로그를 활용하여 구해봤다 서버는 apache+tomcat, spring으로 구현한 서버이다 hadoop과 spark, python 설정은 Python and Spark로 로그 파일 분석 (with hadoop) 을 참고 하자 1. 아파치 TransferLog 로그파일에 응답 시간 남기기 우선 분석하기 전에 아파치 로그에 응답 시간을 추가로 기록하도록 하자 /etc/httpd/conf.d/ssl.conf 경로에서 아래를 편집했다. 물론. 설정 파일이 있는 경로와 이름은 서버마다 틀릴 수 있다 1 2 3 4 5 6 <VirtualHost _default_:443> ....

June 8, 2016 · 2 min · 페이퍼

Python and Spark로 로그 파일 분석 (with hadoop)

Spark를 이용한 파일 분석 spark도 잘 모르고 hadoop도 잘 모르는 상태에서 진행해서 틀린 부분이 있을 것이다. 참고로 OSX에서 진행된 작업이다. 설정 1. Hadoop를 설치 하고 실행한다 2. hdfs상에 파일을 올린다. 1 2 cd /logs hdfs dfs -put test.log /input/ 아래와 같이 파일 브라우징이 가능하다 아래에서 올라간 파일을 확인! http://localhost:50070/explorer.html#/input 3. spark의 python 커맨드 테스트.. $SPARK_HOME/bin/pyspark 하둡을 켜고 pyspark를 실행하면 아래와 같이 나온다 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 Python 2....

May 30, 2016 · 4 min · 페이퍼

하둡 스프링 연동 테스트2 - hadoop 2.6.x with spring 4.0 (MapReduce WordCount example)

context-hadoop.xml에 아래 내용 추가. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 <hdp:configuration id="hdConf"> fs.default.name=hdfs://localhost:9000 </hdp:configuration> <hdp:job id="wordCountJob" input-path="/input/" output-path="/output/" configuration-ref="hdConf" mapper="delim.app.service.WordCount$TokenizerMapper" reducer="delim.app.service.WordCount$IntSumReducer" > </hdp:job> <hdp:job-runner id="wordCountJobRunner" job-ref="wordCountJob" run-at-startup="false"> </hdp:job-runner> WordCount.java 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 import org....

April 15, 2015 · 2 min · 페이퍼

하둡 스프링 연동 테스트 - hadoop 2.6.x with spring 4.0

Hadoop 설치 및 설정은 아래와 같이 (osx 요세미티.) https://hadoop.apache.org/releases.html#Download ( 2.6.x 버전 ) 설치는 아래 블로그 보고 함 http://iamhereweare.blogspot.kr/2014/05/hadoop.html pom.xml 에 아래 dependency 추가. 1 2 3 4 5 <dependency> <groupid>org.springframework.data</groupId> <artifactid>spring-data-hadoop</artifactId> <version>2.1.1.RELEASE</version> </dependency> context-hadoop.xml spring 설정에 파일 추가 1 2 3 4 5 6 7 8 9 10 11 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:hdp="http://www.springframework.org/schema/hadoop" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/hadoop http://www.springframework.org/schema/hadoop/spring-hadoop.xsd"> <hdp:configuration id="hdConf"> fs.default.name=hdfs://localhost:9000 </hdp:configuration> </beans> 아래와 같이 test코드 작성....

April 12, 2015 · 2 min · 페이퍼