環境:
Centos 7.4 X64
IP:192.168.1.11html
到Oracle官網下載安裝JDK https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
上傳到系統並安裝java
[root@k1 ~]# rpm -ivh jdk-8u121-linux-x64.rpm [root@k1 ~]# java -version java version "1.8.0_121" Java(TM) SE Runtime Environment (build 1.8.0_121-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
到Oracle官網下載Hbase
https://hbase.apache.org/downloads.htmlnode
這裏最新版是2.1.3
下載linux
[root@k1 ~]# wget http://mirrors.shu.edu.cn/apache/hbase/2.1.3/hbase-2.1.3-bin.tar.gz #解壓 [root@k1 ~]# tar -xzf hbase-2.1.3-bin.tar.gz #移動到安裝目錄 [root@k1 ~]# mv hbase-2.1.3 /usr/local/hbase
修改Hbase環境配置,設置JAVA_HOME路徑git
[root@k1 ~]# vim /usr/local/hbase/conf/hbase-env.sh export JAVA_HOME=/usr/java/jdk1.8.0_121/ #在<configuration>之間添加如下配置 [root@k1 ~]# vim /usr/local/hbase/conf/hbase-site.xml <property> <name>zookeeper.znode.parent</name> <value>/hbase</value> </property> #啓動hbase [root@k1 ~]# /usr/local/hbase/bin/start-hbase.sh running master, logging to /usr/local/hbase/bin/../logs/hbase-root-master-k1.out
打開16010端口,就能看到hbase數據庫服務的web界面了
http://192.168.1.11:16010/github
打開pinpoint的github地址
https://github.com/naver/pinpointweb
找到代碼裏面的hbase/scripts/hbase-create.hbase 文件,下載下來有用shell
再到https://github.com/naver/pinpoint/releases/tag/1.8.1 裏面找到編譯好的war包和agent,下載下來數據庫
[root@k1 ~]# wget https://github.com/naver/pinpoint/releases/download/1.8.1/pinpoint-web-1.8.1.war [root@k1 ~]# wget https://github.com/naver/pinpoint/releases/download/1.8.1/pinpoint-collector-1.8.1.war [root@k1 ~]# wget https://github.com/naver/pinpoint/releases/download/1.8.1/pinpoint-agent-1.8.1.tar.gz #初始化hbase [root@k1 ~]# /usr/local/hbase/bin/hbase shell hbase-create.hbase Created table AgentInfo Took 5.5844 seconds Created table AgentStatV2 Took 4.3817 seconds ............ #再去下載一個tomcat [root@k1 ~]# wget http://mirrors.shu.edu.cn/apache/tomcat/tomcat-8/v8.5.38/bin/apache-tomcat-8.5.38.tar.gz #解壓 [root@k1 ~]# tar -xzf apache-tomcat-8.5.38.tar.gz #放到安裝目錄 [root@k1 ~]# mv apache-tomcat-8.5.38 /usr/local/tomcat #移動war包到tomcat 的webapps目錄 [root@k1 ~]# mv pinpoint-*.war /usr/local/tomcat/webapps/ #啓動tomcat [root@k1 ~]# /usr/local/tomcat/bin/startup.sh Using CATALINA_BASE: /usr/local/tomcat Using CATALINA_HOME: /usr/local/tomcat Using CATALINA_TMPDIR: /usr/local/tomcat/temp Using JRE_HOME: /usr Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar Tomcat started.
啓動成功,打開http://192.168.1.11:8080/pinpoint-web-1.8.1 網址就能看到pinpoint的監控頁面了
apache
此時的監控是沒有任何數據的
下面咱們來安裝監控tomat 的agent
把pinpoint-agent移動到安裝目錄並解壓
[root@k1 ~]# mkdir /usr/local/pinpoint-agent [root@k1 ~]# mv pinpoint-agent-1.8.1.tar.gz /usr/local/pinpoint-agent/ [root@k1 pinpoint-agent]# tar -xzf pinpoint-agent-1.8.1.tar.gz #修改tomcat配置 [root@k1 pinpoint-agent]# vim /usr/local/tomcat/bin/catalina.sh #後面接agent的時間目錄文件 JAVA_OPTS="$JAVA_OPTS -javaagent:/usr/local/pinpoint-agent/pinpoint-bootstrap-1.8.1.jar" JAVA_OPTS="$JAVA_OPTS -Dpinpoint.agentId=APM-104" #顯示的監控名字 JAVA_OPTS="$JAVA_OPTS -Dpinpoint.applicationName=tomcat8" 重啓tomcat [root@k1 pinpoint-agent]# /usr/local/tomcat/bin/shutdown.sh [root@k1 pinpoint-agent]# /usr/local/tomcat/bin/startup.sh
再從新打開web頁面就能看到有了一個tomcat8選項了
選中tomcat8查看,能夠看到有45個成功的請求
點擊inspector查看詳細信息
完成