Skip to content

NimTechnology

Trình bày các công nghệ CLOUD một cách dễ hiểu.

  • Kubernetes & Container
    • Docker
    • Kubernetes
      • Ingress
    • Helm Chart
    • Isito-EnvoyFilter
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Vault
    • Longhorn – Storage
    • VictoriaMetrics
  • CI/CD
    • ArgoCD
    • ArgoWorkflows
    • Spinnaker
    • Jenkins
  • Coding
    • Terraform
      • GCP – Google Cloud
      • AWS – Amazon Web Service
    • Golang
    • Laravel
    • Jquery & JavaScript
    • Git
    • Selenium
  • Log & Monitor
    • Prometheus
    • Grafana
    • ELK
      • Kibana
      • Logstash
  • BareMetal
  • Toggle search form

[APM/Elastic] Install APM Elastic inside container WordPress.

Posted on March 17, 2022March 17, 2022 By nim No Comments on [APM/Elastic] Install APM Elastic inside container WordPress.

Hôm qua mình mới khám phá thêm thanh niên khá hay ho. Đó là APM trong họ hàng nhà Elastic
Elastic APM is an application performance monitoring system built on the Elastic Stack. It allows you to monitor software services and applications in real-time, by collecting detailed performance information on response time for incoming requests, database queries, calls to caches, external HTTP requests, and more.

Contents

  • 1) Install APM Server
  • 2) Install APM Agent
  • 3) result

1) Install APM Server

Bạn có thể cài bất cứ con nào? Đại loại APM server sẽ nhận từ APM agent và gửi về cho elastic.

thường UI kibana hướng dẫn chúng ta cái luôn.
mkdir apm-server
cd apm-server/
wget https://artifacts.elastic.co/downloads/apm-server/apm-server-7.16.3-amd64.deb
dpkg -i apm-server-7.16.3-amd64.deb

Giờ sửa file config

vi /etc/apm-server/apm-server.yml

######################### APM Server Configuration #########################

################################ APM Server ################################

apm-server:
  # Defines the host and port the server is listening on. Use "unix:/path/to.sock" to listen on a unix domain socket.
  host: "192.168.101.24:8200"

  # Configure authorization via a common `secret_token`. By default it is disabled.
  # Agents include the token in the following format: Authorization: Bearer <secret-token>.
  # It is recommended to use an authorization token in combination with SSL enabled,
  # and save the token in the apm-server keystore.
  #
  # WARNING: This configuration is deprecated and replaced with `apm-server.auth.secret_token`, and will be removed
  # in the 8.0 release. If that config is defined, this one will be ignored.
  #secret_token:
  secret_token: "<input password>"
#-------------------------- Elasticsearch output --------------------------
output.elasticsearch:
  # Array of hosts to connect to.
  # Scheme and port can be left out and will be set to the default (`http` and `9200`).
  # In case you specify and additional path, the scheme is required: `http://localhost:9200/path`.
  # IPv6 addresses should always be defined as: `https://[2001:db8::1]:9200`.
  hosts: ["192.168.101.24:9200"]

Giờ thực hiện restart và kiểm tra

systemctl restart apm-server
systemctl enable apm-server
systemctl status apm-server
Nếu response như hình là ok

2) Install APM Agent

Bạn sẽ cần exec vào container workpress nhé

docker exec -it wordpress_wordpress_1 bash
cd /var/www/html/
apt install wget -y
wget https://github.com/elastic/apm-agent-php/releases/download/v1.4.2/apm-agent-php_1.4.2_all.deb
dpkg -i apm-agent-php_1.4.2_all.deb 
ls -ll /usr/local/etc/php/conf.d

giờ sửa file 99-elastic-apm-custom.ini

Last login: Wed Mar 16 00:21:25 2022 from 192.168.101.37
root@docker-center-u20:~# docker exec -it wordpress_wordpress_1 bash
root@7d2d8c677ede:/var/www/html# cat /usr/local/etc/php/conf.d/99-elastic-apm-custom.ini 
; This file contains the various settings for the Elastic APM PHP agent. For
; further details refers to the following URL:
; https://www.elastic.co/guide/en/apm/agent/php/current/configuration-reference.html
;

[elastic]
elastic_apm.enabled = true
;elastic_apm.api_key = "REPLACE_WITH_API_KEY"
elastic_apm.environment = "production"
elastic_apm.log_level = "INFO"
elastic_apm.log_level_stderr = "INFO"
elastic_apm.secret_token = "<input password>"
;elastic_apm.server_timeout = "30s"
elastic_apm.server_url = "http://192.168.101.24:8200"
elastic_apm.service_name = "nimtechnology"
;elastic_apm.service_version = "REPLACE_WITH_OUTPUT_FROM_git rev-parse HEAD"
;elastic_apm.transaction_max_spans = 500
;elastic_apm.transaction_sample_rate = 

Bạn save lại và restart container nhé!

3) result

giờ quay trở lại APM sẽ thể có suất hiện thông tin APM gent

Bạn có thể biết được Latency, Throughput, Transactions,…

ELK

Post navigation

Previous Post: [Golang] Checking a string inside or in another string by Golang
Next Post: [Cilium/Hubble] Research together and install cilium instead of using kube-proxy and other CNI providers.

More Related Articles

[Logstash] Multi config, input, filter, output inside a Logstash server and Not conflict ELK
[Kibana] Tutorial export and import much data(dashboard,…) in Kibana – ELK ELK
[Kibana-ELK] Installing and Seting a Kibana For ELK ELK
[error] Solve elasticsearch error Limit of total fields [1000] in index [xxx] ELK
[Logstash] Install Logstash and send logs from Kong Gateway to Logstash. So fast and easy – ELK ELK
[logstash/kibana] Draw a Map on Kibana by data from Logstash – Fix “Index pattern does not contain any geospatial fields” ELK

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Tham Gia Group DevOps nhé!
Để Nim có nhiều động lực ra nhiều bài viết.
Để nhận được những thông báo mới nhất.

Recent Posts

  • Protected: My Assignment  June 24, 2022
  • [Spinnaker] Spinnaker writes too many logs – Reduce spinnaker log level June 22, 2022
  • [Jenkins] Jobs will be created automatically by Jenkins Job Builder June 20, 2022
  • [Postgresql] Install postgresql client and trying a few command postgresql. June 20, 2022
  • [Mount/Nextcloud] How do you mount a hard disk that was used windows into Linux. June 19, 2022

Archives

  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021

Categories

  • BareMetal
  • CI/CD
    • ArgoCD
    • ArgoWorkflows
    • Jenkins
    • Spinnaker
  • Coding
    • Git
    • Golang
    • Jquery & JavaScript
    • Laravel
    • Selenium
    • Terraform
      • AWS – Amazon Web Service
      • GCP – Google Cloud
  • Kubernetes & Container
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Docker
    • Helm Chart
    • Isito-EnvoyFilter
    • Kubernetes
      • Ingress
    • Longhorn – Storage
    • Vault
    • VictoriaMetrics
  • Log & Monitor
    • ELK
      • Kibana
      • Logstash
    • Grafana
    • Prometheus
  • Uncategorized
  • Admin

Copyright © 2022 NimTechnology.