简体   繁体   English

哪个更可取? 尝试降级 Ubuntu 版本的 EC2 服务器或完全创建一个新实例?

[英]Which is more preferable? Try to downgrade Ubuntu version of an EC2 server or create a new instance altogether?

I have a dilemma, I am trying to set up the Microsoft slqsrv drivers for PHP and a laravel project so that it can connect to an RDS service and do my migrations, however, the Microsoft page dictates that the supported versions for the Ubuntu Server are 18, 20 and 21. The following snippet is the exact commands for an Ubuntu server from the official Microsoft page.我有一个难题,我正在尝试为 PHP 和一个 laravel 项目设置 Microsoft slqsrv 驱动程序,以便它可以连接到 RDS 服务并进行迁移,但是,Microsoft 页面指示 Ubuntu 服务器支持的版本是18、20 和 21。以下代码段是来自Microsoft 官方页面的 Ubuntu 服务器的确切命令。

if ! [[ "18.04 20.04 21.04" == *"$(lsb_release -rs)"* ]];
then
    echo "Ubuntu $(lsb_release -rs) is not currently supported.";
    exit;
fi

sudo su
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -

curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list > 
/etc/apt/sources.list.d/mssql-release.list

exit
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18
# optional: for bcp and sqlcmd
sudo ACCEPT_EULA=Y apt-get install -y mssql-tools18
echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc
source ~/.bashrc
# optional: for unixODBC development headers
sudo apt-get install -y unixodbc-dev

Trying to run the commands without the if statement installs "something" but it ends up with errors, moreover, the pdo_sqlsrv and sqlsrv extensions do show up in the extensions list of PHP, running the command "php -m" shows that they are indeed loaded, but if I try to run the migration it shows the alert that the OBDC driver is missing.尝试在没有 if 语句的情况下运行命令会安装“某些东西”,但最终会出现错误,此外,pdo_sqlsrv 和 sqlsrv 扩展确实出现在 PHP 的扩展列表中,运行命令“php -m”表明它们确实是已加载,但如果我尝试运行迁移,它会显示缺少 OBDC 驱动程序的警报。

What makes me think this is not working is that my EC2 instance has the Ubuntu 22 version, which would make sense since the drivers are not supported at the moment and are not installed properly.让我认为这不起作用的原因是我的 EC2 实例具有 Ubuntu 22 版本,这是有道理的,因为目前不支持驱动程序并且未正确安装。 The options I concluded are that either somehow downgrade my Ubuntu version from my EC2 server or create a new instance with a version that supports the sqlsrv drivers.我总结的选项是要么以某种方式从我的 EC2 服务器降级我的 Ubuntu 版本,要么创建一个版本支持 sqlsrv 驱动程序的新实例。 I don't know if there's a third option for the installation to work properly in this version, but I assume the previous two are the more sensible.我不知道在这个版本中是否有第三个选项可以让安装正常工作,但我认为前两个选项更明智。

My question is, is it possible or recommended to downgrade the Ubuntu version of the EC2 server?我的问题是,是否可以或建议降级 Ubuntu 版本的 EC2 服务器? or should I create a new instance with a compatible version?还是应该创建一个兼容版本的新实例?

One of the main benefits of the cloud is resource provisioning speed.云的主要优势之一是资源供应速度。

It takes seconds to create a new EC2 instance, it's much easier & quicker to just create a new instance with the Ubuntu 20.04 LTS or Ubuntu 18.04 LTS AMIs available.创建一个新的 EC2 实例需要几秒钟,使用可用的 Ubuntu 20.04 LTS 或 Ubuntu 18.04 LTS AMI 创建一个新实例会更容易和更快。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM