pinpoint搭建

pinpoint搭建

官方安装向导 https://naver.github.io/pinpoint/installation.html

需要的组件

jdk8 --- Java运行环境
hbase-1.x --- 数据库,用来存储监控信息
tomcat8.0 --- Web服务器
pinpoint-collector.war --- pp的控制器
pinpoint-web.war --- pp展示页面
pp-collector.init --- 用来快速启动pp-col,不要也可以
pp-web.init --- 用来快速启动pp-web,不要也可以

下载组件

wget https://github.com/naver/pinpoint/releases/download/v2.0.3/pinpoint-agent-2.0.3.tar.gz

wget https://github.com/naver/pinpoint/releases/download/v2.0.3/pinpoint-collector-2.0.3.war

wget https://github.com/naver/pinpoint/releases/download/v2.0.3/pinpoint-web-2.0.3.war

wget https://github.com/naver/pinpoint/releases/download/v2.0.3/pinpoint-flink-job-2.0.3.jar

wget https://mirror.bit.edu.cn/apache/tomcat/tomcat-8/v8.5.57/bin/apache-tomcat-8.5.57.tar.gz

初始化Hbase表格

 cd hbase/script
./hbase shell  /opt/pinpoint/hbase-create.hbase

部署war包

部署collector包和web包

tar -zxvf apache-tomcat-8.5.57.tar.gz
rm -rf apache-tomcat-8.5.57/webapps/*
cp -r apache-tomcat-8.5.57 tomcat-web
mv apache-tomcat-8.5.57 tomcat-col
mv pinpoint-web-2.0.3.war apache-tomcat-8.5.57/webapps/
mv pinpoint-collector-2.0.3.war apache-tomcat-8.5.57/webapps/

编辑tomcat conf下的server.xml修改端口,防止端口冲突:

配置pinpoint-col:

sed -i 's/port="8005"/port="18005"/g' server.xml
sed -i 's/port="8080"/port="18080"/g' server.xml
sed -i 's/port="8443"/port="18443"/g' server.xml
sed -i 's/port="8009"/port="18009"/g' server.xml
sed -i 's/redirectPort="8443"/redirectPort="18443"/g' server.xml
sed -i "s/localhost/192.168.163.66/g" server.xml

部署war包

unzip pinpoint-collector-2.0.3.war -d tomcat-col/webapps/ROOT

修改zk和hbase的地址

cd tomcat-col/webapps/ROOT/WEB-INF/classes/profiles/release

修改hbase-env.properties文件

hbase.client.host=192.168.163.66,192.168.163.24,192.168.163.23
hbase.client.port=2181

修改pinpoint-collector-env.properties文件

pinpoint.zookeeper.address=192.168.163.66,192.168.163.24,192.168.163.23

修改pinpoint-collector.properties文件

cluster.listen.ip=192.168.163.66
cluster.listen.port=9734

启动tomcat

./startup.sh

配置pinpoint-web:

sed -i 's/port="8005"/port="28005"/g' server.xml
sed -i 's/port="8080"/port="28080"/g' server.xml
sed -i 's/port="8443"/port="28443"/g' server.xml
sed -i 's/port="8009"/port="28009"/g' server.xml
sed -i 's/redirectPort="8443"/redirectPort="28443"/g' server.xml
sed -i "s/localhost/192.168.163.66/g" server.xml

部署war包

unzip pinpoint-web-2.0.3.war -d tomcat-col/webapps/ROOT

修改配置

cd /opt/pinpoint/tomcat-web/webapps/ROOT/WEB-INF/classes/profiles/release

修改hbase-env.properties文件

hbase.client.host=192.168.163.66,192.168.163.24,192.168.163.23
hbase.client.port=2181

修改pinpoint-collector-env.properties文件

pinpoint.zookeeper.address=192.168.163.66,192.168.163.24,192.168.163.23

修改pinpoint-web.properties文件,添加collector端口

cluster.connect.address=192.168.163.66:9734

启动tomcat

./startup.sh

访问WEBUI

http://192.168.163.66:28080

客户端埋点

解压agent

java  -javaagent:pinpoint-bootstrap.jar -Dpinpoint.agentId=smart-3 --Dpinpoint.applicationName=smart-3  -jar credit_engine.jar

注意如果不是一台机器需要到解压的文件夹下的profile去修改下环境变量

你可能感兴趣的:(链路监控,APM)