본문 바로가기

엔지니어/Linux

Pinpoint 서버 & Agent 설치

728x90
반응형


---jdk get----
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u92-b14/jdk-8u92-linux-x64.rpm
----------------

준비
apache-tomcat-8.0.36.tar.gz
    hbase-1.0.3-bin.tar.gz
    jdk-8u92-linux-x64.rpm
    pinpoint-agent-1.5.2.tar.gz
    pinpoint-collector-1.5.2.war
    pinpoint-web-1.5.2.war
    pp-collector
    pp-web
    zookeeper-3.4.6-10.el6.x86_64.rpm

여기서 셋팅은 hbase를 외부로 빼서 연동하는 구조이다.

192.168.56.11    CentOS6(jdk1.8.0)    Pinpoint-collector, Pinpoint-web, zookeeper
192.168.56.12    CentOS6(jdk1.8.0)    Hbase
192.168.56.13    CentOS6(jdk1.8.0)    Pinpoint-agent

cd /usr/local/src

jdk-6u45-linux-x64.bin 
jdk-7u80-linux-x64.tar.gz 
jdk-8u101-linux-x64.tar.gz

chmod 755 jdk-6u45-linux-x64.bin
./jdk-6u45-linux-x64.bin
tar xvf jdk-7u80-linux-x64.tar.gz
tar xvf jdk-8u101-linux-x64.tar.gz
mv jdk1.6.0_45 /usr/local/
mv jdk1.7.0_80 /usr/local/
mv jdk1.8.0_101 /usr/local/

vi ~/.bash_profile

========================
....

export JAVA_HOME=/usr/local/jdk1.7.0_80
export JAVA_6_HOME=/usr/local/jdk1.6.0_45
export JAVA_7_HOME=/usr/local/jdk1.7.0_80
export JAVA_8_HOME=/usr/local/jdk1.8.0_101

PATH=$PATH:$HOME/bin:$JAVA_HOME/bin

export PATH
========================

vi /etc/profile

========================
....

export JAVA_HOME=/usr/local/jdk1.7.0_80
export JAVA_6_HOME=/usr/local/jdk1.6.0_45
export JAVA_7_HOME=/usr/local/jdk1.7.0_80
export JAVA_8_HOME=/usr/local/jdk1.8.0_101

PATH=$PATH:$HOME/bin:$JAVA_HOME/bin

export PATH
========================

source ~/.bash_profile
source /etc/profile

mkdir /data/hbase
 
   $ tar xf /usr/local/src/hbase-1.0.3-bin.tar.gz /usr/local/
   $ cd /usr/local/hbase-1.0.3/conf
   $ vim hbase-env.sh
   export JAVA_HOME=/usr/local/jdk1.8.0_101    # JAVA_HOME java7 or java8 디렉토리 설정
   $ vim hbase-site.xml 
    <configuration>
      <property>
        <name>hbase.rootdir</name>
        <value>file:///data/hbase</value>        # HBASE의 root dir 설정
     </property>
    </configuration>

    $ ../bin/start-hbase.sh        // HBASE 실행

$ jps
    8114 Jps
    7820 HMaster

$ wget -c https://raw.githubusercontent.com/naver/pinpoint/master/hbase/scripts/hbase-create.hbase -P /usr/local/src/
    $ cd /usr/local/hbase-1.0.3
    $ ./bin/hbase shell /usr/local/src/hbase-create.hbase      #  hbase 로 스키마 생성
    $ ./bin/hbase shell
    2016-07-14 20:57:10,606 WARN  [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

    ...
$ rpm -ivh /usr/local/src/zookeeper-3.4.6-10.el6.x86_64.rpm
    $ /etc/init.d/zookeeper start     # zookeeper 실행 (포트 2181)
    $ tar xf /usr/local/src/apache-tomcat-8.0.35.tar.gz -C /usr/local/;cd /usr/local/
    $ mv apache-tomcat-8.0.35/ pinpoint-collector
    $ vim /data/service/pinpoint-collector/conf/server.xml       # pp-collector 와 pp-web 의 tomcat server.xml 설정
    <Server port="8005" shutdown="SHUTDOWN">     
    <Connector port="8085" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
    <!-- <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /> -->     #  포트는 다르게

    $ rm -rf /usr/local/pinpoint-collector/webapps/*
    $ unzip pinpoint-collector-1.5.2.war -d /data/service/pinpoint-collector/webapps/ROOT/
    $ cd  /usr/local/pinpoint-collector/webapps/ROOT/WEB-INF/classes
    $ ls -al
    -rw-rw-r-- 1 root root 15835 Apr  7 14:43 applicationContext-collector.xml
    -rw-rw-r-- 1 root root  7485 Apr  7 14:43 applicationContext-hbase.xml
    -rw-rw-r-- 1 root root   757 Apr  7 14:43 hbase.properties     
    -rw-rw-r-- 1 root root  1845 Apr  7 14:43 log4j.xml
    -rw-rw-r-- 1 root root  1360 Apr  7 14:43 pinpoint-collector.properties     # pp-collector 환경설정
    -rw-rw-r-- 1 root root  3292 Apr  7 14:43 servlet-context.xml
    ...
$ vim hbase.properties
    hbase.client.host=192.168.56.12        # collector Hbase 환경설정 ( 로컬이면 127.0.0.1 )
    hbase.client.port=2181
    $ tar xf /usr/local/src/apache-tomcat-8.0.35.tar.gz -C /usr/local/
    $ mv apache-tomcat-8.0.35 pinpoint-web
    $ cd pinpoint-web/webapps/;rm -rf *;mkdir ROOT;cd ROOT/
    $ unzip /root/pinpoint-web-1.5.2.war
    $ vim /usr/local/pinpoint-web/conf/server.xml       # 위에 collector와 포트를 다르게 설정해야함
    <Server port="8006" shutdown="SHUTDOWN">     
    <Connector port="8086" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
    <!-- <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /> -->

    $ cd /data/service/pinpoint-web/webapps/ROOT/WEB-INF/classes
    $ vim hbase.properties
    hbase.client.host=192.168.56.12    # Hbase 설정 (로컬이면 127.0.0.1)
    hbase.client.port=2181
    ...
    $ ls -al
    total 88
    -rw-rw-r-- 1 root root 2164 Apr  7 14:43 applicationContext-cache.xml
    -rw-rw-r-- 1 root root 3649 Apr  7 14:43 applicationContext-dao-config.xml
    -rw-rw-r-- 1 root root 1490 Apr  7 14:43 applicationContext-datasource.xml
    -rw-rw-r-- 1 root root 6680 Apr  7 14:43 applicationContext-hbase.xml
    -rw-rw-r-- 1 root root 1610 Apr  7 14:43 applicationContext-websocket.xml
    -rw-rw-r-- 1 root root 6576 Apr  7 14:43 applicationContext-web.xml
    -rw-rw-r-- 1 root root  106 Apr  7 14:43 batch.properties
    -rw-rw-r-- 1 root root  682 Apr  7 14:43 ehcache.xml
    -rw-rw-r-- 1 root root 1005 Jul 14 21:45 hbase.properties
    -rw-rw-r-- 1 root root  153 Apr  7 14:43 jdbc.properties
    -rw-rw-r-- 1 root root 3338 Apr  7 14:43 log4j.xml
    -rw-rw-r-- 1 root root 1420 Apr  7 14:43 mybatis-config.xml
    -rw-rw-r-- 1 root root  630 Apr  7 14:43 pinpoint-web.properties
    -rw-rw-r-- 1 root root  141 Apr  7 14:43 project.properties
    -rw-rw-r-- 1 root root 3872 Apr  7 14:43 servlet-context.xml
    drwxrwxr-x 2 root root 4096 Jul 14 21:46 sql
    ...
$ cp /usr/local/src/pp-* /etc/init.d/
    $ chmod +x /etc/init.d/pp-*
    $ /etc/init.d/pp-web restart
    $ /etc/init.d/pp-collector restart


------------------------------------------------------------------------------------  AGENT 설치 ------------------------------------------------------------------------------------------------------------------------------ 


$ tar xf /usr/local/src/pinpoint-agent-1.5.2.tar.gz -C /
    $ cd /pinpoint-agent-1.5.2/
    $ vim pinpoint.config
    profiler.collector.ip=192.168.56.11         # collector의 IP를 적어준다

JAVA_OPTS="-Djava.awt.headless=true -server -Xms10240m -Xmx20480m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:+DisableExplicitGC -javaagent:/pinpoint_agent/pinpoint-bootstrap-1.6.0-SNAPSHOT.jar -Dpinpoint.agentId=sksk -Dpinpoint.applicationName=SK_TEST"  # 빨간부분 추가
-javaagent:/pinpoint-agent-1.5.2/pinpoint-bootstrap-1.5.2.jar -Dpinpoint.agentId=was1 -Dpinpoint.applicationName=P_PLUS_WAS1"


반응형

'엔지니어 > Linux' 카테고리의 다른 글

centos 6 python3 설치  (0) 2016.11.18
iptables-FORWARD chain 작동안할때  (0) 2016.11.18
backdoor 탐지  (0) 2016.11.18
REDIS  (0) 2016.11.18
16TB 이상 파일시스템 만들기  (0) 2016.09.30