skywalking5集群部署

准备环境

  1. skywalking-5.0.0-GA
  2. zookeeper-3.4.10
  3. 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集群

  1. 下载并解压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. 修改配置文件
1
2
3
cd zookeeper-3.4.10/conf/
cp zoo_sample.cfg zoo.cfg
vim zoo.cfg
  1. 内容如下
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
  1. 写入集群myid
1
2
echo 1 > /opt/export/app/zookeeper-3.4.10/data/myid
# 另一台机器则写入2
  1. zk基本命令
1
2
3
4
5
6
7
8
9
10
11
# 在zk的bin目录下
# 启动
./zkServer.sh start
# 停止
./zkServer.sh stop
# 查看状态
./zkServer.sh status
# 查看zk的节点
./zkCli.sh
# 连接后使用 ls / 命令查看
ls /skywalking

安装es集群

  1. 下载并解压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. 修改配置文件
1
2
cd elasticsearch-5.6.14/config/
vim elasticsearch.yml
  1. 内容如下
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. 常用命令
1
2
3
4
# 后台启动
bin/elasticsearch -d
# 删除所有索引
curl -XDELETE 192.168.***.234:9200/*

安装skywalking

官方地址

  1. 下载并解压
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. 修改配置
1
2
cd skywalking-5.0.0-GA/config/
vim application.yml
  1. 修改内容如下
    1. 集群配置
      1
      2
      3
      4
      cluster:
      zookeeper:
      hostPort: 192.168.***.236:2181,192.168.***.237:2181
      sessionTimeout: 100000
    2. es配置
      1
      2
      3
      4
      5
      6
      storage:
      elasticsearch:
      clusterName: CollectorDBCluster
      clusterTransportSniffer: true
      clusterNodes: 192.168.***.234:9300,192.168.***.235:9300
      # 其他配置
    3. 其他配置
      1
      2
      # host配置修改
      host: 192.168.***.236
  2. 修改webapp配置
1
vim webapp/webapp.yml
1
2
3
4
5
collector:
path: /graphql
ribbon:
ReadTimeout: 10000
listOfServers: 192.168.**.236:10800,192.168.**.237:10800
  1. 常用命令
1
2
3
4
5
# 启动collector+webUI
bin/startup.sh
# 只启动collector或webUI
bin/collectorService.sh
bin/webappService.sh
  1. 探针使用
    官方地址
    java -javaagent:/path/to/skywalking-agent/skywalking-agent.jar -jar yourApp.jar