查看 SAP Kyma 上一個 pod 的運行日誌

kubectl get pod -n dev 獲取 pod id: mssql-74787d5b48-lr877

然後查看日誌:kubectl logs mssql-74787d5b48-lr877 -n dev

全是和 MSSQL 數據庫服務器相關的運行日誌:

2021-06-10 03:15:51.83 Server Setup step is copying system data file 'C:\templatedata\master.mdf' to '/var/opt/mssql/data/master.mdf'.

2021-06-10 03:15:51.96 Server Did not find an existing master data file /var/opt/mssql/data/master.mdf, copying the missing default master and other system database files. If you have moved the database location, but not moved the database files, startup may fail. To repair: shutdown SQL Server, move the master database to configured location, and restart.

2021-06-10 03:15:51.96 Server Setup step is copying system data file 'C:\templatedata\mastlog.ldf' to '/var/opt/mssql/data/mastlog.ldf'.

2021-06-10 03:15:51.97 Server Setup step is copying system data file 'C:\templatedata\model.mdf' to '/var/opt/mssql/data/model.mdf'.

2021-06-10 03:15:51.99 Server Setup step is copying system data file 'C:\templatedata\modellog.ldf' to '/var/opt/mssql/data/modellog.ldf'.

2021-06-10 03:15:52.01 Server Setup step is copying system data file 'C:\templatedata\msdbdata.mdf' to '/var/opt/mssql/data/msdbdata.mdf'.

2021-06-10 03:15:52.05 Server Setup step is copying system data file 'C:\templatedata\msdblog.ldf' to '/var/opt/mssql/data/msdblog.ldf'.

2021-06-10 03:15:52.30 Server Microsoft SQL Server 2017 (RTM-CU13) (KB4466404) - 14.0.3048.4 (X64)

Nov 30 2018 12:57:58 

Copyright (C) 2017 Microsoft Corporation

Developer Edition (64-bit) on Linux (Ubuntu 16.04.5 LTS)

2021-06-10 03:15:52.30 Server UTC adjustment: 0:00

2021-06-10 03:15:52.30 Server (c) Microsoft Corporation.

2021-06-10 03:15:52.30 Server All rights reserved.

2021-06-10 03:15:52.30 Server Server process ID is 4124.

2021-06-10 03:15:52.30 Server Logging SQL Server messages in file '/var/opt/mssql/log/errorlog'.

2021-06-10 03:15:52.30 Server Registry startup parameters:

 -d /var/opt/mssql/data/master.mdf

 -l /var/opt/mssql/data/mastlog.ldf

 -e /var/opt/mssql/log/errorlog

2021-06-10 03:15:52.31 Server SQL Server detected 1 sockets with 2 cores per socket and 4 logical processors per socket, 4 total logical processors; using 4 logical processors based on SQL Server licensing. This is an informational message; no user action is required.

2021-06-10 03:15:52.32 Server SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.

2021-06-10 03:15:52.32 Server Detected 12815 MB of RAM. This is an informational message; no user action is required.

2021-06-10 03:15:52.32 Server Using conventional memory in the memory manager.

2021-06-10 03:15:52.36 Server Large Page Allocated: 32MB

2021-06-10 03:15:52.40 Server Machine supports memory error recovery. SQL memory protection is enabled to recover from memory corruption.

2021-06-10 03:15:52.70 Server Buffer pool extension is already disabled. No action is necessary.

2021-06-10 03:15:52.91 Server InitializeExternalUserGroupSid failed. Implied authentication will be disabled.

2021-06-10 03:15:52.92 Server Implied authentication manager initialization failed. Implied authentication will be disabled.

2021-06-10 03:15:52.92 Server Successfully initialized the TLS configuration. Allowed TLS protocol versions are ['1.0 1.1 1.2']. Allowed TLS ciphers are ['ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:!DHE-RSA-AES256-GCM-SHA384:!DHE-RSA-AES128-GCM-SHA256:!DHE-RSA-AES256-SHA:!DHE-RSA-AES128-SHA'].

2021-06-10 03:15:53.02 Server Node configuration: node 0: CPU mask: 0x000000000000000f:0 Active CPU mask: 0x000000000000000f:0. This message provides a description of the NUMA configuration for this computer. This is an informational message only. No user action is required.

2021-06-10 03:15:53.03 Server The maximum number of dedicated administrator connections for this instance is '1'

2021-06-10 03:15:53.07 Server Using dynamic lock allocation. Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node. This is an informational message only. No user action is required.

2021-06-10 03:15:53.08 Server In-Memory OLTP initialized on lowend machine.

2021-06-10 03:15:53.29 Server Database Instant File Initialization: enabled. For security and performance considerations see the topic 'Database Instant File Initialization' in SQL Server Books Online. This is an informational message only. No user action is required.

ForceFlush is enabled for this instance.
2021-06-10 03:15:53.30 Server Query Store settings initialized with enabled = 1,

2021-06-10 03:15:53.31 spid5s Starting up database 'master'.

2021-06-10 03:15:53.31 Server Software Usage Metrics is disabled.

ForceFlush feature is enabled for log durability.
2021-06-10 03:15:54.33 spid5s The tail of the log for database master is being rewritten to match the new sector size of 4096 bytes. 3072 bytes at offset 418816 in file /var/opt/mssql/data/mastlog.ldf will be written.

2021-06-10 03:15:54.89 spid5s Converting database 'master' from version 862 to the current version 869.

2021-06-10 03:15:54.90 spid5s Database 'master' running the upgrade step from version 862 to version 863.

2021-06-10 03:15:55.21 spid5s Database 'master' running the upgrade step from version 863 to version 864.

2021-06-10 03:15:55.52 spid5s Database 'master' running the upgrade step from version 864 to version 865.

2021-06-10 03:15:55.59 spid5s Database 'master' running the upgrade step from version 865 to version 866.

2021-06-10 03:15:55.74 spid5s Database 'master' running the upgrade step from version 866 to version 867.

2021-06-10 03:15:55.87 spid5s Database 'master' running the upgrade step from version 867 to version 868.

2021-06-10 03:15:56.05 spid5s Database 'master' running the upgrade step from version 868 to version 869.

2021-06-10 03:15:56.79 spid5s Resource governor reconfiguration succeeded.

2021-06-10 03:15:56.80 spid5s SQL Server Audit is starting the audits. This is an informational message. No user action is required.

2021-06-10 03:15:56.80 spid5s SQL Server Audit has started the audits. This is an informational message. No user action is required.

2021-06-10 03:15:56.94 spid5s SQL Trace ID 1 was started by login "sa".

2021-06-10 03:15:56.99 spid20s Password policy update was successful.

2021-06-10 03:15:57.02 spid5s Server name is 'mssql-74787d5b4'. This is an informational message only. No user action is required.

2021-06-10 03:15:57.04 spid22s Always On: The availability replica manager is starting. This is an informational message only. No user action is required.

2021-06-10 03:15:57.04 spid22s Always On: The availability replica manager is waiting for the instance of SQL Server to allow client connections. This is an informational message only. No user action is required.

2021-06-10 03:15:57.05 spid5s Starting up database 'msdb'.

2021-06-10 03:15:57.05 spid9s Starting up database 'mssqlsystemresource'.

2021-06-10 03:15:57.06 spid9s The resource database build version is 14.00.3048. This is an informational message only. No user action is required.

2021-06-10 03:15:57.09 spid9s Starting up database 'model'.

2021-06-10 03:15:57.52 spid5s The tail of the log for database msdb is being rewritten to match the new sector size of 4096 bytes. 512 bytes at offset 306688 in file /var/opt/mssql/data/MSDBLog.ldf will be written.

2021-06-10 03:15:57.54 spid9s The tail of the log for database model is being rewritten to match the new sector size of 4096 bytes. 2048 bytes at offset 75776 in file /var/opt/mssql/data/modellog.ldf will be written.

2021-06-10 03:15:57.58 spid20s A self-generated certificate was successfully loaded for encryption.

2021-06-10 03:15:57.59 spid20s Server is listening on [ 'any' <ipv4> 1433].

2021-06-10 03:15:57.59 Server Server is listening on [ 127.0.0.1 <ipv4> 1434].

2021-06-10 03:15:57.59 Server Dedicated admin connection support was established for listening locally on port 1434.

2021-06-10 03:15:57.61 spid20s SQL Server is now ready for client connections. This is an informational message; no user action is required.

2021-06-10 03:15:57.62 spid9s Converting database 'model' from version 862 to the current version 869.

2021-06-10 03:15:57.63 spid9s Database 'model' running the upgrade step from version 862 to version 863.

2021-06-10 03:15:57.64 spid5s Converting database 'msdb' from version 862 to the current version 869.

2021-06-10 03:15:57.64 spid5s Database 'msdb' running the upgrade step from version 862 to version 863.

2021-06-10 03:15:57.70 spid9s Database 'model' running the upgrade step from version 863 to version 864.

2021-06-10 03:15:57.76 spid9s Database 'model' running the upgrade step from version 864 to version 865.

2021-06-10 03:15:57.77 spid5s Database 'msdb' running the upgrade step from version 863 to version 864.

2021-06-10 03:15:57.80 spid9s Database 'model' running the upgrade step from version 865 to version 866.

2021-06-10 03:15:57.84 spid5s Database 'msdb' running the upgrade step from version 864 to version 865.

2021-06-10 03:15:57.85 spid9s Database 'model' running the upgrade step from version 866 to version 867.

2021-06-10 03:15:57.90 spid5s Database 'msdb' running the upgrade step from version 865 to version 866.

2021-06-10 03:15:57.91 spid9s Database 'model' running the upgrade step from version 867 to version 868.

2021-06-10 03:15:57.94 spid5s Database 'msdb' running the upgrade step from version 866 to version 867.

2021-06-10 03:15:57.98 spid5s Database 'msdb' running the upgrade step from version 867 to version 868.

2021-06-10 03:15:57.99 spid9s Database 'model' running the upgrade step from version 868 to version 869.

2021-06-10 03:15:58.04 spid5s Database 'msdb' running the upgrade step from version 868 to version 869.

2021-06-10 03:15:58.21 spid9s Polybase feature disabled.

2021-06-10 03:15:58.22 spid9s Clearing tempdb database.

2021-06-10 03:15:59.50 spid9s Starting up database 'tempdb'.

2021-06-10 03:16:00.24 spid9s The tempdb database has 1 data file(s).

2021-06-10 03:16:00.26 spid22s The Service Broker endpoint is in disabled or stopped state.

2021-06-10 03:16:00.26 spid22s The Database Mirroring endpoint is in disabled or stopped state.

2021-06-10 03:16:00.34 spid22s Service Broker manager has started.

2021-06-10 03:16:00.58 spid5s Recovery is complete. This is an informational message only. No user action is required.

2021-06-10 03:16:00.61 spid16s The default language (LCID 0) has been set for engine and full-text services.

2021-06-10 03:16:49.26 spid51 Starting up database 'DemoDB'.

2021-06-10 03:16:49.70 spid51 Parallel redo is started for database 'DemoDB' with worker pool size [2].

2021-06-10 03:16:50.04 spid51 Parallel redo is shutdown for database 'DemoDB' with worker pool size [2].

Changed database context to 'DemoDB'.

(1 rows affected)

(1 rows affected)
2021-06-10 03:20:56.96 spid51 Using 'dbghelp.dll' version '4.0.5'

2021-06-10 03:21:03.12 spid51 Attempting to load library 'xplog70.dll' into memory. This is an informational message only. No user action is required.

2021-06-10 03:21:03.21 spid51 Using 'xplog70.dll' version '2017.140.3048' to execute extended stored procedure 'xp_msver'. This is an informational message only; no user action is required.

找到該 pod 內部有一個 id 爲 mssql 的 docker container:

使用如下命令進入該容器內部:

kubectl exec -it mssql-74787d5b48-lr877 -n dev -c mssql -- bash

看到 root@mssql-<pod name> 的提示符,說明已經進入該容器內部了。

也能通過手動查看日誌文件的方式達到同樣的目的。

更多Jerry的原創文章,盡在:"汪子熙":


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章