"/home/nodejs/.pm2/logs" is taking 16GB of disk storage - node.js

I have a droplet on digital ocean runs nodejs app. Everything was fine until the system stopped due to the limited storage. "/home/nodejs/.pm2/logs" takes 16GB of the storage.
I have done "pm2 flush" but the mentioned logs folder still exists. The logs should be deleted.
Any ideas on how to delete these logs?

Related

Endless corrupted sstable after EC2 image restore from AMI backup

Cassandra version 3.11.4, many corrupted sstable files showing in system.log after service restart, and we tried to use AMI backup to restore EC2 server, but the corrupted message showed up too, we tried everything, no matter nodetool scrub, sstablescrub, remove corrupted files then repair, seems corrupted files won't stop to show up.
Is there anyone have encounter this before? Any help will be much thankful.
You can't simply restore a Cassandra node by recovering from an AMI backup because it will have a different database state compared to when it was running.
If your data is stored on EBS, you can replace the EC2 instance then mount the EBS to the same Cassandra data/ directory so the node will start in the same state that is persisted on the EBS volume.
If the above method isn't available to you, you will need to replace the node "with itself" using the replace_address option documented here. Cheers!

EC2 ubuntu server storage memory consumption increasing day by day

I have an EC2 ubuntu t2.micro server and running a Node.js app with MongoDB database which is also installed in same server. I'm observing that the storage memory consumption is increasing day by day. I'm trying to find out the reason but I'm not seeing any process of file which is causing.
I have installed Nginx and PM2 and tried to turn off it logs as well but no luck.
The output of df -h
The output of sudo du -sh /*
Can someone please help me to figure out if any hidden process is utilizing the storage?
Thanks

how to let Ubuntu see that I increased disk size in azure portal

I have Ubuntu 18 VM on Azure with one 30 GB SSD disk. unfortunately, the disk free space reached zero, and mysql service went down. I stopped the VM and increased the disk space on Azure portal to 60 GB, but when I start the VM again, Ubuntu keeps showing 100% use of 30 GB. it did not notice the new space.. is there any command I have to run on Ubuntu server in order to see the new size?
I just found that cfdisk can solve the whole issue. however if you get errors while running the cfdisk command, run parted and type print and you will get an option to Fix or Ignore the disk space. type Fix and then run cfdisk again and it will work perfectly. using cfdisk, you can resize, delete, create partitions as required.

Add a disk to a Linux VM

I want to start geth on a new VM. I already have geth running in archival mode in another VM. I have synced up to 6 million blocks on the existing VM. Is there a way I can take the data disk from the existing VM and attach it to the new VM. So that when I start geth on the new VM it will take the latest block synced from the disk and start after 6 millionth block.
I have tried shutting of my VM and taking a snapshot of the data disk and then attaching it to the new VM. But after mounting the disk on the new VM, it seems like the chaindata has been erased. Am I missing something while attaching the disk ?
I have followed the following documentation to attach the disk:
https://learn.microsoft.com/en-us/azure/virtual-machines/linux/add-disk
Also I am using Azure platform for my VM and the VMs have Linux Operating systems.
Thanks!
For your issue, I test the data disk copy and it works well with nothing disappear. The steps below.
Dettach the data disk which you want to copy.
Create a snapshot from the data disk.
Create a data disk copy from the snapshot.
Attach the copy data disk to the new VM.
Try it again following the steps above.

Excessive CPU use of azure mdsd

I am running a Kubernetes cluster on Azure deployed using "azure acs ...". Recently I noticed that the pods on one of the nodes were not responsive and that the CPU on the node was maxed out. I logged in, executed top and found that a process called "mdsd" was using up all available CPU.
When I killed that process with "sudo kill -9", the CPU usage returned to normal and my pods were working fine.
It seems to me like "mdsd" is part of the Azure linux monitoring framework. I installed omi-1.4.0-6.ssl_100.ulinux.x64.deb.
Is there a way to make sure that mdsd is not eating up all my CPU and stopping my pods from working properly?

Resources