Sunday, February 26, 2012

SSH Connection Failed: AWS Cloud Access failed after switch IP

My Case:

Server OS: FreeBSD 8.x
After switching IPs between 2 application, the new server can be ssh, but the previous one failed.
New : x.x.x.143
Old : x.x.x.250

SSH Access command to new server ok, but the old one failed.
I ask my bos, and luckily it not because of wrong configured, but the access cache that stored in host..

  1. Run this command:
    % ee .ssh/known_hosts

    This file keep cache of previous access ssh command
  2. Delete all the content
  3. Save
  4. Try run the ssh command again:
    %ssh -i cloudcert.pem os@x.x.x.250
  5. Connection success!.

MySQL Server: Can’t connect to local MySQL server through socket /tmp/mysql.sock

Server OS: FreeBSD 8.x

This mysql server cannot start mysql server service after shutting down.
Try to start manually using this command, but still got error.#/usr/local/etc/rc.d/mysql-server start

Step taken:

1) Check Error Log for mysql(in mysqldata/mysql/)
    # ee ----------------mysql.err
  
    ERROR start from this line:
    
120224 19:42:32 [ERROR] /usr/local/libexec/mysqld: unknown option '--skip-locking'

2) Try to find where the rules  '--skip-locking' stated

3) This rule stated in my.cnf located in mysql path
    # ee my.cnf

4) Comment the line like this
:    
port            = 3306
socket          = /tmp/mysql.sock
#skip-locking
key_buffer = 256M
:
:

5) Start the Mysql-Server command
    #/usr/local/etc/rc.d/mysql-server start

6) Check from some related command
    #ps ax     or
    #sockstat -4
    #top

7) Check in mysql path (mysqldata/mysql), pid file will auto created.
    -rw-rw----  1 mysql  mysql         6 Feb 27 10:36 thedomain.mysql-name-server.pid


FreeBSD Server: Change date

How to change server date in FreeBSD?

1) Check current server date
#date

2)Update correct date refering asia
#ntpdate asia.pool.ntp.org

3)Check again current date after update
#date

.