我找到了解决方案并写了一篇关于使用自定义 DNS、“Black Jack”等为 Windows Server On-Premise 配置服务总线的帖子。
以俄语发布,但包括许多屏幕截图和代码/脚本示例:
http://habrahabr.ru/post/254059/
说明:
很难简单回答,不解释完整的配置过程。
基本上,证书中的问题:
在带有服务总线的 VM 上:
1) 使用命令行实用程序makecert.exe生成访问证书:
(C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin)
makecert.exe -r -pe -n "CN=hello-habr-sb.cloudapp.net, CN=hello-habr-sb" -e 11/11/2022 -eku 1.3.6.1.5.5.7.3.2 -ss My -sr "LocalMachine" -sky Exchange -a sha256 -sy 24 -len 2048 "hello-habr-sb.cloudapp.net.cer"
在服务器上将其导入到证书的客户端 - 本地计算机(受信任的根 CA)。
2) 使用 PowerShell 更改 DNS:
Get-SBFarm
Stop-SBFarm –Verbose
Set-SBFarm -FarmDns 'hello-habr-sb.cloudapp.net'
Update-SBHost –Verbose
Start-SBFarm –Verbose
3) 使用 PowerShell 设置 SAS-Key:
New-SBAuthorizationRule -NamespaceName ServiceBusDefaultNamespace -Name MainRule -Rights Manage, Send, Listen
输出如下所示:
KeyName : MainRule
PrimaryKey : ylF6GWmH6rlZg1ekQMQrLQnht4kwVFWHAfyB8HkrZvM=
SecondaryKey : ZYBpdiCYgZNfwOC37x6DEDLxhv+qan6CJZT0vG3GvTk=
Rights : {Manage, Send, Listen}
CreatedTime : 3/22/2015 12:53:23 AM
ModifiedTime : 3/22/2015 12:53:23 AM
ConnectionString : Endpoint=sb://hello-habr-sb.cloudapp.net/ServiceBusDefaultNamespace;
StsEndpoint=https://hello-habr-sb.cloudapp.net:10355/ServiceBusDefaultNamespace;
RuntimePort=10354;
ManagementPort=10355;
SharedAccessKeyName=MainRule;
SharedAccessKey=ylF6GWmH6rlZg1ekQMQrLQnht4kwVFWHAfyB8HkrZvM=
4) 添加主机链接:
(C:\Windows\System32\drivers\etc)
127.0.0.1 hello-habr-sb.cloudapp.net
在带有 Azure 包的 VM 上:
1) 使用命令行实用程序生成证书makecert.exe и pvk2pfx.exe:
(C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin)
对于服务器:
makecert -r -pe -n "CN=WAP Portals" -ss CA -a sha1 -sky signature -cy authority -sv WAPPortals.pvk WAPPortals.cer
makecert -pe -n "CN=hello-habr-wap.cloudapp.net" -a sha1 -sky exchange -eku 1.3.6.1.5.5.7.3.1 -ic WAPPortals.cer -iv WAPPortals.pvk -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12 -sv WAPLocalServer.pvk WAPLocalServer.cer
pvk2pfx -pvk WAPLocalServer.pvk -spc WAPLocalServer.cer -pfx WAPLocalServer.pfx
对于客户:
makecert -pe -n "CN=WAPMainDeveloper" -a sha1 -sky exchange -eku 1.3.6.1.5.5.7.3.2 -ic WAPPortals.cer -iv WAPPortals.pvk -sv WAPClient.pvk WAPClient.cer
pvk2pfx -pvk WAPClient.pvk -spc WAPClient.cer -pfx WAPClient.pfx -po HelloHabr2015
2) 在 Certificates – Local Computer (Trusted Root CA) 中导入 WAPPortals.cer 在服务器上。
3) 在证书 - 本地计算机和当前用户(个人)中的服务器和客户端上导入 WAPClient.pfx。
4) 添加主机链接:
(C:\Windows\System32\drivers\etc)
127.0.0.1 hello-habr-wap.cloudapp.net
5) 使用 PowerShell(以管理员身份)更改 Azure Pack 管理站点的 FQDN 站点名称:
租户站点:
Import-Module -Name MgmtSvcConfig
Set-MgmtSvcFqdn -Namespace "TenantSite" -FullyQualifiedDomainName "hello-habr-wap.cloudapp.net" -Port 30081 -Server "hello-habr-wap\SQLEXPRESS"
Set-MgmtSvcFqdn -Namespace "AuthSite" -FullyQualifiedDomainName "hello-habr-wap.cloudapp.net" -Port 30071 -Server "hello-habr-wap\SQLEXPRESS"
Set-MgmtSvcRelyingPartySettings -Target Tenant -MetadataEndpoint "https://hello-habr-wap.cloudapp.net:30071/FederationMetadata/2007-06/FederationMetadata.xml" -ConnectionString "Data Source=hello-habr-wap\SQLEXPRESS;User ID=sa;Password=HelloHabr2015" –DisableCertificateValidation
Set-MgmtSvcIdentityProviderSettings -Target Membership -MetadataEndpoint "https://hello-habr-wap.cloudapp.net:30081/FederationMetadata/2007-06/FederationMetadata.xml" -ConnectionString "Data Source=hello-habr-wap\SQLEXPRESS;User ID=sa;Password=HelloHabr2015" –DisableCertificateValidation
管理网站:
Import-Module -Name MgmtSvcConfig
Set-MgmtSvcFqdn -Namespace "AdminSite" -FullyQualifiedDomainName "hello-habr-wap.cloudapp.net" -Port 30091 -Server "hello-habr-wap\SQLEXPRESS"
Set-MgmtSvcFqdn -Namespace "WindowsAuthSite" -FullyQualifiedDomainName "hello-habr-wap.cloudapp.net" -Port 30072 -Server "hello-habr-wap\SQLEXPRESS"
Set-MgmtSvcRelyingPartySettings -Target Admin -MetadataEndpoint "https://hello-habr-wap.cloudapp.net:30072/FederationMetadata/2007-06/FederationMetadata.xml" -ConnectionString "Data Source=hello-habr-wap\SQLEXPRESS;User ID=sa;Password=HelloHabr2015" –DisableCertificateValidation
Set-MgmtSvcIdentityProviderSettings -Target Windows -MetadataEndpoint "https://hello-habr-wap.cloudapp.net:30091/FederationMetadata/2007-06/FederationMetadata.xml" -ConnectionString "Data Source=hello-habr-wap\SQLEXPRESS;User ID=sa;Password=HelloHabr2015" –DisableCertificateValidation
6) 做其他事情:
终于可以在 3 个虚拟机上运行:
-
数据库
https://hello-habr-db.cloudapp.net:1433 - MSSQL Server
-
Windows 服务器的服务总线
https://hello-habr-sb.cloudapp.net:10355 - HttpPort (ManagementPort)
https://hello-habr-sb.cloudapp.net:10354 - TcpPort (RuntimePort)
-
适用于 Windows Server 的 Azure 包
https://hello-habr-wap.cloudapp.net:30081 - TenantSite
https://hello-habr-wap.cloudapp.net:30091 - AdminSite
希望这会有所帮助!如果您有一些错误 - 请阅读我的帖子(披露部分剧透):
http://habrahabr.ru/post/254059/
- 使用数据库配置 VM:
“Настройка виртуальной машины с базой данных”
- 使用 Windows Server 的服务总线配置 VM:
“Настройка виртуальной машины с Service Bus for Windows Server”
- 使用 Azure Pack 配置 VM:
“Настройка виртуальной машины с Azure Pack”
- 适用于 Windows Server 的 Service Bus 的简单 .NET (C#) 客户端:
“Проверка работы 服务总线”