Application Real-Time Monitoring Service (ARMS), Container Service for Kubernetes (ACK) kümelerinde çalışan Java uygulamalarını ack-onepilot eklentisi aracılığıyla izler. Eklentiyi yükleyip yetkilendirerek üretim ortamlarındaki sorunları çok daha hızlı bir şekilde teşhis edebilirsiniz.
Genel bilgiler
Application Real-Time Monitoring Service (ARMS) bir Alibaba Cloud uygulama performansı yönetimi (APM) ürünüdür. Container Service for Kubernetes (ACK) içinde, herhangi bir kod değişikliği yapmadan Java uygulamalarını uçtan uca izlemek için ack-onepilot eklentisini yükleyin ve yetkilendirin.
Bu eklenti, uygulama topolojisini ve arayüzlerini otomatik olarak keşfederek 3B topoloji haritaları oluşturur. Arayüzleri izler, anormal ve yavaş işlemleri yakalar. Bu izleme verilerini kullanarak hatalı ve yavaş arayüzleri hızla bulabilir, çağrı parametrelerini yeniden üretebilir, bellek sızıntılarını tespit edebilir ve sistem darboğazlarını belirleyebilirsiniz. ARMS uygulama izleme hakkında daha fazla bilgi için bkz. Uygulama izleme nedir?
Ön koşullar
Bir ad alanı oluşturulmuş olmalıdır. Daha fazla bilgi için bkz. Ad alanlarını ve kaynak kotalarını yönetme. Bu konuda örnek olarak
arms-demoad alanı kullanılmıştır.-
JDK sürümü Uygulama İzleme tarafından desteklenmelidir. ARMS aşağıdaki JDK sürümlerini destekler:
-
JDK 1.7.0+
ÖnemliARMS aracı V3.0.X ve sonraki sürümleri artık Java 7'yi desteklemeyecektir. Hala Java 7 kullanıyorsanız, Java sürümünüzü yükseltmenizi öneririz. Daha fazla bilgi için bkz. Uygulama İzleme artık Java 7'yi desteklemiyor.
-
JDK 1.8.0_25+
NotUygulamaları Kubernetes kümelerine dağıtıyorsanız, JDK V1.8.0_191 veya sonraki bir sürümü kullanmanızı öneririz.
JDK sürümünün 1.8.0_25 veya 1.8.0_31 olmadığından emin olun. Aksi takdirde ARMS aracı yüklenemeyebilir. Bu durumda JDK'yı en son 1.8.X sürümüne yükseltmenizi öneririz.
JDK 11.0.8+
JDK 17
-
Adım 1: ARMS uygulama izleme eklentisini yükleme
Eski arms-pilot bileşeni artık bakım almamaktadır. ack-onepilot bunun yerine geçen ve tamamen uyumlu olan eklentidir; geçiş işlemi için uygulama yapılandırmanızda değişiklik yapmanız gerekmez. Geçiş adımları için bkz. arms-pilot'u kaldırma ve ack-onepilot'u yükleme.
Varsayılan olarak ack-onepilot eklentisi en fazla 1.000 pod'u destekler. Kümedeki her ek 1.000 pod için eklentinin CPU kaynağını 0,5 çekirdek ve belleğini 512 MB artırın.
Log on to the ACK konsolu. In the left navigation pane, click Clusters.
On the Clusters page, click the name of your cluster. In the left navigation pane, click Components and Add-ons .
In the Logs and Monitoring section, find the ack-onepilot add-on and click Install on the add-on card.
In the dialog box, configure the add-on parameters. (Recommended) Keep the default values. Click OK to complete the installation.
After the installation is complete, you can upgrade, configure, or uninstall the ack-onepilot add-on on the Add-ons page.
Adım 2: ARMS kaynaklarına erişim izinlerini verme
Whether you must grant permissions manually depends on whether the addon.arms.token Secret exists in the cluster. If the Secret exists, no authorization is required and you can skip to Step 3. If the Secret does not exist, grant the cluster permissions to access ARMS resources manually so that ARMS can monitor the applications in the cluster.
When a cluster contains the addon.arms.token Secret, ARMS grants the cluster permissions to access ARMS resources automatically, without credentials. Most ACK yönetilen küme include the Secret by default, but ACK yönetilen kümeler created earlier might not.
addon.arms.token Secret'ının var olup olmadığını kontrol etme
Log on to the ACK konsolu. In the left navigation pane, click Clusters.
On the Clusters page, click the name of your cluster. In the left navigation pane, click .
On the Secrets page, select kube-system from the Namespace drop-down list, and then check whether the
addon.arms.tokenSecret is listed.
ARMS kaynaklarına erişim izinlerini manuel olarak verme
Perform the following steps only if the addon.arms.token Secret does not exist in the cluster.
Log on to the ACK konsolu. In the left navigation pane, click Clusters.
On the Clusters page, click the name of your cluster. In the left navigation pane, click Cluster Information.
On the Basic Information tab, find the Cluster Resources section and click the link to the right of Worker RAM Role.
On the Role page, click the Permissions tab, and then click Add Permissions.
Set the permission to AliyunARMSFullAccess and then click OK.
Elastic Container Instance (ECI) ile entegre kümeler için izinler verme
To monitor applications in ACK yönetilen küme that is integrated with ECI, grant the permissions on the RAM Hızlı Yetkilendirme sayfası, and then restart all pods of the ack-onepilot add-on.
Adım 3: Bir Java uygulaması için ARMS uygulama izlemeyi etkinleştirme
Enable ARMS application monitoring when you create a Java application. The following steps create a Deployment from a YAML template in the ACK console.
Log on to the ACK konsolu. In the left navigation pane, click Clusters.
On the Clusters page, click the name of your cluster. In the left navigation pane, click .
On the Deployments page, click Create from YAML.
-
Select Sample Template, and then add the following
labelsto the spec.template.metadata section in the Template field (YAML format):labels: armsPilotAutoEnable: "on" armsPilotCreateAppName: "<your-deployment-name>" # Replace <your-deployment-name> with the actual application name. # armsSecAutoEnable: "on" # If you want to connect the application to Application Security, you must configure this parameter.
The armsPilotAutoEnable: "on" and armsPilotCreateAppName: "arms-k8s-demo" labels in the pod template of the Deployment enable ARMS application monitoring. The following YAML snippet shows where the labels are added in the pod template:
apiVersion: v1
kind: Namespace
metadata:
name: arms-demo
---
apiVersion: apps/v1 # for versions before 1.8.0 use apps/v1beta1
kind: Deployment
metadata:
name: arms-springboot-demo
namespace: arms-demo
labels:
app: arms-springboot-demo
spec:
replicas: 2
selector:
matchLabels:
app: arms-springboot-demo
template:
metadata:
labels:
app: arms-springboot-demo
armsPilotAutoEnable: "on"
armsPilotCreateAppName: "arms-k8s-demo"
spec:
containers:
- resources:
limits:
# ...
The following complete sample YAML file creates a Deployment and enables ARMS application monitoring:
apiVersion: v1
kind: Namespace
metadata:
name: arms-demo
---
apiVersion: apps/v1 # for versions before 1.8.0 use apps/v1beta1
kind: Deployment
metadata:
name: arms-springboot-demo
namespace: arms-demo
labels:
app: arms-springboot-demo
spec:
replicas: 2
selector:
matchLabels:
app: arms-springboot-demo
template:
metadata:
labels:
app: arms-springboot-demo
armsPilotAutoEnable: "on"
armsPilotCreateAppName: "arms-k8s-demo"
one-agent.jdk.version: "OpenJDK11"
spec:
containers:
- resources:
limits:
cpu: 0.5
image: registry.cn-hangzhou.aliyuncs.com/arms-docker-repo/arms-springboot-demo:v0.1
imagePullPolicy: Always
name: arms-springboot-demo
env:
- name: SELF_INVOKE_SWITCH
value: "true"
- name: COMPONENT_HOST
value: "arms-demo-component"
- name: COMPONENT_PORT
value: "6666"
- name: MYSQL_SERVICE_HOST
value: "arms-demo-mysql"
- name: MYSQL_SERVICE_PORT
value: "3306"
---
apiVersion: apps/v1 # for versions before 1.8.0 use apps/v1beta1
kind: Deployment
metadata:
name: arms-springboot-demo-subcomponent
namespace: arms-demo
labels:
app: arms-springboot-demo-subcomponent
spec:
replicas: 2
selector:
matchLabels:
app: arms-springboot-demo-subcomponent
template:
metadata:
labels:
app: arms-springboot-demo-subcomponent
armsPilotAutoEnable: "on"
armsPilotCreateAppName: "arms-k8s-demo-subcomponent"
one-agent.jdk.version: "OpenJDK11"
spec:
containers:
- resources:
limits:
cpu: 0.5
image: registry.cn-hangzhou.aliyuncs.com/arms-docker-repo/arms-springboot-demo:v0.1
imagePullPolicy: Always
name: arms-springboot-demo-subcomponent
env:
- name: SELF_INVOKE_SWITCH
value: "false"
- name: MYSQL_SERVICE_HOST
value: "arms-demo-mysql"
- name: MYSQL_SERVICE_PORT
value: "3306"
---
apiVersion: v1
kind: Service
metadata:
labels:
name: arms-demo-component
name: arms-demo-component
namespace: arms-demo
spec:
ports:
# the port that this service should serve on
- name: arms-demo-component-svc
port: 6666
targetPort: 8888
# label keys and values that must match in order to receive traffic for this service
selector:
app: arms-springboot-demo-subcomponent
---
apiVersion: apps/v1 # for versions before 1.8.0 use apps/v1beta1
kind: Deployment
metadata:
name: arms-demo-mysql
namespace: arms-demo
labels:
app: mysql
spec:
replicas: 1
selector:
matchLabels:
app: mysql
template:
metadata:
labels:
app: mysql
spec:
containers:
- resources:
limits:
cpu: 0.5
image: registry.cn-hangzhou.aliyuncs.com/arms-docker-repo/arms-demo-mysql:v0.1
name: mysql
ports:
- containerPort: 3306
name: mysql
---
apiVersion: v1
kind: Service
metadata:
labels:
name: mysql
name: arms-demo-mysql
namespace: arms-demo
spec:
ports:
# the port that this service should serve on
- name: arms-mysql-svc
port: 3306
targetPort: 3306
# label keys and values that must match in order to receive traffic for this service
selector:
app: mysql
---
For more information about application security, see Uygulama güvenliği nedir?
For more information about the billing of application security, see Faturalandırma.
After you complete the preceding steps, ARMS application monitoring is enabled for the application deployed in the ACK cluster.
Sonraki adımlar
To view application monitoring details, go to the Deployments page and find the application. In the Actions column, click the
icon and choose ARMS Console. For more information, see uygulama genel bakışı.
SSS
The following topics answer frequently asked questions about application monitoring: