1、需求:有兩臺服務器分別裝了app,對這些app進行性能監控
三臺服務器:10.10.20.198作爲服務端展示性能數據,10.10.20.64客戶端,裝btam系統,10.10.20.63客戶端裝任務管理系統和工作量系統。
2、所安裝的軟件版本如下:
(1)JDK1.8
(2)elasticsearch-5.6.8
(3)zookeeper-3.4.10(集羣需要,單機可不裝)
(4)apache-skywalking-apm-incubating-5.0.0
安裝包下載地址:
鏈接:https://pan.baidu.com/s/1kOhSdTgIFO2OsbOeIzoO0g
提取碼:qsqa
2.1 JDK安裝及配置環境變量(略)
2.2 elasticsearch-5.6.8配置
將elasticsearch-5.6.8拷貝到客戶端指定文件夾,
修改D:\elasticsearch-5.6.8\config\elasticsearch.yml
啓動D:\elasticsearch-5.6.8\bin\elasticsearch.bat
啓動成功可在瀏覽器通過http://10.10.20.63:9200查看
cluster.name: CollectorDBCluster node.name: node-3 #設置唯一的節點名稱 node.max_local_storage_nodes: 4 node.attr.rack: r1 path.data: D:/elasticsearch-5.6.8/data path.logs: D:/elasticsearch-5.6.8/logs network.host: 10.10.20.63 thread_pool.bulk.queue_size: 1000 http.port: 9200 discovery.zen.ping.unicast.hosts: ["10.10.20.198:9300","10.10.20.64:9300","10.10.20.63:9300"] discovery.zen.minimum_master_nodes: 1 http.cors.enabled: true http.cors.allow-origin: "*" node.master: true node.data: true |
2.3 zookeeper-3.4.10
將zookeeper包分別拷貝到各個服務器,修改D:\zookeeper\conf\zoo.conf
在dataDir制定的文件夾D:\zookeeper\data下新建文件myid,無後綴名,文件內容爲server的序號:1,序號必須與其對應的服務器保持一致
按服務器的順序先後啓動D:\zookeeper\bin\zkserver.cmd
tickTime=2000 initLimit=10 syncLimit=5 dataDir=D:\\zookeeper\\data dataLogDir=D:\\zookeeper\\logs clientPort=2181 server.1=10.10.20.198:2888:3888 server.2=10.10.20.64:2888:3888 server.3=10.10.20.63:2888:3888 |
2.4 服務端collector
修改apache-skywalking-apm-incubating\config\application.yml
啓動apache-skywalking-apm-incubating\bin\collectorService.bat
修改的配置如下:
cluster: zookeeper: hostPort: 10.10.20.198:2181,10.10.20.64:2181,10.10.20.63:2181 sessionTimeout: 100000 naming: jetty: host: 10.10.20.198 remote: gRPC: host: 10.10.20.198 agent_gRPC: gRPC: host: 10.10.20.198 agent_jetty: jetty: host: 10.10.20.198 ui: jetty: host: 10.10.20.198 storage: elasticsearch: clusterName: CollectorDBCluster clusterNodes: 10.10.20.198:9300,10.10.20.64:9300,10.10.20.63:9300 |
2.5 服務端webui配置
修改apache-skywalking-apm-incubating\webapp\webapp.yml
啓動apache-skywalking-apm-incubating\bin\webappservice.bat
server: port: 8080 collector: path: /graphql ribbon: ReadTimeout: 10000 listOfServers: 127.0.0.1:10800 |
2.6 客戶端collector配置
單獨下載skywalking-collector包到客戶端
修改D:\skywalking-collector\config\collector.conf
啓動D:\skywalking-collector\bin\collector-service.bat
cluster.current.hostname = 10.10.20.63 #當前服務器 cluster.seed_nodes=10.10.20.63:11800 #當前服務器 es.cluster.nodes=10.10.20.63:9300,10.10.20.198:9300,10.10.20.64:9300 http.hostname=10.10.20.198 #服務端webui所在服務器 |
2.7 客戶端agent配置
將agent文件夾拷貝到客戶端服務器
修改C:\jetty\agent\config\agent.config
設置系統環境變量,然後啓動app
JAVA_TOOL_OPTIONS=-javaagent:C:/jetty/agent/skywalking-agent.jar,
或者直接使用如下命令啓動app
Java -javaagent:C:/jetty/agent/skywalking-agent.jar -jar asset.jar
修改的配置如下:
agent.application_code=CollectorDBCluster collector.direct_servers=10.10.20.63:11800,10.10.20.64:11800,10.10.20.198:11800 |
2.8 頁面訪問 http://10.10.20.198:8080