Home>
After confirming that automatic deployment is completed and you can access EIP, set your own domain
[[email protected] App name] $RAILS_SERVE_STATIC_FILES = 1 unicorn_rails -c config/unicorn.rb -E production -D
master failed to start, check stderr log for details
When I try to start unicorn with this command, the statement master failed to start, check stderr log for details appears and I cannot start it. So I tried various commands based on the information I searched to check the log. By the way, the app hasn't changed anything on the VS code.
$cd current
#Go to log directory
$cd log
Show information about files contained in #log
$ls
production.log unicorn.stderr.log unicorn.stdout.log
Postscript: Run cat log/unicorn.stderr.log




]

When I tried to connect to sql, I got an error even though I put it in
[ec2-user @ ip-172-31-35-114 ~] $mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket'/var/lib/mysql/mysql.sock' (2)


afterwards

$sudo touch /var/lib/mysql.sock


I thought this would go. However

[ec2-user @ ip-172-31-35-114 ~] $sudo mysql.server restart
sudo: mysql.server: command not found


Sql connection command again. The numbers have changed. 2 → 13

[ec2-user @ ip-172-31-35-114 ~] $mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket'/var/lib/mysql/mysql.sock' (13)


What do you mean?
Reference: https://qiita.com/TeruhisaFukumoto/items/0238f70c91f56486dcae

Solution sudo systemctl restart Because it was not restarted with mariadb

It seems that it was this part.
Reference: https://saton2.hatenablog.com/entry/2018/10/16/200616

  • Answer # 1

    I'm sorry, I noticed an error after writingSo I will withdraw it and request deletion ...
    * Addition
    I asked you to post the log and found out the cause, so again.

    From the contents of the error output log of unicorn, where to connect to MySQL/var/lib/mysql/mysql.sockI am getting an error because I cannot access.

    If you look inside and outside stackoverflow, you will find a lot of questions about similar errors and the ones described for them, but for the time being, as a confirmation point that comes to mind.

    Is the MySQL server started normally on the EC2 instance?

    Is the socket file path correct?

    Such.