hrms-manual/public/documents/chapter-3-superadmin-debug.md

22 KiB

การตรวจสอบและแก้ไขปัญหา

  1. เมื่อพบว่า server มีการตอบสนองช้าลง ซึ่งอาจจะเป็นได้จากการที่ RAM ของ Server ไม่พอ หรือมีการใช้งาน Memory ผิดปกติ สามารถเข้าไปตรวจสอบได้ที่ Grafana Dashboard
https://bma-dashboard.frappet.synology.me/d/fnX_0dPVk/docker-and-system-monitoring?orgId=1&refresh=5m
  1. เมื่อเข้ามาแล้วจะเจอหน้า dashboard ให้ไปดูในส่วนของ Memory Consume

รูปภาพที่ 1 - 1 dashboard

  1. เมื่อพบว่ามี container ตัวใดที่มีการใช้ memory มากผิดปกติ เราจะเข้าไปทำการ stop continer หรือทำการ restart Container ใหม่ โดย ssh เข้าไปที่เครื่อง server
ssh frappet@frappet.com
  1. ทำการใส่ password หลังจากนั้นระบบจะ ssh ไปที่เครื่อง server
  Processes:                        619
  Users logged in:                  0
  IPv4 address for br-0dd81f9616d2: 172.29.0.1
  IPv4 address for br-10daaad45f51: 172.24.0.1
  IPv4 address for br-17ffe0376048: 172.18.0.1
  IPv4 address for br-3d380c3389b3: 192.168.16.1
  IPv4 address for br-3f6401891fa7: 192.168.112.1
  IPv4 address for br-740c2421e277: 192.168.160.1
  IPv4 address for br-76113759e390: 172.22.0.1
  IPv4 address for br-78a07fc3256e: 172.28.0.1
  IPv4 address for br-8600ab24caeb: 192.168.128.1
  IPv4 address for br-a00fbbce01ad: 172.30.0.1
  IPv4 address for br-a5db1b42e4eb: 192.168.176.1
  IPv4 address for br-b52d32a1a1dc: 192.168.64.1
  IPv4 address for br-c2fb84774a1c: 172.26.0.1
  IPv4 address for br-c5fcf4a9ca46: 172.31.0.1
  IPv4 address for br-cae9831fbd37: 192.168.192.1
  IPv4 address for br-f433b0574747: 192.168.32.1
  IPv4 address for br-f634ce1ce094: 172.23.0.1
  IPv4 address for docker0:         172.17.0.1
  IPv4 address for ens160:          192.168.1.9
  IPv6 address for ens160:          2405:9800:b523:275e:20c:29ff:fec6:41e

  => / is using 89.9% of 97.87GB
  => There are 10 zombie processes.

 * Strictly confined Kubernetes makes edge and IoT secure. Learn how MicroK8s
   just raised the bar for easy, resilient and secure K8s cluster deployment.

   https://ubuntu.com/engage/secure-kubernetes-at-the-edge

 * Introducing Expanded Security Maintenance for Applications.
   Receive updates to over 25,000 software packages with your
   Ubuntu Pro subscription. Free for personal use.

     https://ubuntu.com/pro

Expanded Security Maintenance for Applications is not enabled.

77 updates can be applied immediately.
To see these additional updates run: apt list --upgradable

9 additional security updates can be applied with ESM Apps.
Learn more about enabling ESM Apps service at https://ubuntu.com/esm

New release '22.04.3 LTS' available.
Run 'do-release-upgrade' to upgrade to it.


Last login: Mon Dec 18 13:16:51 2023 from 1.47.195.64
frappet@dockerserver:~$
  1. ทำการ Change Directory ไปยัง folder ที่ติดตั้ง Docker
frappet@dockerserver:~$ cd docker
  1. หลังจากนั้นทำการลิสต์รายการ Container ที่ Run อยู่ เพื่อที่จะทำการ Stop หรือ Restart Container ที่ต้องการ โดยใช้คำสั่ง
frappet@dockerserver:~/docker$ docker ps
  1. ระบบจะแสดงรายชื่อ Container ที่ทำงานอยู่ขั้นมา ตามภาพ
CONTAINER ID   IMAGE                                                        COMMAND                  CREATED         STATUS                            PORTS                                                                                  NAMES
1b490cd596b3   docker.frappet.com/ehr/bma-ehr-discipline-service:latest     "dotnet BMA.EHR.Disc…"   3 hours ago     Up 3 hours                        443/tcp, 0.0.0.0:4034->80/tcp, :::4034->80/tcp                                         bma-ehr-discipline_bma-ehr-discipline_1
8e2136443c8f   docker.frappet.com/ehr/bma-ehr-user:latest                   "/usr/local/bin/entr…"   4 hours ago     Up 4 hours                        0.0.0.0:6022->80/tcp, :::6022->80/tcp                                                  bma-ehr-user_bma-ehr-user_1
88a201c6ed87   docker.frappet.com/ehr/bma-ehr-app:latest                    "/usr/local/bin/entr…"   4 hours ago     Up 4 hours                        0.0.0.0:6021->80/tcp, :::6021->80/tcp                                                  bma-ehr_bma-ehr-vue3_1
4b5c2dfc73dd   docker.frappet.com/ehr/bma-ehr-evaluation-service:latest     "docker-entrypoint.s…"   16 hours ago    Up 16 hours                       0.0.0.0:4036->13001/tcp, :::4036->13001/tcp                                            bma-ehr-evaluation_bma-ehr-evaluation_1
f2180d210ece   docker.frappet.com/ehr/bma-ehr-leave-service:latest          "dotnet BMA.EHR.Leav…"   28 hours ago    Up 28 hours                       443/tcp, 0.0.0.0:6031->80/tcp, :::6031->80/tcp                                         bma-ehr-leave_bma-ehr-leave_1
9bcae7358913   docker.frappet.com/ehr/bma-ehr-insignia-service:latest       "dotnet BMA.EHR.Insi…"   2 days ago      Up 3 hours                        443/tcp, 0.0.0.0:4031->80/tcp, :::4031->80/tcp                                         bma-ehr-insignia-bma-ehr-insignia-1
8216f092003e   docker.frappet.com/ehr/bma-ehr-retirement-service:latest     "dotnet BMA.EHR.Reti…"   2 days ago      Up 2 days                         443/tcp, 0.0.0.0:4030->80/tcp, :::4030->80/tcp                                         bma-ehr-retirement-bma-ehr-retirement-1
84e0af170318   docker.frappet.com/ehr/bma-ehr-placement-service:latest      "dotnet BMA.EHR.Plac…"   2 days ago      Up 2 days                         443/tcp, 0.0.0.0:4032->80/tcp, :::4032->80/tcp                                         bma-ehr-placement-bma-ehr-placement-1
abd638c4d347   docker.frappet.com/ehr/bma-ehr-faq:latest                    "/docker-entrypoint.…"   4 days ago      Up 2 days                         0.0.0.0:6025->80/tcp, :::6025->80/tcp                                                  bma-ehr-faq_bma-ehr-faq-vue3_1
4bcf444f2c90   docker.frappet.com/ehr/bma-ehr-profile-service:latest        "dotnet BMA-EHR-Prof…"   6 days ago      Up 2 days                         443/tcp, 0.0.0.0:4027->80/tcp, :::4027->80/tcp                                         bma-ehr-profile-bma-ehr-profile-1
2c824a54400b   docker.frappet.com/ehr/bma-ehr-checkin:latest                "/usr/local/bin/entr…"   6 days ago      Up 2 days                         0.0.0.0:6024->80/tcp, :::6024->80/tcp                                                  bma-ehr-checkin_bma-ehr-checkin_1
c48ec3e13ea5   ehr-report-api                                               "dotnet eHR-Report-A…"   10 days ago     Up 2 days                         0.0.0.0:4430->443/tcp, :::4430->443/tcp, 0.0.0.0:81->5000/tcp, :::81->5000/tcp         ehr-report-api
c9a970aff8a7   docker.frappet.com/ehr/bma-ehr-organization-service:latest   "dotnet BMA.EHR.Orga…"   13 days ago     Up 2 days                         443/tcp, 0.0.0.0:4026->80/tcp, :::4026->80/tcp                                         bma-ehr-organization-bma-ehr-organization-1
80403c502f6a   docker.frappet.com/ehr/bma-ehr-recruit-exam-service:latest   "dotnet BMA.EHR.Recu…"   4 weeks ago     Up 2 days                         443/tcp, 0.0.0.0:4069->80/tcp, :::4069->80/tcp                                         bma-ehr-test1-bma-ehr-recruit-exam-test1-1
99da356ddea5   docker.frappet.com/ehr/bma-ehr-recruit-exam-service:latest   "dotnet BMA.EHR.Recu…"   4 weeks ago     Up 2 days                         443/tcp, 0.0.0.0:4033->80/tcp, :::4033->80/tcp                                         bma-ehr-recruit-exam_bma-ehr-recruit-exam_1
0ab8947355b6   3ad12046bf7c                                                 "/usr/local/bin/entr…"   4 weeks ago     Up 2 days                         80/tcp                                                                                 bma-ehr-test1-bma-ehr-test1-1
324cae12b336   docker.frappet.com/ehr/bma-ehr-manual:latest                 "/usr/local/bin/entr…"   4 weeks ago     Up 2 days                         80/tcp                                                                                 bma-ehr-test1-bma-ehr-manual-test1-1
d3c8b0d3383e   534aac270233                                                 "/usr/local/bin/entr…"   4 weeks ago     Up 2 days                         80/tcp                                                                                 bma-ehr-test1-bma-ehr-user-test1-1
8ba1b37a622c   docker.frappet.com/ehr/bma-ehr-org-employee-service:latest   "dotnet BMA.EHR.Orga…"   4 weeks ago     Up 2 days                         80/tcp, 443/tcp                                                                        bma-ehr-test1-bma-ehr-org-employee-test1-1
bb3555945d22   277e0ebc1631                                                 "dotnet BMA.EHR.Reti…"   4 weeks ago     Up 2 days                         80/tcp, 443/tcp                                                                        bma-ehr-test1-bma-ehr-retirement-test1-1
f4abc9d3d421   docker.frappet.com/ehr/bma-ehr-report-service:latest         "dotnet BMA.EHR.Repo…"   4 weeks ago     Up 2 days                         80/tcp, 443/tcp                                                                        bma-ehr-test1-bma-ehr-report-test1-1
73ae0a27a829   4cbb48b42190                                                 "dotnet BMA.EHR.Insi…"   4 weeks ago     Up 2 days                         443/tcp, 0.0.0.0:5031->80/tcp, :::5031->80/tcp                                         bma-ehr-test1-bma-ehr-insignia-test1-1
f0e5346e71c5   d65b54269209                                                 "dotnet BMA-EHR-Prof…"   4 weeks ago     Up 2 days                         80/tcp, 443/tcp                                                                        bma-ehr-test1-bma-ehr-profile-test1-1
a629aad58606   mongo:4.2.0                                                  "docker-entrypoint.s…"   4 weeks ago     Up 2 days                         0.0.0.0:4062->27017/tcp, :::4062->27017/tcp                                            bma-ehr-test1-bma-mongodb-test1-1
3a23d61be33b   docker.frappet.com/ehr/bma-ehr-organization-service:latest   "dotnet BMA.EHR.Orga…"   4 weeks ago     Up 2 days                         80/tcp, 443/tcp                                                                        bma-ehr-test1-bma-ehr-organization-test1-1
4a6e110697a8   docker.frappet.com/demo/qualifying-exam-cms:latest           "docker-entrypoint.s…"   4 weeks ago     Up 2 days                         80/tcp                                                                                 bma-ehr-test1-bma-ehr-qualifying-exam-cms-test1-1
86e94db01203   docker.frappet.com/ehr/bma-ehr-node-service:version-1.0.7    "docker-entrypoint.s…"   4 weeks ago     Up 2 days                         8080/tcp                                                                               bma-ehr-test1-bma-ehr-probation-test1-1
e47ff4ea8266   docker.frappet.com/ehr/bma-ehr-report-v2-service:latest      "dotnet BMA.EHR.Repo…"   4 weeks ago     Up 2 days                         80/tcp, 443/tcp                                                                        bma-ehr-test1-bma-ehr-report-v2-test1-1
dd6c18083ebc   docker.frappet.com/ehr/bma-ehr-command-service:latest        "dotnet BMA.EHR.Comm…"   4 weeks ago     Up 2 days                         80/tcp, 443/tcp                                                                        bma-ehr-test1-bma-ehr-command-test1-1
b268b267da1d   mysql:8.0.17                                                 "docker-entrypoint.s…"   4 weeks ago     Up 20 hours                       33060/tcp, 0.0.0.0:4061->3306/tcp, :::4061->3306/tcp                                   bma-ehr-test1-bma-mysql-test1-1
856992fb6851   docker.frappet.com/ehr/bma-ehr-recruit-service:latest        "dotnet BMA.EHR.Recr…"   4 weeks ago     Up 2 days                         80/tcp, 443/tcp                                                                        bma-ehr-test1-bma-ehr-recruit-test1-1
35c36ed5b7c0   docker.frappet.com/ehr/bma-ehr-metadata-service:latest       "dotnet BMA.EHR.Meta…"   4 weeks ago     Up 2 days                         443/tcp, 0.0.0.0:4065->80/tcp, :::4065->80/tcp                                         bma-ehr-test1-bma-ehr-metadata-test1-1
23a6df9c1be5   7857451b76dc                                                 "dotnet BMA.EHR.Plac…"   4 weeks ago     Up 2 days                         80/tcp, 443/tcp                                                                        bma-ehr-test1-bma-ehr-placement-test1-1
ef3721d59245   docker.frappet.com/ehr/bma-ehr-recruit-exam:latest           "/usr/local/bin/entr…"   4 weeks ago     Up 2 days                         80/tcp                                                                                 bma-ehr-test1-bma-ehr-candidate-register-test1-1
1663ca346dde   docker.frappet.com/ehr/bma-ehr-manual:latest                 "/usr/local/bin/entr…"   4 weeks ago     Up 2 days                         0.0.0.0:6023->80/tcp, :::6023->80/tcp                                                  bma-ehr-manual_bma-ehr-manual_1
4415bd986a99   docker.frappet.com/ehr/bma-ehr-report-v2-service:latest      "dotnet BMA.EHR.Repo…"   5 weeks ago     Up 2 days                         443/tcp, 0.0.0.0:6029->80/tcp, :::6029->80/tcp                                         bma-ehr-report-v2_bma-ehr-report-v2_1
90c1c4d15b2e   docker.frappet.com/ehr/bma-ehr-recruit-exam:latest           "/usr/local/bin/entr…"   5 weeks ago     Up 2 days                         0.0.0.0:4021->80/tcp, :::4021->80/tcp                                                  bma-ehr-recruit-exam-vue3_bma-ehr-candidate-register_1
2658a45bca14   docker.frappet.com/ehr/bma-ehr-report-service:latest         "dotnet BMA.EHR.Repo…"   5 weeks ago     Up 2 days                         443/tcp, 0.0.0.0:5026->80/tcp, :::5026->80/tcp                                         bma-ehr-report_bma-ehr-report_1
aad53f02bf58   docker.frappet.com/ehr/bma-ehr-command-service:latest        "dotnet BMA.EHR.Comm…"   7 weeks ago     Up 2 days                         443/tcp, 0.0.0.0:6026->80/tcp, :::6026->80/tcp                                         bma-ehr-command_bma-ehr-command_1
fff43fecaacb   docker.frappet.com/ehr/bma-ehr-org-employee-service:latest   "dotnet BMA.EHR.Orga…"   2 months ago    Up 2 days                         80/tcp, 443/tcp                                                                        bma-ehr-org-employee_bma-ehr-org-employee_1
dd6d3d8bc546   docker.frappet.com/ehr/bma-ehr-node-service:version-1.0.7    "docker-entrypoint.s…"   2 months ago    Up 2 days                         8080/tcp                                                                               bma-ehr-probation-bma-ehr-probation-1
ccefc50482a6   docker.frappet.com/demo/qualifying-exam-cms:latest           "docker-entrypoint.s…"   2 months ago    Up 2 days                         0.0.0.0:4028->80/tcp, :::4028->80/tcp                                                  bma-ehr-qualifying-cms_qualifying-exam-cms_1
cc009e492421   docker.frappet.com/ehr/bma-ehr-recruit-service:latest        "dotnet BMA.EHR.Recr…"   2 months ago    Up 2 days                         80/tcp, 443/tcp                                                                        bma-ehr-recruit_bma-ehr-recruit_1
8b733df6a834   docker.frappet.com/demo/report-server:latest                 "docker-entrypoint.s…"   2 months ago    Up 2 days                         0.0.0.0:3090->80/tcp, :::3090->80/tcp                                                  report-server-report-server-1
864e845766ae   bd57ddd1e93d                                                 "dotnet SphereHealth…"   2 months ago    Restarting (139) 47 seconds ago                                                                                          spherehealth-prod-spherehealth-backend-prod-1
24745bd3cbde   d3b506a2d4b9                                                 "/usr/local/bin/entr…"   3 months ago    Up 2 days                         80/tcp                                                                                 spherehealth-prod-spherehealth-vue3-prod-1
acc0c1746f0f   docker.frappet.com/ehr/bma-ehr-metadata-service:latest       "dotnet BMA.EHR.Meta…"   3 months ago    Up 2 days                         443/tcp, 0.0.0.0:4025->80/tcp, :::4025->80/tcp                                         bma-ehr-metadata_bma-ehr-metadata_1
f5f05cc90d11   quay.io/keycloak/keycloak:20.0.3                             "/opt/keycloak/bin/k…"   4 months ago    Up 2 days                         8443/tcp, 0.0.0.0:9010->8080/tcp, :::9010->8080/tcp                                    keycloak-test
fee432384ea7   postgres:15.1-alpine                                         "docker-entrypoint.s…"   6 months ago    Up 2 days                         5432/tcp                                                                               keycloak-identity-postgres-1
3c3ac01091e6   loicsharma/baget:0b46f0ec87216e1dc6839277712ee07c1c2b611a    "dotnet BaGet.dll"       6 months ago    Up 2 days                         0.0.0.0:15556->80/tcp, :::15556->80/tcp                                                baget
40f054ece24f   prom/prometheus:latest                                       "/bin/prometheus --c…"   6 months ago    Up 2 days                         9090/tcp                                                                               bma-dashboard-bma-prometheus-1
e17adaf40f28   docker.frappet.com/demo/bma-dashboard:latest                 "/run.sh"                6 months ago    Up 2 days                         3000/tcp                                                                               bma-dashboard-bma-dashboard-1
8d2e117e4306   google/cadvisor:latest                                       "/usr/bin/cadvisor -…"   6 months ago    Up 2 days                         8080/tcp                                                                               monitoring_cadvisor
a288c7d7b10c   prom/node-exporter                                           "/bin/node_exporter"     6 months ago    Up 2 days                         9100/tcp                                                                               bma-dashboard-bma-prometheus-node-exporter-1
c4fea5e15f78   traefik:v2.10                                                "/entrypoint.sh trae…"   7 months ago    Up 2 days                         0.0.0.0:4020->80/tcp, :::4020->80/tcp                                                  bma-ehr-api-gw-bma-api-gw-1
9806b55da711   apache-php7                                                  "docker-php-entrypoi…"   7 months ago    Up 2 days                         0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp               webserver
e7808259eab3   tika-server                                                  "/bin/sh -c 'java -j…"   7 months ago    Up 2 days                         0.0.0.0:9998->9998/tcp, :::9998->9998/tcp                                              tikaserver
9af0aec7f9ba   mysql:8.0.17                                                 "docker-entrypoint.s…"   7 months ago    Up 2 days                         0.0.0.0:3306->3306/tcp, :::3306->3306/tcp, 33060/tcp                                   mysql
6859572c42b5   mongo:4.2.0                                                  "docker-entrypoint.s…"   7 months ago    Up 2 days                         0.0.0.0:27017->27017/tcp, :::27017->27017/tcp                                          mongo
afe584fe1269   mysql/mysql-server:8.0                                       "/entrypoint.sh --de…"   18 months ago   Up 2 days (healthy)               33060-33061/tcp, 0.0.0.0:3311->3306/tcp, :::3311->3306/tcp                             mysql8_mysql_1
c2333a34ef69   mariadb:10.7.3                                               "docker-entrypoint.s…"   21 months ago   Up 2 days                         0.0.0.0:3310->3306/tcp, :::3310->3306/tcp                                              mariadb_mysql_1
f5a0c9ae2498   phpmyadmin:latest                                            "/docker-entrypoint.…"   23 months ago   Up 2 days                         80/tcp                                                                                 docker-x64-test_app.phpmyadmin_1
c20d70716107   mysql/mysql-server:8.0.23                                    "/entrypoint.sh --de…"   23 months ago   Up 2 days (healthy)               33060-33061/tcp, 0.0.0.0:3308->3306/tcp, :::3308->3306/tcp                             docker-x64-test_app.mysql_1
b04141fe65d3   portainer/portainer-ce:latest                                "/portainer -H unix:…"   2 years ago     Up 2 days                         0.0.0.0:9004->8000/tcp, :::9004->8000/tcp, 0.0.0.0:9005->9000/tcp, :::9005->9000/tcp   portainer_portainer_1
eb37e5951258   portainer/portainer                                          "/portainer"             4 years ago     Up 2 days                         0.0.0.0:8000->8000/tcp, :::8000->8000/tcp, 0.0.0.0:9000->9000/tcp, :::9000->9000/tcp   Portainer
frappet@dockerserver:~/docker$
  1. ทำการ Stop Container ที่ต้องการ โดยใช้คำสั่ง
frappet@dockerserver:~/docker$ docker stop <<container_name>>
  1. หลังจากนั้นทำการ Start Container ที่ต้องการขึ้นมาอีกครั้ง โดยการใช้คำสั่ง
frappet@dockerserver:~/docker$ docker start <<container_name>>