Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Lewis Smith 208 posts 617 karma points c-trib
    May 30, 2018 @ 14:54
    Lewis Smith
    0

    AWS server cannot connect to database

    Hi all,

    I'm in the deployment stage of a website I'm working on and the website which is hosted on AWS is failing to connect to my database which is hosted on another server.

    This is my first time setting things up on AWS. Everything is set up and the site is loading but throwing me the Umbraco cannot start. A connection string is configured but Umbraco cannot connect to the database. error.

    When I take the site and run it locally it connects to the database as expected so it must be something to do with the environments. Could anyone shed some light?

    I have tried creating a new user, then tried logging into the server as this user i created to ensure that this user could see all the database tables and data (which it could).

    I have also replaced the server name with the server IP address where the database is, EG it was SQL01 and now its the 10.5.blah.blah.

    Help!!!

    Lewis

  • Andy Felton 185 posts 484 karma points c-trib
    May 30, 2018 @ 15:07
    Andy Felton
    0

    Hi Lewis,

    We use AWS for our hosting and it normally works assuming the VPC and network is configured correctly. I will try and help more but need some additional information. Firstly is your database also on AWS as an RDS, are the database and EC2 in the same VPC?

    Andy

  • Lewis Smith 208 posts 617 karma points c-trib
    May 30, 2018 @ 15:19
    Lewis Smith
    0

    Hi Andy,

    The database is not on AWS. It is hosted on a different server (hosted locally in my office) This means the database and EC2 are no in the same VPC.

    Thanks, Lewis

  • Andy Felton 185 posts 484 karma points c-trib
    May 30, 2018 @ 15:46
    Andy Felton
    0

    Hi Lewis,

    I would expect the EC2 shouldn't have a problem with connecting to an IP address, assuming normal outgoing an incoming traffic is working correctly assume RDP and the like work (you can trace this with flow logs https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/flow-logs.html).

    Just one thing the IP address in your first post was just an example wasn't it (as 10.5.X.X would be an internal IP address and wouldn't be accessible from AWS)? Also have you configured your local firewall, etc to allow a connections from AWS?

    Hope these ideas help.

    Thanks Andy

  • Lewis Smith 208 posts 617 karma points c-trib
    May 31, 2018 @ 07:22
    Lewis Smith
    0

    Hi Andy,

    It turned out that the database server was hosted locally by our office only for security. No wonder nothing seemed to work!

    Thanks for all your help but having to seek another way around this. Because of licensing costs may have to convert the database to MySql from MsSql.

    Can you think of any disadvantages to this?

    Thanks, Lewis

  • Nik 1593 posts 7151 karma points MVP 6x c-trib
    May 31, 2018 @ 08:22
    Nik
    0

    Hi Lewis,

    I wouldn't recommend that if I'm honest. Although Umbraco does support MySql, they are generally slower at fixing bugs relating to it. I also believe (but I might be wrong) that if you want to use MySql as the database you need to decide that at the start of the project as MySql and MsSql store data differently.

    Depending on the size of the database, you could potentially get away with using SQL Express, alternatively if you are hosting on AWS, look at a MsSQL RDS instance.

    Nik

  • Andy Felton 185 posts 484 karma points c-trib
    May 31, 2018 @ 08:17
    Andy Felton
    0

    Hi Lewis,

    Not tried MsSql with Umbraco, I've just tended to use an RDS with SQL Server on it. One option could be SQL CE if you're only looking at single server and are happy with potential issues with that.

    Thanks Andy

  • Lewis Smith 208 posts 617 karma points c-trib
    May 31, 2018 @ 08:47
    Lewis Smith
    0

    Hi Andy,

    SQL CE is not really an option because of the issues that are associated with it.

    What edition of SQL Server do you run? Express, Web, Standard or Enterprise? Just want to make sure we're covered!

    I think this is the route we are going to go down as converting a project that is working in MSSQL to MYSQL is not feasible.

    Thanks, Lewis

  • Andy Felton 185 posts 484 karma points c-trib
    May 31, 2018 @ 09:13
    Andy Felton
    101

    Hi Lewis,

    I would agree in not using SQL CE, I know some people do and it's OK but personally I wouldn't!

    My recommendation (although it has some cost) would be to go with Web on an AWS RDS, the only reason I suggest this is you can go with larger instance sizes should you need to (express is limited at t2.medium). Although starting with Express is also an option! As the front end runs on the cache rather than CRUD functions you may be surprised how small a server you can get away with.

    AWS RDS works well for us and is mostly maintenance free which is a huge benefit!

    Hope that helps. Andy

Please Sign in or register to post replies

Write your reply to:

Draft