Showing posts with label distributor. Show all posts
Showing posts with label distributor. Show all posts

Saturday, February 25, 2012

process could not connect to Distributor

Sql Server SP4 on the publisher/distributer.
MSDE SP4 on the subscriber
Merge Replication
Anonymous Pull Subscriptions
TCP/IP only - removed Named Pipes
Windows Authent only - removed SQL Server
Setup an alias on the subscriber to the publisher.
Running on same network but different workgroups. Can not use Windows
Authentication as moving to Internet model.
Followed
http://support.microsoft.com/default...&Product=sql2k
So I setup the publisher to use an SA user and gave that SA user ownership
and admin rights to the publisher database.
I keep getting this error from the ActiveX component in VB.NET on the
subscriber: The process could not connect to Distributor 'W2KSERVER'.
SQL Server does not exist or access denied.
I had these guys working when it was SP3a, still had named pipes, and using
Windows Authentication passthrough.
Thanks,
Buzz
configure distributornetwork for tcpip, use the fqdn for the
distributoraddress (ie sqlserver.mydomainname.com).
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Buzz" <buzz@.online.nospam> wrote in message
news:EC950BD0-5245-47EB-8320-06D6633633BA@.microsoft.com...
> Sql Server SP4 on the publisher/distributer.
> MSDE SP4 on the subscriber
> Merge Replication
> Anonymous Pull Subscriptions
> TCP/IP only - removed Named Pipes
> Windows Authent only - removed SQL Server
> Setup an alias on the subscriber to the publisher.
> Running on same network but different workgroups. Can not use Windows
> Authentication as moving to Internet model.
> Followed
>
http://support.microsoft.com/default...&Product=sql2k
> So I setup the publisher to use an SA user and gave that SA user ownership
> and admin rights to the publisher database.
> I keep getting this error from the ActiveX component in VB.NET on the
> subscriber: The process could not connect to Distributor 'W2KSERVER'.
> SQL Server does not exist or access denied.
> I had these guys working when it was SP3a, still had named pipes, and
using
> Windows Authentication passthrough.
> Thanks,
> Buzz
>
>
|||Hello,
Name resolution must be working between all machines involved in
replication. Otherwise, you may receive the error message.
I suggest that you perform the following steps to narrow down the issue:
* Drop the subcription and then drop the publication.
* Setup name resolution both ways between the machines. There are several
options for achieving name resolution. You can use CNU aliases
(cliconfg.exe), hosts files, WINS, and/or DNS.
* On the publisher reregister in publisher and subscriber in Enterprise
Manager by netbios name instead of by IP address.
* On the remote server, register the publisher and the subscriber in
Enterprise Manager by netbios name (@.@.servername).
* Recreate the publication and then recreate the subscription.
* Run the Merge agent. Check the issue.
The following information is for your reference:
Potential causes of the "SQL Server does not exist or access denied" error
message
http://support.microsoft.com/?id=328306
324992 How to use replication with SQL Server 2000 Desktop Engine (MSDE
2000)
http://support.microsoft.com/?id=324992
I hope the information is helpful.
Sophie Guo
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
================================================== ===
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ===
This posting is provided "AS IS" with no warranties, and confers no rights.
|||All that and it turns out it was a software firewall issue with XP on the
subscriber laptop.
However, now I am stuck with the next issue. Part of replicating over
untrusted domains or the internet means I need to use FTP. On the subscribers
I use the ActiveX merge module.
I specify the FTP address:
_merge.FileTransferType = FILE_TRANSFER_TYPE.FILETRANSFERFTP
If Me.txtFtpAddress.Text.StartsWith("ftp://") = False Then
Me.txtFtpAddress.Text = "ftp://" & Me.txtFtpAddress.Text
End If
Me.txtFtpAddress.Text = Me.txtFtpAddress.Text.Replace("\", "/")
_merge.FTPAddress = Me.txtFtpAddress.Text
But it keeps erroring out saying it cannot find the FTP location specified
at the value I have for _merge.Publisher?
The value for the Ftp is ftp://192.168.1.2/repldata.
The value for the Publisher is server909.
I put an LMHOSTS entry to route the 192.168.1.2 to server909 it works.
But I'm not going to be doing LMHOSTS management on 500+ production laptops
and we plan on using different FTP servers that are different than the SQL
Server.
"Sophie Guo [MSFT]" wrote:

> Hello,
> Name resolution must be working between all machines involved in
> replication. Otherwise, you may receive the error message.
> I suggest that you perform the following steps to narrow down the issue:
> * Drop the subcription and then drop the publication.
> * Setup name resolution both ways between the machines. There are several
> options for achieving name resolution. You can use CNU aliases
> (cliconfg.exe), hosts files, WINS, and/or DNS.
> * On the publisher reregister in publisher and subscriber in Enterprise
> Manager by netbios name instead of by IP address.
> * On the remote server, register the publisher and the subscriber in
> Enterprise Manager by netbios name (@.@.servername).
> * Recreate the publication and then recreate the subscription.
> * Run the Merge agent. Check the issue.
> The following information is for your reference:
> Potential causes of the "SQL Server does not exist or access denied" error
> message
> http://support.microsoft.com/?id=328306
> 324992 How to use replication with SQL Server 2000 Desktop Engine (MSDE
> 2000)
> http://support.microsoft.com/?id=324992
> I hope the information is helpful.
> Sophie Guo
> Microsoft Online Partner Support
> Get Secure! - www.microsoft.com/security
> ================================================== ===
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ================================================== ===
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
|||Not sure if the following will help, but let me try to clarify a few things:
1) Ftp support in SQL replication applies only to transfer of snapshot
files, movement of SQL changes would require a regular connection to SQL
server (Publisher and Distributor).
2) The Ftp* properties on the Merge\Distribution ActiveX control have
actually been deprecated in SQL2000, configuration of FTP snapshot support is
done at the publication level (right-click publication for properties). Once
that is confiigured, you will need to regenerate a new snapshot for the
settings to take effect. And when you start the merge control, all you need
to do is to specify a FileTransferType of FTP. In hind-sight, it was probably
a mistake not to take out the FTP* properties completely.
3) There is still the all important task of getting the merge activeX
control to establish a regular connection to SQL Server from an untrusted
domain in the first place. This typically means that either 1) to expose
whatever port that the distributor and publisher are listening on (default
SQL Server port is 1433) to the outside world (or accessible from the
laptops) and then use the Distributor|PublisherNetwork|Address properties to
point to the exposed IP address\port configuration, or 2) (recommended) to
configure VPN between the laptops and the Publisher\Distributor machines so
regular SQL Server connections can be established. If you decide to use the
VPN approach, there really is no need to configure FTP for the snapshot files
as regular UNC shares should be accessible by the laptops.
HTH
-Raymond
"Buzz" wrote:
[vbcol=seagreen]
> All that and it turns out it was a software firewall issue with XP on the
> subscriber laptop.
> However, now I am stuck with the next issue. Part of replicating over
> untrusted domains or the internet means I need to use FTP. On the subscribers
> I use the ActiveX merge module.
> I specify the FTP address:
> _merge.FileTransferType = FILE_TRANSFER_TYPE.FILETRANSFERFTP
> If Me.txtFtpAddress.Text.StartsWith("ftp://") = False Then
> Me.txtFtpAddress.Text = "ftp://" & Me.txtFtpAddress.Text
> End If
> Me.txtFtpAddress.Text = Me.txtFtpAddress.Text.Replace("\", "/")
> _merge.FTPAddress = Me.txtFtpAddress.Text
> But it keeps erroring out saying it cannot find the FTP location specified
> at the value I have for _merge.Publisher?
> The value for the Ftp is ftp://192.168.1.2/repldata.
> The value for the Publisher is server909.
> I put an LMHOSTS entry to route the 192.168.1.2 to server909 it works.
> But I'm not going to be doing LMHOSTS management on 500+ production laptops
> and we plan on using different FTP servers that are different than the SQL
> Server.
> "Sophie Guo [MSFT]" wrote:

Process cannot connect to distributor error !!!

Hey guys. I am creating an app that uses the RMO Merge Replication objects.
So far it can subscribe and unsubscribe just fine but when it comes to the syncing process it gets a little weird, here's why.

- If I run the SQL GUI Sync tool, it sinks fine. So that setup is working.

- When I run the C# App it blows up witht the error: "Process cannot connect to Distributor"

- Here's the weird part: When I set a breakpoint on my custom method SyncData (this method sets up the connection info and properties and then calls Syncronize( ) ) and step through the code when it gets to Syncronize( ) it runs perfectly fine, no execeptions.

I thought that maybe the Syncronize( ) method was being called too fast before the connection properties got to fully setup and connect, so I added a Thread.Sleep( ) method for 10 secs after each connection call and just before calling Syncronize( ). It still didn't work. My class is a static class by design, however, I changed it into an ordinary class and then placed the connection info in the constructor hoping it would do it's connection when the object gets initialized, that didn't work either.

If someone could please help me out with this I would greatly appreciate it.

Here's my code:

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Replication;
using Microsoft.SqlServer.Replication.BusinessLogicSupport;
using Microsoft.SqlServer.Management.Common;
using System.Windows.Forms;
using System.Threading;

namespace Emds.Briefcase.BriefcaseSubscriber.BLL
{
public class SyncDataClass
{
#region Members

private static string m_statusMessage = string.Empty;
private static byte m_percentComplete;
public delegate void StatusTextChangeHandler(int percent, string status);
public static event StatusTextChangeHandler OnStatusChange;

#endregion Members

#region Methods

public static string SyncData()
{

//Delay();

// Define the server, publication, and database names.
string publicationName = "Chart";
string publisherName = @."JSMITH\SQL2005";
string subscriberName = @."JDOE\SQL2005";
string subscriptionDbName = "DataSubscriber";
string publicationDbName = "DataPublisher";
string message = string.Empty;

// Create a connection to the Subscriber.
ServerConnection conn = new ServerConnection(subscriberName);

MergePullSubscription subscription;

try
{
// Connect to the Subscriber.
conn.Connect();
// Delay();

// Define the pull subscription.
subscription = new MergePullSubscription();
subscription.ConnectionContext = conn;

//Delay();

subscription.DistributorSecurity.WindowsAuthentication = false;
subscription.DistributorSecurity.SqlStandardLogin = "sa";
subscription.DistributorSecurity.SqlStandardPassword = "russell";

// Delay();
subscription.PublisherName = publisherName;
subscription.PublicationDBName = publicationDbName;
subscription.PublicationName = publicationName;
subscription.PublisherSecurity.SecurityMode = ReplicationSecurityMode.SqlStandard;
subscription.PublisherSecurity.SqlStandardLogin = "sa";
subscription.PublisherSecurity.SqlStandardPassword = "russell";

// Delay();
subscription.DatabaseName = subscriptionDbName;
subscription.SubscriberSecurity.WindowsAuthentication = false;
subscription.SubscriberSecurity.SqlStandardLogin = "sa";
subscription.SubscriberSecurity.SqlStandardPassword = "russell";

// Delay();

// If the pull subscription exists, then start the synchronization.
if (subscription.LoadProperties())
{

// Check that we have enough metadata to start the agent.
if (subscription.PublisherSecurity != null || subscription.DistributorSecurity != null)
{
// Synchronously start the Merge Agent for the subscription.
subscription.SynchronizationAgent.Status += new AgentCore.StatusEventHandler(SynchronizationAgent_Status);
// Delay();

subscription.SynchronizationAgent.Synchronize();
message = "Data Syncronization is a success!";
}
else
{
throw new ApplicationException("There is insufficent metadata to " +
"synchronize the subscription. Recreate the subscription with " +
"the agent job or supply the required agent properties at run time.");
}
}
else
{
// Do something here if the pull subscription does not exist.
throw new ApplicationException(String.Format(
"A subscription to '{0}' does not exist on {1}",
publicationName, subscriberName));
}
}
catch (Exception ex)
{
// Implement appropriate error handling here.
throw new ApplicationException("The subscription could not be " +
"synchronized. Verify that the subscription has " +
"been defined correctly.", ex);
}
finally
{
conn.Disconnect();
}
return message;
}

static void SynchronizationAgent_Status(object sender, StatusEventArgs e)
{
m_percentComplete = e.PercentCompleted;
m_statusMessage = e.Message;

//Fire custom event
if (OnStatusChange != null)
{
OnStatusChange(m_percentComplete, m_statusMessage);
}
}

#endregion Methods
}
}Moved to SQL Server Replication forum.|||

You may want to try setting the distributor security on the Agent object directly before calling subscription.SynchronizationAgent.Synchronize() like so:

subscription.SynchronizationAgent.DistributorSecurityMode = SecurityMode.Standard

subscription.SynchronizationAgent.DistributorLogin = "sa"

subscription.SynchronizationAgent.DistributorPassword = "russell"

Hope that helps,

-Raymond

|||Raymond,

Thanks for your response. If you look at my code listing I think you will see that I am already doing that, unless I missunderstood what you were suggesting.

Thanks again,

Chris|||

There is actually a subtle difference: I believe your code is setting the security info on the subscription object, whereas my code is setting it on the SynchronizationAgent object.

-Raymond

|||Ok, I will give it a shot. Thank you again!!|||That was it!!! Thank you very, very much!!!!!

Take care!!!