SSH WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

My cloud server moved to VPC from classic network just now, and connecting to it via SSH got following error

 

Solution

It seems the server host key is changed, one way to solve this prolem is to remove the line containing server IP address from /root/.ssh/known_hosts . Then connect to it by SSH again, it will ask you whether trust this new host key, like following message

Type yes and press Enter key, this new host key is added to .ssh/known_hosts  then.

 

Also you can obtain the host key from the remote server, and add it to .ssh/known_hosts  manually , but we won’t cover this method in detail.

GitLab took too much memory

The gitlab execution on our company internal server eats lots of memory, the server has 32G memory, and gitlab took more than half of it.

 

I found there are lots of unicorn processes running, and each unicorn process is taking 1.5% memory
In top  command output it’s displaying as ruby process and took nearly 500MB resident memory (by default top is sorting by cpu usage, pressing < or > key to change sorting column)
Running above command outputs 34, that means at most 34 unicorn processes are running (some other processes’ name also contain unicorn)..
Assume there are 30 real unicorn process running, each takes 500MB memory, then they will take 30*500MB=15GB memory
To decrease unicorn processes count, edit /etc/gitlab/gitlab.rb, and uncomment following line

 

Next restart GitLab

Now the memory usage is decreased.

 

(Note that running gitlab-ctl reconfigure  will not kill already running unicorn processes)

CentOS 6 Install netcat

Netcat is one utility in NMap toolset, it maybe named as nc, ncat or netcat on different Linux distributions. (It’s ncat on CentOS 6).

On CentOS 6 netcat is not installed by default, to install it we can run following command

 

Then run following command to check netcat is installed correctly