Detach a disk from Google Compute Instance

To remove a disk from Google Compute instance, run

Example

Here “indiameds” is name of the disk i want to detach from google compute instance with name “debug-instance”.

Google Cloud only allow detaching secondary disks. Boot disks can’t be detached, only way to detach a boot disk and attach on a new instance is to delete the instance. Make sure you don’t delete the disk along with the instance.

See gcloud

varnish

To clear cache, run

Amazon RDS ERROR 1040 (08004): Too many connections

On an Amazon RDS Aurora data base, when i connect, i get error

This error is due to max_connections setting in MySQL exceeded. By default Amazon RDS set max_connections based on size of RDS instance using following formula.

To see current value, run

To change default value, you need to create a “Parameter group” under Amazon RDS > Parameter groups

On next page, select “Parameter group family” based on what ever RDS version you are using. In this cause i use Amazon Aurora database, so i select “aurora5.6”

Group name and Description, use any value you like, it is just for identification purpose only.

Once created, it will list all available parameter groups. click on newly created parameter group, on next page, it show all options. In the top search box, type in “max_connections” to find the settings. Edit and save.

Now we need to associate this newly created parameter group with Amazon RDS instance, for this go to Amazon RDS > Instances

Select the instance you need to edit, then from “Instance Actions” drop down menu, select modify.

On next page page, you have the option to select “DB parameter group”, select the newly created parameter group.

On next page, you have option to apply change immediately or apply during maintenance window.

You need to reboot the instance to apply the changes.

No space left on device

On a server, when creating new files, i get error – “No space left on device”.

Check disk space with df -h, it shows 129 GB disk space is free

This can be due to inodes getting full, check inodes usage with “df -i”.

As you can use Inodes are all used up.

To find where inodes are used up, run

If you have recent version of du, you can use

This will display all folders with inode usage, sorted by inode usage.

Disable IPv6

To disable IPv6, edit

Add following

run

vim E509: Cannot create backup file (add ! to override)

When i save file on a server in vim, i get error

“FILE_NAME.EXTN” E509: Cannot create backup file (add ! to override)
Press ENTER or type command to continue

I verified vim backupdir with command

That showed “backupdir=.,~/tmp,~/”, i compared it with vim installed on my PC, it looked same.

I tried to create a file on the server using touch, it failed.

The error was due to disk full on the server and vim was not able to create a backup file.

See vim