This topic provides answers to some common questions about installation of machine learning services in SQL Server. It also covers common questions about upgrades. Some problems occur only with upgrades from pre-release versions. Therefore, we recommend that you identify your version and edition first, and upgrade to the most current release or service release as soon as possible.
Applies to: SQL Server 2016 R Services, SQL Server 2017 Machine Learning Services (In-Database)
Performing Setup for the First Time
Follow the procedures for setting up [!INCLUDEssCurrent] and the R components as described here:
- Set up SQL Server R Services or Machine Learning Services In-Database
- Set up SQL Server 2017 with Python
- Create a Standalone R Server
After you have installed SQL Server, to use external R or Python scripts, you must perform some additional configuration steps. That is because the external script execution feature is not enabled by default, to reduce surface area.
Do not use setup instructions that were published prior to the public release of SQL Server 2016. The setup process changed completely between early releases and the official release version.
Requirements and Restrictions
Depending on the build of R Services you are installing, some of the following limitations might apply.
In early versions of SQL Server 2016 R Services, 8dot3 notation was required on the drive that contains the working directory. If you installed a pre-release version, upgrading to SQL Server 2016 Service Pack 1 should remove this requirement.
You cannot install R Services (In-Database) on a failover cluster.
On an Azure VM, some additional configuration might be necessary. For example, you might need to create a firewall exception to support remote access.
Side-by-side installation with another version of R, or with other releases from Revolution Analytics, is not supported.
New installation of any pre-release version of R Services (In-Database) is no longer supported. If you are using a pre-release version, upgrade as soon as possible.
Disable virus scanning before beginning setup. After setup is completed, we recommend suspending virus scanning on the folders used by SQL Server, preferably the entire tree.
Licensing agreements for unattended installs
If you use the command line to upgrade an instance of SQL Server, make sure that the command line includes the new license agreement parameter, /IACCEPTROPENLICENSEAGREEMENT. Failure to use the correct argument can cause setup to fail.
Offline installation of R components for localized version of SQL Server
When you install R Services on a computer that does not have Internet access, you must take two additional steps: you must download the R component installer to a local folder before you run SQL Server setup, and you must edit the installer file to ensure that the correct language is installed.
The language identifier used for the R components must be the same as the SQL Server setup language, or the Next button will be disabled and you cannot complete setup.
For more information, see Installing R Components without Internet Access.
To use machine learning with R or Python, some additional configuration is required after running SQL Server setup. Additional steps might be required depending on the security level of the server and of your SQL Server instance and databases. Review these steps from the setup instructions to determine if any additional configuration might be needed.
The feature that supports running external scripts, such as R or Python, is disabled by default for database security, and must be enabled.
Ensure that the worker accounts that are used by Launchpad to run R or Python have access to the instance. See [Enable implied authentication for Launchpad account group]
You might need to enable remote access on the server or create a firewall rule allowing inbound communication with SQL Server.
Depending on the planned workload, you might need to optimize the server for machine learning tasks.
Upgrades or Uninstallation
This section contains detailed instructions for specific upgrade scenarios.
Upgrades from prerelease version of SQL Server 2016 R Services are no longer supported. We recommend that you uninstall and then install a release version as soon as possible.
Support for slipstream upgrades
Slipstream setup refers to the ability to apply a patch or update to a failed instance installation, to repair existing problems. The advantage of this method is that the SQL Server is updated at the same time that you perform setup, avoiding a separate restart later.
If the server does not have Internet access, be sure to download the SQL Server installer. You must also separately download matching versions of the R component installers before beginning the update process.
For download locations, see Installing R Components without Internet Access.
When all setup files have been copied to a local directory, start the setup utility by typing SETUP.EXE from the command line.
Use the /UPDATESOURCE argument to specify the location of a local file containing the SQL Server update, such as a Cumulative Update or Service Pack release.
Use the /MRCACHEDIRECTORY argument to specify the folder containing the R component CAB files.
For more information, see this blog by the support team: Deploying R Services on Computers without Internet Access
Upgrading R components offline
If you install or upgrade servers that are not connected to the Internet, you must download an updated version of the R components manually before beginning the refresh. For more information, see Installing R Components without Internet Access.
Schedule for update of R components
As hotfixes or improvements to SQL Server 2016 are released, R components are upgraded or refreshed as well, if your instance already includes the R Services feature.
If you are using SQL Server 2017, upgrades to R components are automatically installed.
As of December 2016, it is also possible to upgrade R components on a faster cadence than the SQL Server release cycle, by binding an instance of R Services to the Modern Software Lifecycle policy. Currently support is provided only for upgrade of 2016 instances. However, when a new version of R Server is released, you will be able to upgraded 2017 instances as well.
For more information, see Use SqlBindR to Upgrade an Instance of SQL Server R Services
Upgrading from a pre-release version of SQL Server 2016
In general, in-place upgrades are not supported for any pre-release versions.
To install R Services successfully, you must uninstall any previous versions of R Services (In-Database) and its related R components, including SQL Server 2016 CTP3, CTP3.1, CTP3.2, RC0, or RC1.
Uninstalling of a pre-release version can be complex and require running a special script; we recommend that you contact technical support for assistance.
The following versions were installed with pre-release versions of SQL Server 2016.
If you have any doubt about which version you are using, run
@@VERSION from SQL Server Management Studio.
Problems with Setup of R Server (Standalone)
This section describes issues specific to installation of Microsoft R Server (Standalone) using SQL Server 2016 setup. For more general issues related to R Server upgrades, see the MSDN site for Microsoft R Server.
Failure to install localized versions
When performing an offline install of R Server, pre-release versions do not allow you to use localized languages.
Generally, when the server does not have Internet access, before running setup you must download all the installation packages for R Server, and then specify the location of the files during the installation.
However, if the language identifier associated with the installer package is not the same as the SQL Server setup language, when you reach the page for the R component install, the Next button is disabled and you cannot proceed with the installation. As a workaround, you can rename the package to use a matching identifier.
For example, the name of the installation packages might be
To install the 104 language on SQL Server, rename the file to
Installing R Services and R Server Standalone on the same computer
Generally, it is not recommended to install both R Services (In-Database) and R Server (Standalone) on the same computer. However, if the server has sufficient capacity, R Server Standalone might be useful as a development tool. You might also need to use the operationalization features of R Server and access SQL Server data from R Server without data movement.
Note that if you install both R Server and R Services on the same computer, two separate sets of the same R libraries are installed: one for use by the SQL server instance, and one for development use or use by R Server.
In earlier versions of SQL Server 2016, installing both R Server (Standalone) and R Services (In-Database) at the same time could cause setup to fail with an “access denied” message. This issue was fixed in Service Pack 1 for SQL Server 2016.
If you encountered this error, and need to upgrade these features, we recommend that you perform a slipstream install of SQL Server 2016 with SP1. There are two ways to resolve the issue, both of which require uninstall and reinstall.
Uninstall R Services (In-Database) and make sure the user accounts for SQLRUserGroup are removed.
Restart the server, and then reinstall R Server (Standalone).
Run SQL Server setup once more, and this time select Add Features to Existing SQL Server.
Choose the instance, and then select the R Services (In-Database) option to add.
In some cases, this procedure will fail to clear up the earlier failed installation. In that case, you should uninstall and reinstall as follows:
Uninstall R Services (In-Database) and R Server (Standalone) at the same time.
Remove the local user accounts (SQLRUserGroup).
Restart the server.
Run SQL Server setup and add the R Services (In-Database) feature only. Do not select R Server (Standalone).