So I have an app that is refusing node.js connections. Our AWS EC2 install is out of memory. Found out it was a log file ("
redis_6534.log") that is 5.1G. I need to see what is in the log file (prefer to push to S3 or save to local mac). Then I want to delete or remove the log file ("
redis_6534.log") from my kue node.js server.
I tried to export the log file to S3 (using
s3cmd put my.file s3://pactsRamun/folderExample/fileExample), but my Ubuntu server says I don't have "s3cmd" installed. Tried to install, but says admin needs to install it.
- I need to find out what is in the log file.
- Download or push the log file to some safe place.
- Need to delete or remove the contents of the log file.
- If I deleted the log file then I need to replace it with a new log file.
I need to start with step 1. and 2. first. Any help would be appreciated. I am developer not a server jockey so this all new to me.
So I did head and tail on the first and last 300 lines. Its just logs saying server started and restarted.
So I now need to empty that file. If I try to vim it on the server I am guessing it will crash the server trying to edit that large of a file? Wondering the best way to remove and replace the log file?
A: Do I stop the server, delete the file and reboot. Assume the server will create a new log file?
B: Can I rename the file and create a new file with the same name? (But do I need to stop the server first?