简体   繁体   English

如何将在本地计算机上运行的数据库服务器作为服务连接到托管在关键云铸造厂上的Web应用程序?

[英]How to connect a database server running on local machine as a service to web application hosted on pivotal cloud foundry?

I am trying to test run a basic .NET web application on pivotal cloud foundry. 我试图测试在关键的云铸造厂上运行基本的.NET Web应用程序。 This web application uses as its database a MongoDB server hosted on my local machine. 该Web应用程序使用本地计算机上托管的MongoDB服务器作为其数据库。 At the moment I am limited to use of the cloud infrastructure by using just the Apps Manager. 目前,我仅限于仅使用Apps Manager使用云基础架构。

I have read the pivotal cloud foundry docs about user provided services, but cannot figure out as to how the connection is to be really made. 我已经阅读了有关用户提供的服务的关键的Cloud Foundry文档,但是无法弄清楚如何真正建立连接。 I have already come across various other ways like using MongoDB as a service (beta version), but at the moment I am not allowed access to the Operations Manager. 我已经遇到过各种其他方式,例如将MongoDB用作服务(测试版),但是目前不允许我访问Operations Manager。 Looking for an explanation on user provided services or how to implement the service broker API, specifically. 特别是在寻找有关用户提供的服务或如何实现服务代理API的说明。

I am new to Mongo as well, so any suggestion regarding making a connection through tweaking Mongo may help as well. 我也是Mongo的新手,因此有关通过调整Mongo建立连接的任何建议也可能会有所帮助。 Thanks 谢谢

The use case you describe (web app in PCF connecting to a resource in your local machine) is not recommended. 不建议使用您描述的用例(PCF中的Web应用程序连接到本地计算机中的资源)。

You can create a MongoDB instance for development purposes in PCF. 您可以在PCF中为开发目的创建MongoDB实例。

$ cf marketplace  
...  
mlab    sandbox       Fully managed MongoDB-as-a-Service  
...  

You can create a mlab service and bind it to your application. 您可以创建一个mlab服务并将其绑定到您的应用程序。 You will then have a MongoDB instance in PCF that you can use for development purposes. 然后,您将在PCF中拥有一个MongoDB实例,您可以将其用于开发目的。


Edit: 编辑:
In that case a user provided service might help you, where you pass in your remote MongoDB instance configuration that you can read in your application. 在这种情况下,用户提供的服务可能会为您提供帮助,您可以在其中传递可在应用程序中读取的远程MongoDB实例配置。 eg: 例如:

cf.exe cups my-mongodb -p '{"key1":"value1","key2":"value2"}'

You can add your local mongo-db as a CUPS service to your PCF Dev. 您可以将本地mongo-db作为CUPS服务添加到PCF开发人员中。

Check out the following post. 查看以下帖子。 How to create a CUPS service for mongoDB? 如何为mongoDB创建CUPS服务?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将托管的Web应用程序与本地数据库连接? - How to connect a hosted Web Application with a local database? 托管在另一台计算机上的Web应用程序可以在不将数据发送到服务器的情况下从本地.NET应用程序接收数据吗? - Can a web application hosted on another machine receive data from a local .NET application without sending data to the server? 服务器上运行的应用程序-无法连接到另一个本地数据库 - Application running on server - can't connect to another local database 服务帐户在本地计算机上工作但不在Web服务器上工作 - Service Account working on local machine but not on Web server IIS在本地计算机上托管的Profect无法访问SQL Server数据库 - IIS hosted profect on local machine cannot access SQL server database 如何托管公共ASP Web表单和Web服务来访问本地内部SQL数据库? - How can a public ASP web form and web service be hosted to access a local, internal, SQL database? 无论如何,是否可以从托管网站连接到本地SQL Server数据库? - Is there anyway to connect to local SQL Server database from hosted website? 如何将C#中的ASP.Net Framework API放在Pivotal Cloud Foundry上? - How do I put an ASP.Net Framework API made in C# onto Pivotal Cloud Foundry? asp.net Web应用程序是本地还是托管服务器? 哪个更好 - asp.net web application local or hosted server? which is better 在使用Web应用程序时(即托管在服务器中)如何引用本地路径文件夹 - How to Refer to the Local path folder while using a web application(i.e hosted in server)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM