separate Web server & DB server and connect via private IP

Hi,

i have done this on DO but im not sure its also possible in Linode or not.

what i want to do is to have 2 servers

1. web server

2. DB server (Mysql)

2nd server (DB) will be connected with web server via private IP only. and will not be connected to public ip. and both will be placed on same DC ofcource.

is it possible?

4 Replies

Hello,

Yes, it's possible.

What you want is similar to this documentation: https://www.digitalocean.com/community/ … with-mysql">https://www.digitalocean.com/community/tutorials/how-to-set-up-a-remote-database-to-optimize-site-performance-with-mysql

Just use your private addresses instead.

You can do this by adding a private IP to your VPS and use it to make database connection please see the "Private IP's part" in the image

https://www.linode.com/docs/assets/1710 … ss_ips.png">https://www.linode.com/docs/assets/1710-remoteaccessips.png

![](https://www.linode.com/docs/assets/1710 … ss_ips.png">https://www.linode.com/docs/assets/1710-remoteaccessips.png" />

today i went to setup my remote database to connect with web server via the private network,

this is the error i got when i try to change bind-address and restart mysql service

user@localhost:~$ sudo systemctl restart mysql.service
Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.

user@localhost:~$ systemctl status mysql.service
? mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: activating (start-post) (Result: exit-code) since Thu 2017-03-30 14:41:22 UTC; 12s ago
  Process: 6932 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
  Process: 6929 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 6932 (code=exited, status=1/FAILURE);         : 6933 (mysql-systemd-s)
   CGroup: /system.slice/mysql.service
           ??control
             ??6933 /bin/bash /usr/share/mysql/mysql-systemd-start post
             ??6984 sleep 1

any idea, how can i resolve this?

That error message isn't really showing anything that could locate the cause, have you tried running journalctl -xe? That might bring something that could be worked with.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct