SQL Server can also be in a different relationship: With rsync, you can easily transfer remote logs to the Windows platform. website file sync backup solution-cwRsyn

Source: Internet
Author: User
Tags rsync

Microsoft has a hobby of binding. One of the most annoying bindings is the binding between IIS and Windows-upgrading the IIS actually requires upgrading the operating system, the server is not a PC, and the system can be reinstalled without re-installing it.

When SQL Server logs were used for remote backup, Microsoft bound the policy again. Log transfer only supports Windows file sharing. The server used for remote backup is not in the same network as the master server and cannot use Windows file sharing. Evidence of Microsoft's binding policy:

The shared path \ dbserver \ LogBackup in is set on the log shipping master server. When the Backup Server transfers logs, you need to access this path, copy the log backup file and restore it.

During remote backup, the backup server and the master server are not in the same network and cannot access the log files to be transferred through this shared path.

How can this problem be solved?

If you use a Windows VPN architecture, you will be taken to the Microsoft binding policy.

We did not solve this problem with the method of moving flowers and trees.

Does the backup server need to access \ dbserver \ LogBackup? Then we share this path with another server (intermediate server) on the same network as the backup server. For the backup server, you only need to access \ dbserver \ LogBackup.

The shared path problem is solved, but the real purpose of the backup server's access to the shared path is to copy the log backup file. Therefore, the next question is how to synchronize the log backup files on the remote master server to this intermediate server?

What you might think of is FTP, which we thought at the beginning. However, FTP is a powerful tool for upload/download, but not for synchronization. The scenario here is that the intermediate server must be synchronized with the log backup file on the remote master server. For example, the remote master server will automatically delete the log backup file for more than a few days, the master server is deleted, and the intermediate server is also deleted automatically.

Later I thought of the file sync tool we are using-rsync (for usage, refer to the previous blog post: file sync backup solution for websites on the Windows platform-cwRsyn ), this is also a masterpiece of the Open Source world. Although it looks simple and ugly, it is so effective to solve the problem.

Rsync is used to solve the problem of SQL Server dating, and easily implement remote automatic log transmission.

Share the rsync command used:

Rsync-avz -- delete -- no-super rsync: // remote master server/logbackup/cygdrive/e/LogBackup

Thoughts after solving the problem

Before thinking about rsync, we plan to run the FTP service on the remote master server, and then download the log backup file from the remote master server by writing C # code to achieve synchronization. Even if this part of code is not complex to write, the total time from Project Creation to project release is much longer than the time to deploy rsync.

Therefore, it is not enough for programmers to write code to solve the problem. Real Programmers not only want to write code beautifully, but also want to solve the problem in a more clever way, even if they do not write a line of code, even if they do not solve the technical problem.

End this blog post with one sentence: If you treat solving problems as fun, you will be happy in your life.

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.