2020年12月19日 星期六

Unable to deploy webpage through docker of AWS lightsail instance

Background

So I am trying to build and deploy a very simple LAMP application through docker, but encounters difficulties of repeatedly restarting mySQL server with the following errors


mysqld entered running state exit status 0 expected

It repeatedly restarts and never stops until I turn off the docker services. I am annoying on this because deploying a LAMP based web site through docker should be short and shouldn't take too much time.


Reason

So I finally figure out I can investigate through mySQL log through /var/log/mariadb/mariadb.log, you can determine the exact log path in the my.cnf file located in /etc/my.cnf


And this shows up as 1 of the log

innodb: cannot allocate memory for the buffer pool


Bingo ! So memory insufficient is the cause


Solutions

As I am using AWS Lightsail, the cheapest plan with only 512mb ram, and the remaining RAM is just several MBs, which is totally not enough for running all 2 containers (lamp docker container & ftp).

The I quickly think of swap spaces, which use fast SSD as memory, following URL's guidance, the LAMP docker service can be run successfully 


References

沒有留言:

張貼留言