简体   繁体   English

远程访问OpenShift中托管的MySQL数据库(不寻找端口转发解决方案)

[英]Remote access to MySQL DB hosted in OpenShift (not looking for the port forwarding solution)

I spent the whole yesterday migrating my django application to OpenShift (I selected the free solution and my application is using one small gear). 昨天我花了整个时间将我的django应用程序迁移到OpenShift (我选择了免费解决方案,我的应用程序使用了一个小装备)。 My application is now up and running and there are no issues visiting the site using a browser. 我的应用程序现已启动并运行,使用浏览器访问该站点没有任何问题。

However I have a .NET (C#) application which accompanies the web application and it will be run by many different users and it needs to access the database but I can not find a way to do this in OpenShift. 但是我有一个.NET (C#) application ,它随Web应用程序一起运行,它将由许多不同的用户运行,它需要访问数据库,但我找不到在OpenShift中执行此操作的方法。

All the different IP addresses seems to be local and I can not find a way to access the MySQL database remotely. 所有不同的IP地址似乎都是本地的,我找不到远程访问MySQL数据库的方法。 Below are the environment variables from OpenShift: 以下是OpenShift的环境变量:

env | grep MYSQL
OPENSHIFT_MYSQL_DIR=/var/lib/openshift/.../mysql/
OPENSHIFT_MYSQL_DB_PORT=3306
OPENSHIFT_MYSQL_DB_HOST=127.13.169.130
OPENSHIFT_MYSQL_DB_PASSWORD=...
OPENSHIFT_MYSQL_IDENT=redhat:mysql:5.5:0.2.9
OPENSHIFT_MYSQL_DB_USERNAME=...
OPENSHIFT_MYSQL_DB_SOCKET=/var/lib/openshift/.../mysql//socket/mysql.sock
OPENSHIFT_MYSQL_DB_URL=mysql://..-...@127.13.169.130:3306/
OPENSHIFT_MYSQL_DB_LOG_DIR=/var/lib/openshift/.../mysql//log/
OPENSHIFT_MYSQL_LD_LIBRARY_PATH_ELEMENT=/opt/rh/mysql55/root/usr/lib64

As explained in the title I am not looking for the port forwarding solution. 正如标题中所解释的,我不是在寻找端口转发解决方案。 (I need to make it work not only for me but all the users) (我需要让它不仅适用于我而且适用于所有用户)

  • What am I missing? 我错过了什么?
  • Why can't databases be accessed externally? 为什么不能从外部访问数据库?
  • What should I do? 我该怎么办?
  • Are there any other FREE paas out there which offer what I am looking for? 有没有其他免费的paas提供我想要的东西?
  • Do I need to get a medium or big gear in order for this to work? 我是否需要获得中型或大型装备才能使其正常工作?

Thanks 谢谢

If you don't want to use port forwarding, then I would suggest you write an API that your .NET application can use to access the database. 如果您不想使用端口转发,那么我建议您编写一个.NET应用程序可用于访问数据库的API。 Otherwise you would want to look into an externally hosted database (DBaaS) solution. 否则,您需要查看外部托管数据库(DBaaS)解决方案。

OK, lots of googleing and I now know that using the free solution provided by OpenShift it is not possible to solve this issue. 好吧,很多googleing,我现在知道使用OpenShift提供的免费解决方案是不可能解决这个问题的。 You must upgrade to a paid version in order to get another port to access the sql database directly. 您必须升级到付费版本才能使另一个端口直接访问sql数据库。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM