当前位置: 首页 > article >正文

CentOS部署Skywalking

一、安装Docker
#yum -y install gcc
#yum -y install gcc-c++
#yum install -y yum-utils
设置国内的镜像仓库
#yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
更新yum软件包索引
#yum makecache fast
安装Docker引擎
#yum install docker-ce docker-ce-cli containerd.io docker-compose-plugin
启动Docker引擎
#systemctl start docker
设置开机启动
#systemctl enable docker.service
关闭开机启动
#systemctl disable docker.service

二、下载Elasticsearch容器
#docker pull elasticsearch:8.1.0
8.1.0: Pulling from library/elasticsearch
08c01a0ec47e: Pull complete
5ff2ab324559: Pull complete
02ed3593db24: Pull complete
818e9e5e96bb: Downloading [===================> ]
9ffdad5b7c03: Download complete
c75c21c9d887: Download complete
7de9ee659811: Download complete
e251a8179c68: Download complete
fc4fd8fa609a: Download complete
eac1c98ec28b: Download complete

三、启动Elasticsearch容器
#docker run -d --name elasticsearch -p 9200:9200 -p 9300:9300 -e “discovery.type=single-node” elasticsearch:8.1.0

指定外挂目录
#docker run -itd --name=elasticsearch --restart=always -p 9200:9200 -p 9300:9300 -e “discovery.type=single-node” -v /opt/data/elasticsearch8/data:/usr/share/elasticsearch/data -v /opt/data/elasticsearch8/logs:/usr/share/elasticsearch/logs elasticsearch:8.1.0
07a2a3d34483d842976592e6210c68604af057966702d5d8aee6d04be2616558

访问:https://192.168.100.201:9200/,用户名:elastic,口令:

四、修改Elasticsearch密码
#docker exec -it elasticsearch /bin/bash
elasticsearch@4bf62698795e:~$ ./bin/elasticsearch-setup-passwords interactive


Note: The ‘elasticsearch-setup-passwords’ tool has been deprecated. This command will be removed in a future release.


Initiating the setup of passwords for reserved users elastic,apm_system,kibana,kibana_system,logstash_system,beats_system,remote_monitoring_user.
You will be prompted to enter passwords as the process progresses.
Please confirm that you would like to continue [y/N]y

Enter password for [elastic]:
Reenter password for [elastic]:
Enter password for [apm_system]:
Reenter password for [apm_system]:
Enter password for [kibana_system]:
Reenter password for [kibana_system]:
Enter password for [logstash_system]:
Reenter password for [logstash_system]:
Enter password for [beats_system]:
Reenter password for [beats_system]:
Enter password for [remote_monitoring_user]:
Reenter password for [remote_monitoring_user]:
Changed password for user [apm_system]
Changed password for user [kibana_system]
Changed password for user [kibana]
Changed password for user [logstash_system]
Changed password for user [beats_system]
Changed password for user [remote_monitoring_user]
Changed password for user [elastic]

五、部署kibana容器(非必须)
1)下载容器
#docker pull elastic/kibana:8.1.0
8.1.0: Pulling from elastic/kibana
4fb807caa40a: Pull complete
2e80e64cf6e3: Pull complete
4c5043548240: Pull complete
c7c77672bdbf: Pull complete
a65d590a7ad2: Pull complete
f8d7c469c05a: Pull complete
403c1affe949: Pull complete
87804eacf159: Pull complete
ba875619762d: Pull complete
b1435e1654c6: Pull complete
5b69485d1c81: Pull complete
814c00a2ef69: Pull complete
690ca8c6b0d6: Pull complete
Digest: sha256:4a9a3364d29488da257a64ae114e79e2a3c8cf621f8d5c51c62bd1facb5773b0
Status: Downloaded newer image for elastic/kibana:8.1.0
docker.io/elastic/kibana:8.1.0
2)启动容器
#docker run -d --name kibana002 --link elasticsearch -e ELASTICSEARCH_URL=https://192.168.100.201:9200/ -p 5601:5601 elastic/kibana:8.1.0
532df9b9966754e88e25d9a02d407f6014550f7df7c938fbdd44554447890bc5
3)停止容器
#docker stop 0be2e886baaa
#docker kill 0be2e886baaa
4)访问
http://192.168.100.201:5601/
5)验证
#docker exec -it elasticsearch /bin/bash
elasticsearch@4bf62698795e:~$ cd bin
elasticsearch@4bf62698795e:~/bin$ elasticsearch-create-enrollment-token --scope kibana
WARNING: Owner of file [/usr/share/elasticsearch/config/users] used to be [root], but now is [elasticsearch]
WARNING: Owner of file [/usr/share/elasticsearch/config/users_roles] used to be [root], but now is [elasticsearch]
eyJ2ZXIiOiI4LjEuMCIsImFkciI6WyIxNzIuMTcuMC4yOjkyMDAiXSwiZmdyIjoiNzFmMjhkMDhkMTgyZWU3MjllMDcwODFkNWRhMDJiMjc4MGJjY2E5YTM0MmE2MzE4NDMxYWMxZjQ0NDI1ZGFjNSIsImtleSI6Ilh0bjUyNHNCMFhoYm1adWRQMDA5OkR2aGFfRlpYU2tDcEtZTkVDT2pRM1EifQ==
6)验证
#docker exec -it kibana002 /bin/bash
kibana@532df9b99667:~$ cd bin
kibana@532df9b99667:~/bin$ kibana-verification-code
Your verification code is: 894 715
7)登录,同Elasticsearch的密码(elastic)

六、部署Skywalking镜像
#docker pull apache/skywalking-oap-server:8.9.1
#docker pull apache/skywalking-ui:8.9.1
如果pull操作一直有waiting:
[root@boco201 docker]# pwd
/etc/docker
[root@boco201 docker]# more daemon.json
{
“registry-mirrors”:[
“https://9cpn8tt6.mirror.aliyuncs.com”,
“https://registry.docker-cn.com”
]
}
[root@boco201 docker]#

七、持久化启动Skywalking-oap
#docker run -itd --name skywalking-oap --restart=always -e TZ=Asia/Shanghai -p 12800:12800 -p 11800:11800 --link elasticsearch:elasticsearch -e SW_STORAGE=elasticsearch -e SW_STORAGE_ES_CLUSTER_NODES=elasticsearch:9200 apache/skywalking-oap-server:8.9.1

八、登录容器Skywalking-oap
#docker exec -it skywalking-oap bash

九、持久化启动Skywalking-ui
#docker run -itd --name skywalking-ui --restart=always -e TZ=Asia/Shanghai -p 8080:8080 --link skywalking-oap:skywalking-oap -e SW_OAP_ADDRESS=skywalking-oap:12800 apache/skywalking-ui:8.9.1

十、访问Skywalking-ui
http://192.168.100.201:8080/

十一、Java服务接入Skywalking
1)下载agent,从https://archive.apache.org/dist/skywalking/8.9.1/ 或 https://skywalking.apache.org/downloads/ 解压获得agent.jar(或agent-analyzer-8.9.1.jar)
2)jar包执行方式
#java -javaagent:/opt/data/skywalking-agent/agent/skywalking-agent.jar -Dskywalking.agent.service_name=my-app-service -Dskywalking.collector.backend_service=192.168.100.201:11800 -jar my-app-service.jar &

#java -javaagent:/opt/data/skywalking-agent/agent/agent-analyzer-8.9.1.jar -Dskywalking.agent.service_name=my-app-service -Dskywalking.collector.backend_service=192.168.100.201:11800 -jar my-app-service.jar &


http://www.kler.cn/a/137041.html

相关文章:

  • GitCode 光引计划投稿|MilvusPlus:开启向量数据库新篇章
  • sh cmake-linux.sh -- --skip-license --prefix = $MY_INSTALL_DIR
  • java开发入门学习五-流程控制
  • Vue3之Pinia
  • Go怎么做性能优化工具篇之基准测试
  • NLP 中文拼写检测开源-01-基于贝叶斯公式的拼写检查器 CSC
  • 浅谈电动汽车充电桩设计与应用研究
  • Linux 基础操作手记四
  • #gStore-weekly | gBuilder功能详解之表单录入
  • Web之HTML笔记
  • 人工智能基础_机器学习044_使用逻辑回归模型计算逻辑回归概率_以及_逻辑回归代码实现与手动计算概率对比---人工智能工作笔记0084
  • yolo系列模型训练数据集全流程制作方法(附数据增强代码)
  • Git详解及 github使用
  • Spring的声明式事务
  • WebSocket --- ws模块源码解析(详解)
  • webpack配置全局scss
  • Java运行时数据区和常用指令
  • 什么是轻量应用服务器?腾讯云轻量服务器可以干什么?
  • openlayer绘制过程添加提示文字
  • 利用ssh端口转发
  • VsCode连接远程Linux编译环境的便捷处理
  • ​软考-高级-系统架构设计师教程(清华第2版)【第18章 安全架构设计理论与实践(P648~690)-思维导图】​
  • 深度了解LinkedBlockingQueue底层实现原理
  • SpringSecurity+JWT权限认证
  • 2023年中国聚氨酯树脂涂料需求量、市场规模及行业趋势分析[图]
  • Goby 漏洞发布|大华智慧园区综合管理平台 poi 文件上传漏洞