准备环境
- skywalking-5.0.0-GA
- zookeeper-3.4.10
- elasticsearch-5.6.14
下载地址如下:
skywalking: http://skywalking.apache.org/downloads/
zookeeper: http://mirrors.hust.edu.cn/apache/zookeeper/
elasticsearch: https://www.elastic.co/downloads/past-releases
安装zk集群
- 下载并解压zk
1 2
| wget http://mirrors.hust.edu.cn/apache/zookeeper/zookeeper-3.4.10/zookeeper-3.4.10.tar.gz tar -xvf zookeeper-3.4.10.tar.gz
|
- 修改配置文件
1 2 3
| cd zookeeper-3.4.10/conf/ cp zoo_sample.cfg zoo.cfg vim zoo.cfg
|
- 内容如下
1 2 3 4 5 6 7
| tickTime=2000 initLimit=10 syncLimit=5 dataDir=/opt/export/app/zookeeper-3.4.10/data clientPort=2181 server.1=192.168.***.236:2888:3888 server.2=192.168.***.237:2888:3888
|
- 写入集群myid
1 2
| echo 1 > /opt/export/app/zookeeper-3.4.10/data/myid
|
- zk基本命令
1 2 3 4 5 6 7 8 9 10 11
|
./zkServer.sh start
./zkServer.sh stop
./zkServer.sh status
./zkCli.sh
ls /skywalking
|
安装es集群
- 下载并解压es
1 2
| wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.14.tar.gz tar -xvf elasticsearch-5.6.14.tar.gz
|
- 修改配置文件
1 2
| cd elasticsearch-5.6.14/config/ vim elasticsearch.yml
|
- 内容如下
1 2 3 4 5 6 7 8 9 10 11
| cluster.name: CollectorDBCluster node.name: node-1 path.data: /opt/export/app/elasticsearch-5.6.14/data path.logs: /opt/export/app/elasticsearch-5.6.14/logs network.host: 192.168.***.234 discovery.zen.ping.unicast.hosts: ["192.168.***.234:9300", "192.168.***.235:9300"] discovery.zen.minimum_master_nodes: 2 bootstrap.memory_lock: false bootstrap.system_call_filter: false
thread_pool.bulk.queue_size: 1000
|
- 常用命令
1 2 3 4
| bin/elasticsearch -d
curl -XDELETE 192.168.***.234:9200/*
|
安装skywalking
☞ 官方地址
- 下载并解压
1 2 3
| wget http://mirrors.shu.edu.cn/apache/incubator/skywalking/5.0.0-GA/apache-skywalking-apm-incubating-5.0.0-GA.tar.gz tar -xvf apache-skywalking-apm-incubating-5.0.0-GA.tar.gz mv apache-skywalking-apm-incubating-5.0.0-GA skywalking-5.0.0-GA
|
- 修改配置
1 2
| cd skywalking-5.0.0-GA/config/ vim application.yml
|
- 修改内容如下
- 集群配置
1 2 3 4
| cluster: zookeeper: hostPort: 192.168.***.236:2181,192.168.***.237:2181 sessionTimeout: 100000
|
- es配置
1 2 3 4 5 6
| storage: elasticsearch: clusterName: CollectorDBCluster clusterTransportSniffer: true clusterNodes: 192.168.***.234:9300,192.168.***.235:9300
|
- 其他配置
- 修改webapp配置
1 2 3 4 5
| collector: path: /graphql ribbon: ReadTimeout: 10000 listOfServers: 192.168.**.236:10800,192.168.**.237:10800
|
- 常用命令
1 2 3 4 5
| bin/startup.sh
bin/collectorService.sh bin/webappService.sh
|
- 探针使用
☞ 官方地址
java -javaagent:/path/to/skywalking-agent/skywalking-agent.jar -jar yourApp.jar