您好,登錄后才能下訂單哦!
本文小編為大家詳細(xì)介紹“skywalking在docker中怎么應(yīng)用”,內(nèi)容詳細(xì),步驟清晰,細(xì)節(jié)處理妥當(dāng),希望這篇“skywalking在docker中怎么應(yīng)用”文章能幫助大家解決疑惑,下面跟著小編的思路慢慢深入,一起來(lái)學(xué)習(xí)新知識(shí)吧。
下載源碼包,下面會(huì)用到agent
https://archive.apache.org/dist/skywalking/6.6.0/apache-skywalking-apm-6.6.0.tar.gz
拉取鏡像
docker pull elasticsearch:7.5.1 docker pull apache/skywalking-oap-server:6.6.0-es7 docker pull apache/skywalking-ui:6.6.0
vi /etc/sysctl.conf vm.max_map_count=262144 #調(diào)整參數(shù) sysctl -p #刷新參數(shù)
docker run -d --name=es7 \ -p 9200:9200 -p 9300:9300 \ -e "discovery.type=single-node" elasticsearch:7.5.1
mkdir -p /data/elasticsearch docker cp es7:/usr/share/elasticsearch/data /data/elasticsearch/ docker cp es7:/usr/share/elasticsearch/logs /data/elasticsearch/ docker rm -f es7
創(chuàng)建編排文件
cd /data && touch docker-compose.yml tar -zxvf apache-skywalking-apm-6.6.0.tar.gz #解壓源碼以便后續(xù)使用agent
編輯編排文件
version: '3' networks: cq-data-security: ##我這里選擇了已有網(wǎng)卡,與我java項(xiàng)目網(wǎng)卡一致可以容器之間相互通信,具體需求看自己 external: true services: es7: image: elasticsearch:7.5.1 container_name: es7 expose: - 9200 - 9300 restart: always volumes: - /data/elasticsearch/data:/usr/share/elasticsearch/data - /data/elasticsearch/logs:/usr/share/elasticsearch/logs environment: - TZ=Asia/Shanghai - LANG=en_US.UTF-8 - discovery.type=single-node networks: cq-data-security: ipv4_address: 172.62.0.51 skywalking-oap-server: image: apache/skywalking-oap-server:6.6.0-es7 container_name: skywalking-oap-server expose: - 12800 - 11800 privileged: true restart: always environment: - TZ=Asia/Shanghai - LANG=en_US.UTF-8 - SW_STORAGE=elasticsearch - SW_STORAGE_ES_CLUSTER_NODES=172.62.0.51:9200 networks: cq-data-security: ipv4_address: 172.62.0.52 skywalking-ui: image: apache/skywalking-ui:6.6.0 container_name: skywalking-ui ports: - 28080:8080 privileged: true restart: always environment: - SW_OAP_ADDRESS=172.62.0.52:12800 networks: cq-data-security: ipv4_address: 172.62.0.53
docker-compose up -d 直接啟動(dòng)即可
訪問(wèn)localhost:28080 ui訪問(wèn)
cd /data cp -r apache-skywalking-apm-bin/agent /你的項(xiàng)目目錄/dockerfile所在目錄
#編輯dockerfile將以下參數(shù)加入dockerfile RUN mkdir /root/agent COPY ./agent /root/agent
#修改java應(yīng)用啟動(dòng)參數(shù)
java -javaagent:/root/agent/skywalking-agent.jar=agent.service_name=group_module -Dskywalking.collector.backend_service=172.62.0.52:11800 -jar /root/group-module-1.0-SNAPSHOT.jar --server.port=8890
至此客戶端和服務(wù)端部署完成,可以打開ui界面進(jìn)行訪問(wèn)
讀到這里,這篇“skywalking在docker中怎么應(yīng)用”文章已經(jīng)介紹完畢,想要掌握這篇文章的知識(shí)點(diǎn)還需要大家自己動(dòng)手實(shí)踐使用過(guò)才能領(lǐng)會(huì),如果想了解更多相關(guān)內(nèi)容的文章,歡迎關(guān)注億速云行業(yè)資訊頻道。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。