SQL 2008 R2サーバーがあります。 私はOKに見えたウィザードを使って出版物を作成しました。 'システムデータベース'セクションには、多く含まれていない「ディストリビューション」データベースがあります。 (これが既に存在していたかどうか、または「パブリケーションウィザード」によって作成されたかどうかはわかりません) Web同期をセットアップして、IIS7経由でrelisapi.dllと自己署名入りの証明書にアクセスできます。SQL Server 2008 Web同期によるSQL Express 2005へのレプリケーション
私のASP.NET Webサイト用のセットアッププログラムは、SQL Express 2005をインストールします。 サブスクリプションと初期同期の作成をテストするための小さなサイトを作成しました。 最初の同期がサーバーからすべてのデータを取得すると仮定しているので、私は "初期データベース"を作成しません。
サブスクリプションがSQL 2008サーバーのSQL Express &に作成されるため、次のコードが動作するようです。
' Define the pull subscription.
subscription = New MergePullSubscription()
subscription.ConnectionContext = subscriberConn
subscription.PublisherName = publisherName
subscription.PublicationName = publicationName
subscription.PublicationDBName = publicationDbName
subscription.DatabaseName = subscriptionDbName
subscription.HostName = hostname
subscription.CreateSyncAgentByDefault = True
' Specify the Windows login credentials for the Merge Agent job.
subscription.SynchronizationAgentProcessSecurity.Login = winLogin
subscription.SynchronizationAgentProcessSecurity.Password = winPassword
' Enable Web synchronization.
subscription.UseWebSynchronization = True
subscription.InternetUrl = webSyncUrl
' Specify the same Windows credentials to use when connecting to the
' Web server using HTTPS Basic Authentication.
subscription.InternetSecurityMode = AuthenticationMethod.BasicAuthentication
subscription.InternetLogin = winLogin
subscription.InternetPassword = winPassword
If Not subscription.LoadProperties() Then
' Create the pull subscription at the Subscriber.
subscription.Create()
その後、私はこのコードのビットを実行します。
If Not subscription.PublisherSecurity Is Nothing Or _
subscription.DistributorSecurity Is Nothing Then
'0: Only error messages are logged.
'1: All progress report messages are logged.
'2: All progress report messages and error messages are logged.
subscription.SynchronizationAgent.OutputVerboseLevel = 2
subscription.SynchronizationAgent.Output = "c:\createmerge.txt"
' Synchronously start the Merge Agent for the subscription.
subscription.SynchronizationAgent.Synchronize()
をしかし、シンクロがエラーをスローします。サーバー上で
The subscription to publication 'My publication' could not be verified. Ensure that all Merge Agent command line parameters are specified correctly and that the subscription is correctly configured. If the Publisher no longer has information about this subscription, drop and recreate the subscription.
、それは私のサブスクリプションを示している「レプリケーションモニタ」を使用して「ユニット化」として。
私のサブスクリプションの1つの問題は、ホステル名が間違っていると思います。 MSDNのMicrosoftの例は
"adventure-works\garrett1"
を言うが、サーバー、インスタンスまたはデータベースであるとgarrett1(ログインまたは他の何か)誰が冒険-作品かどうかは明らかではありません。では、実際にはどうすればいいのですか?
私はレプリケーションについて何も知らないので、MSDNといくつかの書籍に従っていますので、次にどこへ行くのかについていくつかの点をお伝えしたいと思います。
申し訳ありませんが、これは長すぎます!