SQL Server on Red Hat Enterprise Linux

Source: Internet
Author: User
Tags curl microsoft sql server mssql free ssh management studio sql server management sql server management studio

This article starts from scratch and describes how to build SQL Server 2017 on Red Hat Enterprise Linux, including steps and methods for installing the system, installing SQL, etc. (for test learning only, basic article).

A Creating a Rhel System (create Red Hat Enterprise Linux System)

1. Prerequisite Preparation

Since this article focuses on the SQL Server 2017 build method on Linux, from install SQL Server on Linux, the current SQL Server CTP 2.1 for Red Hat Enterprise Linux only support 7 .3, so choose Rhel 7.3 for installation.

Because of the habit of building virtual machines on VMware ESXi Server, it is found in the VMware Compatibility Guide that the ESXi 5.1 U2 version above supports Rhel 7.x, so choose ESXi 6.0 to install red Hat Enterprise Linux 7.3.

2. Create a virtual machine

Create an empty virtual machine to install Rhel 7.3 Just as you would normally install virtual machines on VMware. Here are some things to note:

    • If you want to use SQL Server, memory at least 3.25GB or more;
    • If you want to use SQL Server, the file system must be XFS or EXT4, and others such as Btrfs are not supported.

Reference: Https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-setup.

3. Install red Hat Enterprise Linux 7.3

Official Installation Guide: http://partnerweb.vmware.com/GOSIG/RHEL_7.html.

The steps are as follows:

A) Edit the virtual machine settings (edit Settings ... ), add the Rhel installation ISO file to the CD/DVD drive, tick connect at power on to confirm the boot.

b) switch to the console window and select Install Red Hat Enterprise Linux 7.3.

c) There may be a black screen does not respond to the situation, re-close the vsphere client to open the Console window (or right-click on the virtual machine Open console), the following interface click Continue.

d) in the installation Summary page from top to bottom one by one (not described please according to your own needs or choose the default option). If you set date & time Click Done.

e) Note that the software selection can be set in the default basic environment, the general minimum installation, if you need special server installation special can. We develop tests that recommend the server with GUI, which comes with a graphical interface, and automatically includes the installation of open VMware tools by default.

f) for Kdump, can be disabled.

g) NETWORK & HOST NAME. For network recommendation settings, if there is a DHCP server in the environment, turn on the network, or manually set the static IP.

Note that setting the host name here is best not to exceed 15 characters, otherwise it may be possible to truncate the machine name if it is not supported, such as configuring SQL AG https://docs.microsoft.com/en-us/sql/linux/ Sql-server-linux-availability-group-configure-ha, you can also edit the/etc/hostname file changes after the installation is complete if you have already set the extra length.

h) SECURITY Policy select Default.

i) Click Begin installation to start the installation. Set the root account password and create a new account during the installation process.

Note If the password is a weak password, you need to click Done two times to save the success.

Create a new user and set up as an administrator

j) All set to wait for installation to complete.

k) Click Reboot. The CD/DVD drive ISO file can be ejected later.

Need to accept license. Click Finish configuration.

4. Optimized Rhel system operation

· Resolve an issue where the default source cannot be used without registration

Under normal circumstances, you need to purchase a subscription to use the RHEL system. Our own study for the purpose of studying, here is a way to test the use of Yum sources without registering: Replace the default yum for Red Hat Enterprise Linux with CentOS (CentOS and Rhel are basically no different, And CentOS is open source has been acquired by Rhel, this method can only be used for testing.

A) Enter Super User mode:

sudo su

b) View the installed Yum and uninstall the Yum and related packages for the original Rhel:

Rpm-qa | grep Yumrpm-qa | grep Yum | Xargs rpm-e--nodeps

c) Download the relevant CentOS software package:

wget Http://mirrors.163.com/centos/7.3.1611/os/x86_64/Packages/yum-3.4.3-150.el7.centos.noarch.rpmwget/HTTP Mirrors.163.com/centos/7.3.1611/os/x86_64/packages/yum-plugin-fastestmirror-1.1.31-40.el7.noarch.rpmwget http:/ /mirrors.163.com/centos/7.3.1611/os/x86_64/packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm

d) Install packages (some packages have dependencies, so it's best to install them together):

RPM-IVH *.rpm

e) Go to the Yum profile directory and download the CentOS config file, and finally change the $releasever to 7 (you can also manually edit the $releasever to change each of the 7):

Cd/etc/yum.repos.d/wget http://mirrors.163.com/.help/CentOS7-Base-163.reposed-i "s/\ $releasever/7/g" Centos7-base-163.repo

f) Empty and update the Yum cache:

Yum Clean Allyum Makecache

g) After the Yum has been replaced, you can install the Epel source by executing the following command:

sudo yum install epel-release

Note: Sometimes it is possible that a source server is not available, you need to manually replace or add a source, you can query the source status through this site: http://mirror-status.centos.org/#cn.

· Reminder of the removal of unregistered information (remove the information of registered to Red Hat Subscription Management)

If you do not have a system registered, you will often get the reminder "This system isn't registered to Red Hat Subscription Management. You can use the Subscription-manager to register ".

Execute the following command to remove the registration prompt:

A) View the subscription related packages that are already in the environment:

Yum List all | grep subscription

b) Remove the Subscription-manager package:

sudo yum remove Subscription-manager

· Troubleshooting issues with the RHEL system from Windows remote connection

Due to the frequent use of Windows, I now find two more convenient ways to connect the RHEL system from Windows remote operation. One is the use of the Xshell tool (free SSH client), you can directly use the SZ and RZ commands for the transfer between Windows and Linux system files. In addition, a VNC Server is built so that you can use VNC Client for remote connection operations on Windows, similar to Remote Desktop connections in Windows. The steps to build a VNC server on Rhel 7 are as follows:

A) Enter Super User mode:

sudo su

b) Install Gnome Desktop:

Yum Groupinstall "GNOME Desktop" "Graphical administration Tools"

c) Install Tigervnc server and X11 fonts:

Yum Install Tigervnc-server Xorg-x11-fonts-type1

d) Copy the configuration file and change the <USER> field to True USER Name:

Cp/lib/systemd/system/[email protected]/etc/systemd/system/[email protected]:5.servicevi/etc/systemd/system/[ Email Protected]:5.service

Before the change:

After the change:

e) Open firewall port:

Firewall-cmd--permanent--zone=public--add-port=5905/tcpfirewall-cmd--reload

f) Exit Super User mode, turn on VNC server and set the password:

Exitvncserver

g) Enter super User mode and reload daemon

sudo susystemctl daemon-reload

h) Turn on the service and set it to boot

Systemctl start [email protected]:5.servicesystemctl enable [email protected]:5.service

i) Connect using VNC Client, note that you need to add the port number 10.2.38.200:5 or 10.2.38.200:5905 that you set earlier.

Note:

    • The VNC client can be downloaded from here.
    • Reference Document: Https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide /ch-tigervnc.html#sec-vnc-installation.

Two Installing SQL Server (Install SQL Server)

1. Installing SQL Server

Official Installation Guide: Https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-setup-red-hat.

The installation steps are as follows:

A) go to Super User mode:

sudo su

b) Download the Microsoft SQL Server Red Hat repository configuration file:

Curl Https://packages.microsoft.com/config/rhel/7/mssql-server.repo >/etc/yum.repos.d/mssql-server.repo

c) Install SQL Server:

Yum Install-y mssql-server

d) Initialize the SQL Server configuration:

/opt/mssql/bin/mssql-conf Setup

e) Confirm the status of the SQL Server service:

Systemctl Status Mssql-server

f) Set up the firewall to open the SQL Server service port:

Firewall-cmd--zone=public--add-port=1433/tcp--permanentfirewall-cmd--reload

g) exit the Super Admin mode:

Exit

You can then use SQL Server Management Studio in Windows to connect to the database.

The default authentication method is SQL Server authentication, the default administrator user is the SA, and the password is the password that is set in the D step. From the view that the default path to the database is/var/opt/mssql/data/, this is the Linux path.

2. Installing SQL Server Tools

See the official installation documentation at: Https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-setup-tools#RHEL.

The specific installation mssql-tools steps are as follows:

A) go to Super User mode:

sudo su

b) Download the Microsoft SQL Server Red Hat repository configuration file:

Curl Https://packages.microsoft.com/config/rhel/7/prod.repo >/etc/yum.repos.d/msprod.repo

c) If Mssql-tools is installed, first uninstall the original UNIXODBC package:

Yum Updateyum Remove Unixodbc-utf16 unixodbc-utf16-devel

d) Install Mssql-tools

Yum Updateyum Install Mssql-tools unixodbc-devel

If you experience a situation that is not installed, it may be because the latest update package is incompatible with the current system or the latest update package is unstable, you can install the specified version (only for Rhel 7) by executing the following command:

accept_eula=y Yum Install msodbcsql-13.0.1.0-1 Mssql-tools-14.0.2.0-1yum install Unixodbc-utf16-devel

Other System version Resolution command reference: https://blogs.msdn.microsoft.com/sqlnativeclient/2016/10/20/odbc-driver-13-0-for-linux-released/ comment-page-2/.

e) To add the installation directory to the Bash Shell environment variable in order to facilitate the use of sqlcmd in the future:

echo ' Export path= ' $PATH:/opt/mssql-tools/bin "' >> ~/.bash_profileecho ' export path=" $PATH:/opt/mssql-tools/ Bin "' >> ~/.bashrcsource ~/.BASHRC

Note: Environment variables are user-level, and if the above command is executed under root, only the root user can use sqlcmd directly, and it is recommended that you execute it once and then exit after root.

f) The SQLCMD tool can be used after the installation is complete.

For the use of SQLCMD, refer to: https://docs.microsoft.com/en-us/sql/tools/sqlcmd-utility.

[Original articles, reproduced please indicate the source, for study purposes only, if there are errors please leave a message, thank you for your support]

[Original site: Http://www.cnblogs.com/lavender000/p/6875435.html, from the forever-smoked]

SQL Server on Red Hat Enterprise Linux

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.