Ubuntu 上的 SQL Server 2019 CTP 2.1 在關機後失敗
我已經在我的 VirtualBox Ubuntu 16.04.5 LTS上安裝了**Microsoft SQL Server 2019 (CTP2.1) - 15.0.1100.94 (X64)。在我關閉機器電源之前,一切似乎都正常工作。此後 SQL Server 無法啟動。有趣的是,重新啟動不會影響 SQL Server 重新啟動的能力。
快速日誌:
x@xxx:~$ journalctl -u mssql-server.service -b
Nov 30 14:53:25 xxx systemd[1]: Started Microsoft SQL Server Database Engine. Nov 30 14:53:28 xxx sqlservr[1061]: /opt/mssql/bin/sqlservr: The file archive [/opt/mssql/lib/sqlservr.sfp] is invalid. Please resolve and try again. Nov 30 14:53:28 xxx systemd[1]: mssql-server.service: Main process exited, code=exited, status=1/FAILURE Nov 30 14:53:28 xxx systemd[1]: mssql-server.service: Unit entered failed state. Nov 30 14:53:28 xxx systemd[1]: mssql-server.service: Failed with result 'exit-code'. Nov 30 14:53:28 xxx systemd[1]: mssql-server.service: Service hold-off time over, scheduling restart. Nov 30 14:53:28 xxx systemd[1]: Stopped Microsoft SQL Server Database Engine.
檔案檔案$$ /opt/mssql/lib/sqlservr.sfp $$是無效的。請解決並重試。
很長的故事:
啟動失敗:
x@xxx:~$ systemctl status mssql-server ● mssql-server.service - Microsoft SQL Server Database Engine Loaded: loaded (/lib/systemd/system/mssql-server.service; enabled; vendor preset: enabled) Active: failed (Result: start-limit-hit) since Fri 2018-11-30 14:53:29 CET; 1min 44s ago Docs: https://docs.microsoft.com/en-us/sql/linux Process: 1234 ExecStart=/opt/mssql/bin/sqlservr (code=exited, status=1/FAILURE) Main PID: 1234 (code=exited, status=1/FAILURE) Nov 30 14:53:29 xxx systemd[1]: mssql-server.service: Unit entered failed state. Nov 30 14:53:29 xxx systemd[1]: mssql-server.service: Failed with result 'exit-code'. Nov 30 14:53:29 xxx systemd[1]: mssql-server.service: Service hold-off time over, scheduling restart. Nov 30 14:53:29 xxx systemd[1]: Stopped Microsoft SQL Server Database Engine. Nov 30 14:53:29 xxx systemd[1]: mssql-server.service: Start request repeated too quickly. Nov 30 14:53:29 xxx systemd[1]: Failed to start Microsoft SQL Server Database Engine. Nov 30 14:53:29 xxx systemd[1]: mssql-server.service: Unit entered failed state. Nov 30 14:53:29 xxx systemd[1]: mssql-server.service: Failed with result 'start-limit-hit'.
重裝修復問題:
x@xxx:~$ sudo apt-get install --reinstall mssql-server Reading package lists... Done Building dependency tree Reading state information... Done 0 to upgrade, 0 to newly install, 1 reinstalled, 0 to remove and 4 not to upgrade. Need to get 0 B/231 MB of archives. After this operation, 0 B of additional disk space will be used. Preconfiguring packages ... (Reading database ... 66231 files and directories currently installed.) Preparing to unpack .../mssql-server_15.0.1100.94-1_amd64.deb ... Unpacking mssql-server (15.0.1100.94-1) over (15.0.1100.94-1) ... Processing triggers for libc-bin (2.23-0ubuntu10) ... Processing triggers for man-db (2.7.5-1) ... Setting up mssql-server (15.0.1100.94-1) ... Processing triggers for libc-bin (2.23-0ubuntu10) ... x@xxx:~$ sudo systemctl status mssql-server ● mssql-server.service - Microsoft SQL Server Database Engine Loaded: loaded (/lib/systemd/system/mssql-server.service; enabled; vendor preset: enabled) Active: active (running) since Fri 2018-11-30 15:05:37 CET; 53s ago Docs: https://docs.microsoft.com/en-us/sql/linux Main PID: 1695 (sqlservr) Tasks: 124 Memory: 640.5M CPU: 10.188s CGroup: /system.slice/mssql-server.service ├─1695 /opt/mssql/bin/sqlservr └─1724 /opt/mssql/bin/sqlservr
將 fishy 文件複製到 ~ 目錄,重新啟動,沒有區別:
x@xxx:~$ sudo cp /opt/mssql/lib/sqlservr.sfp sqlservr.sfp x@xxx:~$ sudo reboot (...) // SSH session restart login as: x x@127.1.1.1's password: Welcome to Ubuntu 16.04.5 LTS (GNU/Linux 4.4.0-131-generic x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/advantage 9 packages can be updated. 7 updates are security updates. New release '18.04.1 LTS' available. Run 'do-release-upgrade' to upgrade to it. Last login: Fri Nov 30 14:53:32 2018 from 10.0.2.2 x@xxx:~$ diff /opt/mssql/lib/sqlservr.sfp sqlservr.sfp x@xxx:~$ sudo systemctl status mssql-server [sudo] password for x: ● mssql-server.service - Microsoft SQL Server Database Engine Loaded: loaded (/lib/systemd/system/mssql-server.service; enabled; vendor preset: enabled) Active: active (running) since Fri 2018-11-30 15:38:07 CET; 1min 10s ago Docs: https://docs.microsoft.com/en-us/sql/linux Main PID: 1060 (sqlservr) Tasks: 127 Memory: 1.7G CPU: 10.386s CGroup: /system.slice/mssql-server.service ├─1060 /opt/mssql/bin/sqlservr └─1235 /opt/mssql/bin/sqlservr
斷電,SQL Server啟動失敗,區別:
x@xxx:~$ sudo poweroff (...) // SSH session restart [sudo] password for x: login as: x x@127.1.1.1's password: Welcome to Ubuntu 16.04.5 LTS (GNU/Linux 4.4.0-131-generic x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/advantage 9 packages can be updated. 7 updates are security updates. New release '18.04.1 LTS' available. Run 'do-release-upgrade' to upgrade to it. Last login: Fri Nov 30 15:38:55 2018 from 10.0.2.2 x@xxx:~$ sudo systemctl status mssql-server [sudo] password for x: ● mssql-server.service - Microsoft SQL Server Database Engine Loaded: loaded (/lib/systemd/system/mssql-server.service; enabled; vendor preset: enabled) Active: failed (Result: start-limit-hit) since Fri 2018-11-30 16:12:49 CET; 27s ago Docs: https://docs.microsoft.com/en-us/sql/linux Process: 1240 ExecStart=/opt/mssql/bin/sqlservr (code=exited, status=1/FAILURE) Main PID: 1240 (code=exited, status=1/FAILURE) Nov 30 16:12:49 xxx systemd[1]: mssql-server.service: Unit entered failed state. Nov 30 16:12:49 xxx systemd[1]: mssql-server.service: Failed with result 'exit-code'. Nov 30 16:12:49 xxx systemd[1]: mssql-server.service: Service hold-off time over, scheduling restart. Nov 30 16:12:49 xxx systemd[1]: Stopped Microsoft SQL Server Database Engine. Nov 30 16:12:49 xxx systemd[1]: mssql-server.service: Start request repeated too quickly. Nov 30 16:12:49 xxx systemd[1]: Failed to start Microsoft SQL Server Database Engine. Nov 30 16:12:49 xxx systemd[1]: mssql-server.service: Unit entered failed state. Nov 30 16:12:49 xxx systemd[1]: mssql-server.service: Failed with result 'start-limit-hit'. x@xxx:~$ diff /opt/mssql/lib/sqlservr.sfp sqlservr.sfp Binary files /opt/mssql/lib/sqlservr.sfp and sqlservr.sfp differ
有人可以解釋這種情況並建議如何解決嗎?
SQL Server 安裝的 sqlservr.sfp 和其他 .sfp 文件是文件歸檔文件(如 tar.qz 或 .zip),其中包含在 SQL 平台抽象層(SQL朋友)。當 sqlservr 通過直接執行 sqlservr 或通過啟動 mssql-server 服務啟動時,sqlservr 程序會查找這些 .sfp 文件的存在並嘗試將它們載入到 SQL PAL 中。作為一種安全措施,sqlservr 根據允許的 .sfps 列表檢查這些 .sfp 文件。如果 .sfp 不是可辨識的 .sfp 文件之一,則不會載入它。sqlservr.sfp 是執行實際 SQL Server 引擎的主要 .sfp。由於某種原因,這種情況下的 .sfp 文件檢查失敗。也許您的作業系統上有一些程序正在檢查和修改文件或文件屬性,例如病毒掃描程序或磁碟清理程序。這可能就是為什麼它在您重新啟動之前一直有效,然後如果您重新安裝它再次有效。我建議在重新啟動後檢查原始文件和文件的校驗和。看起來根據您的差異,文件是不同的。希望這至少可以更好地解釋正在發生的事情。
這很簡單。包已損壞。不多也不少。微軟必須修復這個包。他們還沒有這樣做。我將使用它將 CentOS 遷移到 Oracle Linux 8。我將嘗試 SQL Server 19。這僅表明 Linux 上的 SQL Server 尚未準備好迎接黃金時間。可能是使用者太少,MS沒有緊迫感?