Step-by-Step Guide to Install and Configure Apache SkyWalking for APM
This article walks through the concepts, architecture, download, installation, agent setup, service startup, and alert configuration of Apache SkyWalking, an open‑source APM platform for cloud‑native microservices, including Elasticsearch integration and DingTalk notifications.
Concept and Architecture
SkyWalking is an open‑source APM platform designed for cloud‑native, container‑based distributed systems. It monitors services, service instances and endpoints, and provides topology, metrics and alarm rules.
SkyWalking allows users to understand the topology relationship between Services and Endpoints, to view the metrics of every Service/Service Instance/Endpoint and to set alarm rules.
Architecture
SkyWalking consists of four logical components: Probes (agents), Platform backend, Storage and UI.
Agents collect data and report to the backend, which processes and stores it; the UI visualizes the data.
Download and Installation
SkyWalking offers an Elasticsearch‑based version and a non‑ES version. To use Elasticsearch as storage, download the ES version from the official site.
Download links:
https://skywalking.apache.org/downloads/
https://archive.apache.org/dist/skywalking/
Directory layout:
agent – copy to each service machine as probe
bin – service startup scripts
config – configuration files
oap‑libs – JARs required by the OAP service
webapp – JARs required by the web UI
Supported storage back‑ends include H2, Elasticsearch 6/7, MySQL, TiDB and InfluxDB. InfluxDB is recommended for time‑series data, but this guide uses Elasticsearch 7.
Install Elasticsearch
Download and extract Elasticsearch 7.x, then start and stop it with:
# start
./bin/elasticsearch -d -p pid
# stop
pkill -F pidElasticsearch 7.x requires Java 11+. Adjust system limits:
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[3]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configuredFix by editing /etc/security/limits.conf and /etc/sysctl.conf and updating elasticsearch.yml (set cluster.initial_master_nodes and network.host: 0.0.0.0).
Install Agent
Copy the agent directory to each service host, place optional plugins in plugins, and edit agent/config/agent.config (or use environment variables) to set agent.service_name and collector.backend_service.
agent.service_name=${SW_AGENT_NAME:user-center}
collector.backend_service=${SW_AGENT_COLLECTOR_BACKEND_SERVICES:192.168.100.17:11800}Start the service with the Java agent:
java -javaagent:/path/to/skywalking-agent/skywalking-agent.jar -jar yourApp.jarStart Services
Configure webapp/webapp.yml (port, collector address) and launch:
bin/startup.sh
# or
bin/oapService.sh
bin/webappService.shVerify logs and access the UI at http://127.0.0.1:8080.
Alert Configuration
Edit alarm-settings.yml to define alarm rules and notifications. The guide shows how to send alerts to DingTalk via a Spring Boot project.
Key files include pom.xml, AlarmMessageDTO, DingTalkAlarmService, and AlarmController with a POST endpoint /skywalking/alarm that forwards messages to DingTalk.
References: official SkyWalking documentation and related URLs.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Java Backend Technology
Focus on Java-related technologies: SSM, Spring ecosystem, microservices, MySQL, MyCat, clustering, distributed systems, middleware, Linux, networking, multithreading. Occasionally cover DevOps tools like Jenkins, Nexus, Docker, and ELK. Also share technical insights from time to time, committed to Java full-stack development!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
