• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

最好的LNMP配置在0.5G内存的Centos7.0上

php 搞代码 3年前 (2022-01-25) 16次浏览 已收录 0个评论
文章目录[隐藏]

服务器配置

Centos7.0+0.5G内存+1CPU

Web服务器配置

PHP 5.4.16 + Nginx 1.6.3+MariaDB 5.5.44

在上面跑了一个shadowsocks和一个wordpress,数据库配置文件使用my-small.cnf,但是MariaDB经常挂掉,所以求一个好的配置。

数据库挂掉后,重启MariaDb

启动

systemctl start mariadb

结果

<code>Job for mariadb.service failed. See 'systemctl status mariadb.service' and 'journalctl -xn' for details.</code>

Run

systemctl status mariadb.service

<code> mariadb.service - MariaDB database server   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled)   Active: failed (Result: exit-code) since 三 2015-11-11 00:42:58 EST; 14s ago  Process: 10969 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=1/FAILURE)  Process: 10968 ExecStart=/usr/bin/mysqld_safe --basedir=/usr (code=exited, status=0/SUCCESS)  Process: 10941 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS) Main PID: 10968 (code=exited, status=0/SUCCESS)11月 11 00:42:57 jack mysqld_safe[10968]: 151111 00:42:57 mysqld_safe Logging to '/var/lib/mysql/jack.err'.11月 11 00:42:57 jack mysqld_safe[10968]: 151111 00:42:57 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql11月 11 00:42:57 jack mysqld_safe[10968]: 151111 00:42:57 mysqld_safe mysqld from pid file /var/lib/mysql/jack.pid ended11月 11 00:42:58 jack systemd[1]: mariadb.service: control process exited, code=exited status=111月 11 00:42:58 jack systemd[1]: Failed to start MariaDB database server.11月 11 00:42:58 jack systemd[1]: Unit mariadb.service entered failed state.</code>

Run

journalctl -xn

<code> -- Logs begin at 日 2015-11-08 06:23:57 EST, end at 三 2015-11-11 00:42:58 EST. --11月 11 00:27:21 jack sshd[10936]: Failed password for invalid user pi from 104.233.81.149 port 53083 ssh211月 11 00:27:21 jack sshd[10936]: Received disconnect from 104.233.81.149: 11: Bye Bye [preauth]11月 11 00:40:43 jack kernel: Ack 2451881106 before 2451884026:245189862611月 11 00:42:57 jack systemd[1]: Starting MariaDB database server...-- Subject: Unit mariadb.service has begun with start-up-- Defined-By: systemd-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel-- Unit mariadb.service has begun starting up.11月 11 00:42:57 jack mysqld_safe[10968]: 151111 00:42:57 mysqld_safe Logging to '/var/lib/mysql/jack.err'.11月 11 00:42:57 jack mysqld_safe[10968]: 151111 00:42:57 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql11月 11 00:42:57 jack mysqld_safe[10968]: 151111 00:42:57 mysqld_safe mysqld from pid file /var/lib/mysql/jack.pid ended11月 11 00:42:58 jack systemd[1]: mariadb.service: control process exited, code=exited status=111月 11 00:42:58 jack systemd[1]: Failed to start MariaDB database server.-- Subject: Unit mariadb.service has failed-- Defined-By: systemd-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel-- Unit mariadb.service has failed.-- The result is failed.11月 11 00:42:58 jack systemd[1]: Unit mariadb.service entered failed state.</code>

回复内容:

服务器配置

Centos7.0+0.5G内存+1CPU

Web服务器配置

PHP 5.4.16 + Nginx 1.6.3+MariaDB 5.5.44

在上面跑了一个shadowsocks和一个wordpress,数据库配置文件使用my-small.cnf,但是MariaDB经常挂掉,所以求一个好的配置。

数据库挂掉后,重启MariaDb

启动

systemctl start mariadb

结果

<code>Job for mariadb.service failed. See 'systemctl status mariadb.service' and 'journalctl -xn' for details.</code>

Run

systemctl status mariadb.service

<code> mariadb.service - MariaDB database server   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled)   Active: failed (Result: exit-code) since 三 2015-11-11 00:42:58 EST; 14s ago  Process: 10969 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=1/FAILURE)  Process: 10968 ExecStart=/usr/bin/mysqld_safe --basedir=/usr (code=exited, status=0/SUCCESS)  Proces<a style="color:transparent">来@源gao*daima.com搞@代#码网</a><strong>搞gaodaima代码</strong>s: 10941 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS) Main PID: 10968 (code=exited, status=0/SUCCESS)11月 11 00:42:57 jack mysqld_safe[10968]: 151111 00:42:57 mysqld_safe Logging to '/var/lib/mysql/jack.err'.11月 11 00:42:57 jack mysqld_safe[10968]: 151111 00:42:57 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql11月 11 00:42:57 jack mysqld_safe[10968]: 151111 00:42:57 mysqld_safe mysqld from pid file /var/lib/mysql/jack.pid ended11月 11 00:42:58 jack systemd[1]: mariadb.service: control process exited, code=exited status=111月 11 00:42:58 jack systemd[1]: Failed to start MariaDB database server.11月 11 00:42:58 jack systemd[1]: Unit mariadb.service entered failed state.</code>

Run

journalctl -xn

<code> -- Logs begin at 日 2015-11-08 06:23:57 EST, end at 三 2015-11-11 00:42:58 EST. --11月 11 00:27:21 jack sshd[10936]: Failed password for invalid user pi from 104.233.81.149 port 53083 ssh211月 11 00:27:21 jack sshd[10936]: Received disconnect from 104.233.81.149: 11: Bye Bye [preauth]11月 11 00:40:43 jack kernel: Ack 2451881106 before 2451884026:245189862611月 11 00:42:57 jack systemd[1]: Starting MariaDB database server...-- Subject: Unit mariadb.service has begun with start-up-- Defined-By: systemd-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel-- Unit mariadb.service has begun starting up.11月 11 00:42:57 jack mysqld_safe[10968]: 151111 00:42:57 mysqld_safe Logging to '/var/lib/mysql/jack.err'.11月 11 00:42:57 jack mysqld_safe[10968]: 151111 00:42:57 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql11月 11 00:42:57 jack mysqld_safe[10968]: 151111 00:42:57 mysqld_safe mysqld from pid file /var/lib/mysql/jack.pid ended11月 11 00:42:58 jack systemd[1]: mariadb.service: control process exited, code=exited status=111月 11 00:42:58 jack systemd[1]: Failed to start MariaDB database server.-- Subject: Unit mariadb.service has failed-- Defined-By: systemd-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel-- Unit mariadb.service has failed.-- The result is failed.11月 11 00:42:58 jack systemd[1]: Unit mariadb.service entered failed state.</code>

搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:最好的LNMP配置在0.5G内存的Centos7.0上

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址