当前位置:网站首页>Several common problems of SQL server synchronization database without public IP across network segments
Several common problems of SQL server synchronization database without public IP across network segments
2022-07-24 06:39:00 【Lin Feifan 1998】
Problem description
host 1: Publisher
Aliyun server -- There are public ip
host 2: Subscribers
The notebook -- No public network ip
Small amount of data , Mainly familiar with the operation process of publish and subscribe .
host 2 Just as a host 1 Local backup of , After you request to modify the data on the ECS , Can pass sql server The publish and subscribe function of will synchronize the local data .
There is no step-by-step introduction , Step by step , You can read the following
problem 1
Ali cloud, sql server After configuration , Can't use local sql server Client remote login .
Check the following
1. The firewall in alicloud's console , Open Alibaba cloud's 1433 port ( default sql server Access port )
That's important , There is no mention of !!!

2. We need to take the sql manager Medium sql server In service sql server Agent on ( It was originally disabled )

3. Remote server to open sql server User name password login method , And set up the proxy account and password

To this step , It should be in the notebook sql server adopt ip Address , And just set up the proxy account and password to log in to the ECS .
--------------------------------------------------------------------------------------
problem 2
Publish and subscribe process
First in the cloud sql server Client's
Copy --- Release --- New release
1. Choose which way to publish

In this regard, you can query the differences among the four publications
it is to be noted that : When the transaction is released , The published table should have a primary key
2. How to connect to the publisher

On the Internet, it is generally recommended to create a new user name in both the cloud and the local , The code is the same windows Account , Then here we choose windows Run under account .
I'm going to use sql server Login name
Note here --- The login name is sql server Login name of ( It's usually sa the )
-------------------------
That's the publisher
-------------------------
Subscribers
1. Use the alias

When choosing a publisher in this step , Use the actual server name ( Use windows The name of the login method ), Out of commission ip Address .
Here, add the publisher alias to the subscriber , See below for details
https://blog.csdn.net/u010457730/article/details/97276313
2. Push subscription or pull subscription

Here I have a question I don't understand , I'll talk about it later .
3. Connect to the distributor

Note here , To fill in the sql server Login name .
It's the login ,sa that
Login is not a server name , Remember this .
At this point , Check the synchronization status of subscribers

See if it's ticked ---- This means that the previous settings are correct , Subscribers can access the publisher .
I filled in the wrong user name at the beginning , When checking the synchronization status, an error is still reported .
--------------------------------------------------------------------------------
Next , Let's see if the subscriber's data is synchronized , If not synchronized , Look at the job history of the subscriber


Maybe it's still a mistake
But what is this misinformation ???
“ Replication agent is having problems . For more information , See previous job step history messages or Replication Monitor ”
Originally, we need to find the specific error information at the publisher ...

Start the Replication Monitor at the publisher
After selecting a specific release on the left , Double click the wrong subscription in all subscriptions on the right , View specific error reports

The truth --
Due to an operating system error 3, The process could not read the file D:\XXXX\X.pre
The reason is -- This path is where the snapshot file is stored at the publisher , But because it's not a network folder , Can't be visited .
Here's a simple solution
Follow this example
https://www.cnblogs.com/mrray/archive/2011/03/17/1987123.html
Directly put the snapshot folder of the publisher -- The name is repldata Copy of to a file location on the subscriber side
Modify the snapshot location at the subscriber side
Copy -- local subscription --- Specific subscriptions --- Right click --- attribute
Change the snapshot folder location to the local location .
It's amazing , It only needs to be modified once .

To this step , My problem is solved , Here are some questions and thoughts
1. Many holes , But look for more information , It can always be solved . This confidence is exercised in solving problems over and over again .
2. Lack of theoretical basis , Some configuration operations are prone to problems . For example, I don't know the specific mechanism of publish and subscribe , It's hard to think of the problem that the snapshot folder can't be accessed .
3. My situation is quite special , One has a public network ip, None of them . What I saw on the Internet , Usually it's a LAN , Or both hosts have a public network ip Of ( This means that the publisher , Subscribers can use only ip Address visit each other ). So I've always suspected that my network structure can't use publish and subscribe in principle ( Because the publisher can't “ find ” Subscribers ). This is also my choice to run the agent from the subscriber in the configuration , Because subscribers can definitely “ find ” There are public ip Of the publisher . This problem needs to be studied in detail .
4. These four releases - What's the difference in the way you subscribe ? What is the principle of snapshot folder ? These are two questions that need to be clarified .
5.sql server Why there are so many pits for this common function ... Maybe I'm too busy . But at least this problem is solved , I've grown a little bit .
边栏推荐
- File system and log analysis
- Leetcode does not add, subtract, multiply, divide, and calculate the number of 1 in binary
- RAID configuration experiment
- Crud of MySQL
- MySQL forgot to exit and close the window directly. How to delete the entire folder now
- RAID的配置实验
- Luckyframeweb testing platform (a full latitude free open source testing platform that supports interface automation, Web UI automation, APP automation, and distributed testing)
- 进程和计划任务管理
- Flink time stream processing
- [301] grotesque behavior - predictable irrationality
猜你喜欢

Luckyframeweb testing platform (a full latitude free open source testing platform that supports interface automation, Web UI automation, APP automation, and distributed testing)

PXE技术网络装机

这些坑你不掌握,你还真不敢用BigDecimal

Talk about browser cache again

Explain the event cycle mechanism and differences between browser and node in detail

Leetcode sword finger offer jz73 flip word sequence

Process and planned task management

Wasm vs EVM, Boca's choice predicts the future of the public chain

Sword finger offer jz10 Fibonacci sequence

Use of awk
随机推荐
FTP service and experiment
Windows下bat脚本备份MySQL数据库
Remember 20 classic interview questions of performance test in three minutes
Flink time stream processing
MySQL forgot to exit and close the window directly. How to delete the entire folder now
Go environment construction and start
LVM与磁盘配额
OpenSSL version upgrade
我有 7种 实现web实时消息推送的方案,7种!
Restful API introduction
Explain the event cycle mechanism and differences between browser and node in detail
进程和计划任务管理
CentOS operating system security reinforcement
自定义zabbix agent rpm包
Leetcode sword finger offer JZ9 dual stack implementation queue
Log collection and analysis platform
[226] instructions for Wireshark parameters
Animation effect
Modeling of XML
Install Apache manually