引用

ES搭建
搭建简介1

准备安装环境

Zookeeper搭建

Zookeeper安装
安装zookeeper

wget https://dlcdn.apache.org/zookeeper/zookeeper-3.8.0/apache-zookeeper-3.8.0-bin.tar.gz --no-check-certificate
tar -xzvf apache-zookeeper-3.8.0-bin.tar.gz
mv apache-zookeeper-3.8.0-bin /data/home/user00/zookeeper

配置zookeeper

cp /data/home/user00/zookeeper/conf/zoo_sample.cfg /data/home/user00/zookeeper/conf/zoo.cfg
export PATH=$PATH:/data/home/user00/zookeeper/bin

vim /data/home/user00/zookeeper/conf/zoo.cfg

修改以下字段
dataDir=/data/home/user00/zookeeper/data
dataLogDir=/data/home/user00/zookeeper/log

启动zookeeper服务端

cd /data/home/user00/zookeeper/bin
./zkServer.sh start

启动zookeeper客户端

./zkCli.sh

启动效果

Connecting to localhost:2181
..........
..........
..........
Welcome to ZooKeeper!
2018-10-25 21:04:54,407 [myid:] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1029] - Opening socket connection to server localhost/0:0:0:0:0:0:0:1:2181. Will not attempt to authenticate using SASL (unknown error)
JLine support is enabled
2018-10-25 21:04:54,471 [myid:] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@879] - Socket connection established to localhost/0:0:0:0:0:0:0:1:2181, initiating session
[zk: localhost:2181(CONNECTING) 0] 2018-10-25 21:04:54,501 [myid:] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1303] - Session establishment complete on server localhost/0:0:0:0:0:0:0:1:2181, sessionid = 0x10000712e6f0000, negotiated timeout = 30000

WATCHER::

WatchedEvent state:SyncConnected type:None path:null

查看状态

cd /data/home/user00/zookeeper/bin
./zkServer.sh status

/usr/bin/java
ZooKeeper JMX enabled by default
Using config: /data/home/user00/zookeeper/bin/…/conf/zoo.cfg
Client port found: 2181. Client address: localhost. Client SSL: false.
Mode: standalone

ES搭建

下载Skywalking

wget https://dlcdn.apache.org/skywalking/9.0.0/apache-skywalking-apm-9.0.0.tar.gz --no-check-certificate
tar -xzvf apache-skywalking-apm-9.0.0.tar.gz
mv apache-skywalking-apm-bin /data/home/user00/skywalking

如果想连上ES7须下载for ElasticSearch 7
否则会报错:
org.apache.skywalking.oap.server.starter.OAPServerBootstrap - 60 [main] ERROR [] - storage module no provider exists. org.apache.skywalking.oap.server.library.module.ProviderNotFoundException: storage module no provider exists.
在这里插入图片描述

wget https://archive.apache.org/dist/skywalking/8.7.0/apache-skywalking-apm-es7-8.7.0.tar.gz
tar -xzvf apache-skywalking-apm-es7-8.7.0.tar.gz
mv apache-skywalking-apm-bin-es7 /data/home/user00/skywalking

SkyWalking OAP 搭建

配置数据库

vim /data/home/user00/skywalking/config/application.yml

- 配置注解
1. Skywalking OAP分别支持对单机部署,zookeeper、consul、etcd、nacos和k8s的集群部署。
2. 默认参数中gRPC的配置即为Agent的接入点

core:
··· 
		gRPCHost:${SW_CORE_GRPC_HOST:0.0.0.0}
		gPRCPort:${SW_CORE_GRPC_PORT:11800}

在standalone里增加节点配置

cluster:
  selector: ${SW_CLUSTER:standalone}
  standalone:
  # Please check your ZooKeeper is 3.5+, However, it is also compatible with ZooKeeper 3.4.x. Replace the ZooKeeper 3.5+
  # library the oap-libs folder with your ZooKeeper 3.4.x library.
    node.name: node-1
    cluster.initial_master_nodes: ["node-1"]

配置elasticsearch+版本号为数据库

selector: ${SW_STORAGE:elasticsearch7}
  elasticsearch7:
    namespace: ${SW_NAMESPACE:"ewanlin_skywalking"}
    clusterNodes: ${SW_STORAGE_ES_CLUSTER_NODES:9.135.74.252:9200}
    user: ${SW_ES_USER:"elastic"}
    password: ${SW_ES_PASSWORD:"***"}

配置Agent接入点

启动OAP

sh /data/home/user00/skywalking/bin/oapService.sh

在这里插入图片描述

  • 查看启动log
cat /data/home/user00/skywalking/logs/skywalking-oap-server.log
ps ef|grep oap

报错汇总

  • Failed to bind: 检查config/application.yml 配置的端口是否存在重复。

SkyWalking UI 搭建

配置访问端口

vim /data/home/user00/skywalking/webapp/webapp.yml
server:
  port: 18080

启动 UI

sh /data/home/user00/skywalking/bin/webappService.sh

在这里插入图片描述
在这里插入图片描述

使用说明

  • 在http://IP:18080 页面进入后不要F5刷新,刷新页面会挂(不支持多级url的解析)。
  • 追踪-> 选择时间->搜索
    在这里插入图片描述

启动

sh /data/home/user00/jaeger/bin/start-collector.sh
sh /data/home/user00/jaeger/bin/start-agent.sh

Go2Sky 搭建

// Go2Sky打算单独写一篇,这里不再追加

关于我们

欢迎关注公众号**《奇迹狗狗》**,很开心在这里能和你相遇~

我们会分享一些技术文章,包括但不限于游戏技术、云原生、ACM题解、基础编程知识等,如果能授人以渔,荣幸之至!

我们也会做一些有温度的产品、游戏,会陆续分享给大家,如果能博君一笑,再好不过!

产品列表:
WorkerHub小程序,信息均来自各个大厂员工爆料,可以查询各个公司/部门/岗位的工作做细、工作体验、工作评价等,供打工er找工作的时候参考,避雷卷王团队/天坑团队!