Quantcast
Channel: StackExchange Replication Questions
Viewing all articles
Browse latest Browse all 17268

SQL server pull subscriber cannot get snapshot file via ftp

$
0
0

I am trying to create a transaction replication, using SQL Server 2012. The snapshot files are distributed by FTP. The publisher, distributor and FTP server are in the same PC. The publication was created successfully. I used the code below to create pull subscriber:

-----------------BEGIN: Script to be run at Publisher 'PUBLISHER\SQLINSTANCE'-----------------
use [PublicationDB]
exec sp_addsubscription @publication = N'ONEMORE', @subscriber = N'SUBSCRIBER-COMPUTER', @destination_db = N'SubscriberDB', @sync_type = N'Automatic', @subscription_type = N'pull', @update_mode = N'read only'
GO
-----------------END: Script to be run at Publisher 'PUBLISHER\SQLINSTANCE'-----------------

-----------------BEGIN: Script to be run at Subscriber 'SUBSCRIBER-COMPUTER'-----------------
use [SubscriberDB]
exec sp_addpullsubscription @publisher = N'PUBLISHER\SQLINSTANCE', @publication = N'ONEMORE', @publisher_db = N'PublicationDB', @independent_agent = N'True', @subscription_type = N'pull', @description = N'', @update_mode = N'read only', @immediate_sync = 1

exec sp_addpullsubscription_agent @publisher = N'PUBLISHER\SQLINSTANCE', @publisher_db = N'PublicationDB', @publication = N'ONEMORE', @distributor = N'PUBLISHER\SQLINSTANCE', @distributor_security_mode = 0, @distributor_login = N'sa', @distributor_password = 'password', @enabled_for_syncmgr = N'False', @frequency_type = 64, @frequency_interval = 0, @frequency_relative_interval = 0, @frequency_recurrence_factor = 0, @frequency_subday = 0, @frequency_subday_interval = 0, @active_start_time_of_day = 0, @active_end_time_of_day = 235959, @active_start_date = 20170404, @active_end_date = 99991231, @alt_snapshot_folder = N'', @working_directory = N'', @use_ftp = N'True', @job_login = N'SUBSCRIBER-COMPUTER\repl_distribution', @job_password = 'password', @publication_type = 0
GO
-----------------END: Script to be run at Subscriber 'SUBSCRIBER-COMPUTER'-----------------

I used the same code above to create 2 subscriber (change some necessary information such as subscriber, subscription database name,...), one (A) in the publisher PC, another (B) in the other PC. A works well, but B not work. The FTP log when B connect to FTP server is

2017-04-05 10:28:45 192.168.1.144 - 192.168.1.111 21 USER repli.tk|replication 331 0 0 660380f7-7d49-4a69-9a93-9cef378cfe89 -
2017-04-05 10:28:45 192.168.1.144 FTP-DOMAIN\ftpuser 192.168.1.111 21 PASS *** 230 0 0 660380f7-7d49-4a69-9a93-9cef378cfe89 /
2017-04-05 10:28:45 192.168.1.144 FTP-DOMAIN\ftpuser 192.168.1.111 21 CWD ftp 250 0 0 660380f7-7d49-4a69-9a93-9cef378cfe89 /ftp
2017-04-05 10:28:45 192.168.1.144 FTP-DOMAIN\ftpuser 192.168.1.111 21 TYPE I 200 0 0 660380f7-7d49-4a69-9a93-9cef378cfe89 -
2017-04-05 10:28:45 192.168.1.144 FTP-DOMAIN\ftpuser 192.168.1.111 21 PORT 192,168,1,144,199,190 200 0 0 660380f7-7d49-4a69-9a93-9cef378cfe89 -
2017-04-05 10:28:45 192.168.1.144 FTP-DOMAIN\ftpuser 192.168.1.111 21 SIZE SNAPSHOT_ROOT_FOLDER/20170405101333/snapshot_file.pre 213 0 0 660380f7-7d49-4a69-9a93-9cef378cfe89 /ftp/SNAPSHOT_ROOT_FOLDER/20170405101333/snapshot_file.pre
2017-04-05 10:29:06 192.168.1.144 FTP-DOMAIN\ftpuser 192.168.1.111 21 RETR SNAPSHOT_ROOT_FOLDER/20170405101333/snapshot_file.pre 550 4294967295 0 660380f7-7d49-4a69-9a93-9cef378cfe89 /ftp/SNAPSHOT_ROOT_FOLDER/20170405101333/snapshot_file.pre
2017-04-05 10:30:52 192.168.1.144 FTP-DOMAIN\ftpuser 192.168.1.111 21 ControlChannelClosed - - 64 0 660380f7-7d49-4a69-9a93-9cef378cfe89 -

As I know, B can connect to FTP server but cannot get the snapshot file (error 550 when try to get it). I have no ideal why FTP server not allow B getting the file. I googled whole two days, but cannot found solution!! My question is:

  1. Why does FTP server not allow B getting the file, although it already connected to the server?
  2. How can I fix it?

Thank all!


Viewing all articles
Browse latest Browse all 17268

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>