Egg +mysql+ Redis project mounts the cloud server

Error: ENOSPC: no space left on device, write

Check server background project port running properly, restart project, infinite Wait occurred, cause unknown (TAB quick add remaining filename invalid)


The project runs locallynpm run devIf yes, and the server also synchronously runs once

Error message Error: ENOSPC: No space left on device, write The disk is full

Linux commanddf -hViewing Memory

Enter the pm2 flush command to flush all log files because pM2 is mounted

When you check the memory status again, more than 10 GB of memory has been cleared

Run the project NPM run dev again

Error message: Redis cannot connect

Restart the redis:sudo /etc/init.d/redis-server restart

Restart /stop/start: restart, stop, or start

The default configuration file is in /etc/redis.conf

Stuck, no error message

View the running status of redisps -ef | grep redis

No screenshots: There is redis running at that time, it should be in suspended animation, restart/stop will not work

Solutions:

1. Try to kill the process and restart it:


ps -ef | grep redis | awk '{print $2}' | xargs kill -9

Copy the code

Pipe “|” is used to separate two commands, pipe the output of the command on the left will act as a pipe, the right of the command input.

Ps -ef # Displays all processes

Ps – ef | grep redis # view contains the redis process

Ps – ef | grep redis | grep -v grep # view contains the redis process, and eliminate process with grep

Awk ‘{print $2}’ # Reads the specified file line by line, using Spaces as delimiter, and printing the second field

The xargs command takes the output of the previous command (PID) as the parameter of the “kill -9″ command and executes the command. Kill -9” will forcibly kill the specified process.

2. Restart the server

Extended memory query command:

Du -sh * # Displays the size of each directory and file in the current directory

Du -sh bin* # Summarizes the size of the specified directory

Du – sh * | grep M # all directories and files under the current directory, respectively, to carry on the summary, and use grep “[M]” screen all size of M (signs) level of directories and files

Du – sh * | grep (MG) | sort – nt # screen size for MB and GB level of directories and files, descending sort – nt