Thursday, November 29, 2012

[Centos Linux] Configure Network interface : eth0/1

1. to bring a network card up :: 
shell> /sbin/ifconfig eth0 up

2. configure the network card from the following location::::

shell> /etc/sysconfig/network-scripts/ifcfg-<interface-name>

IPADDR=10.10.29.66
NETMASK=255.255.255.192
ONBOOT=yes

3. configure network file

shell> vi /etc/sysconfig/network
NETWORKING=yes
GATEWAY=10.10.29.65

4. Afterward, you may restart the network by execute the following command

shell>/sbin/service network restart

Tuesday, September 11, 2012

MySQL Replication Error: Error_code: 1205; handler error HA_ERR_LOCK_WAIT_TIMEOUT


Environment: MySQL Replication Slave Server
Error:
Could not execute Update_rows event on table
; Lock wait timeout exceeded; try restarting transaction, Error_code: 1205; handler error HA_ERR_LOCK_WAIT_TIMEOUT; the event's master log mysql-bin.003169, end_log_pos 1006784578

Solution:
Shall you face any issue as above when you execute mysql>show slave status;
the solution is as simple as following
shell> stop slave;
shell> start slave;

Wednesday, August 22, 2012

hyperic agent behind firewall

If a hyperic agent is setup behind a firewall, however the hyperic server is setup not within the firewall.
Please open/allow the "RPC" services in the firewall rules.
The hyperic agent need it to contact to the hyperic server.

Tuesday, July 10, 2012

uninstall mysql in linux - via RPM

If you would like to uninstall MySQL server from your redhat/centos linux using RPM, following the below steps:

1. Double confirm if Mysql is install via RPM, command as follow
Shell> rpm -qa | grep -i mysql

Expecting output result as following

Output 1:
Shell> rpm -qa | grep -i mysql

MySQL-devel-x.x.xx-1.rhel5
MySQL-test-x.x.xx-1.rhel5
MySQL-server-x.x.xx-1.rhel5
MySQL-client-x.x.xx-1.rhel5
MySQL-shared-x.x.xx-1.rhel5
MySQL-shared-compat-x.x.xx-1.rhel5
MySQL-embedded-x.x.xx-1.rhel5

2. If you are getting similar OUTPUT 1 as your result from step 1, you may run the following command to completely remove the MYSQL from your redhat/centos linux
shell> rpm -e MySQL-*

3. After your step 2, you are expecting to already removed the MySQL installation.
you may check if your MySQL data directory (datadir) is still there. Normal MySQL data directory (datadir) locate at /var/lib//mysql






Thursday, May 17, 2012

apache running services - lt-httpd -k start -DSSL

a weird case i ever experience today, maybe it sounds weird to me only.
a normal running apache server would have the following output(Output1), when you run linux command shell> ps -ef | grep httpd

Output1:
root      1373     1  0 15:34 ?        00:00:00 /usr/sbin/.libs/lt-httpd -k start -DSSL
apache    1375  1373  0 15:34 ?        00:00:00 /usr/sbin/.libs/lt-httpd -k start -DSSL
apache    1376  1373  0 15:34 ?        00:00:00 /usr/sbin/.libs/lt-httpd -k start -DSSL
apache    1377  1373  0 15:34 ?        00:00:00 /usr/sbin/.libs/lt-httpd -k start -DSSL
apache    1378  1373  0 15:34 ?        00:00:00 /usr/sbin/.libs/lt-httpd -k start -DSSL
apache    1379  1373  0 15:34 ?        00:00:00 /usr/sbin/.libs/lt-httpd -k start -DSSL
root      1387 26065  0 15:34 pts/6    00:00:00 grep httpd


My Case:
However, i only have following output (Output2), when i run linux command shell> ps -ef | grep httpd

Output2:
apache   30008     1  0 Mar27 ?        00:00:00 /usr/sbin/.libs/lt-httpd -k start -DSSL


When i try to restart the apache server via command shell> /sbin/service httpd restart 
i get the following error show (Output3),

Output3:
Stopping httpd:                                            [FAILED]
Starting httpd: [Thu May 17 14:47:56 2012]
(98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs


Solution:
The lt-httpd service is part of the Apache server's service, hence i make up the decision to kill the process shell> kill 30008
After the process being killed, i'm able to start and stop my apache server again.

Explanation:
The reason of why only one and the only "/usr/sbin/.libs/lt-httpd -k start -DSSL" in the services list, if because due to the incomplete startup of the apache server after the physical server restart. Which then had causing the port 80 being hold by the handicapped apache service.
Because the restart features of the apache not able to shutdown the handicapped apache service, hence it always throw exceptions/error when you trying to restart/stop the apache server.

*Welcome any comments to share your point of view. Thanks very much.







Wednesday, May 9, 2012

how to check in linux if port is occupied?

shell> netstat -a | grep <portno>

result should be somethings similar as following
_________________________________________________________________________________
unix  3      [ ]         STREAM     CONNECTED     3821446054 /var/run/dovecot/login/default
unix  3      [ ]         STREAM     CONNECTED     3821446052
unix  3      [ ]         STREAM     CONNECTED     3821446037
unix  3      [ ]         STREAM     CONNECTED     3821446036
unix  3      [ ]         STREAM     CONNECTED     3821442460 /var/run/dovecot/login/default
unix  3      [ ]         STREAM     CONNECTED     3821442450
unix  3      [ ]         STREAM     CONNECTED     3821442430
unix  3      [ ]         STREAM     CONNECTED     3821442429
________________________________________________________________________________




Wednesday, February 8, 2012

Wednesday, January 18, 2012

Safely rename a database command

 shell> mysqladmin -u root -pXXXX create spm_new
shell> mysqldump -u root -pXXXXX SPM
| mysql -u root -pXXXX spm_new &
 first, create the new database (with no tables)
 secondly, use mysqldump to dump from the original database to the new db. if you connect remotely into the server. Please do allow the mysqldump process to run in background by adding  "&" 
 

Tuesday, January 10, 2012

MySQL Replication - slave status showing LastSQLError

If you would need to skip the SQL command from reflect into the slave server, do as following

STEPS:
1. mysql> stop slave;
2. mysql>SET GLOBAL sql_slave_skip_counter = 1;
3. mysql> start slave;

you should be able to see the slave process change into healthy state again.

Monday, January 9, 2012

MySQL - ERROR 13 (HY000): Can't get stat of '/mnt/sharing/success_20111201.csv' (Errcode: 13)

I was tried to restore the CSV file into one of my table, however i face the following error

ERROR 13 (HY000): Can't get stat of '/mnt/sharing/<file>.csv' (Errcode: 13)

Follow the following solution to solve your issue,
1. move the file into a location where your "mysql" user have the permission to read and write
2. in your mysql shell ( after you had login MySQL server via mysql client )
  e.g:
  mysql > load data local infile '/tmp/success_20111201.csv' into table `nplay_temp`.`sms_out_message` fields terminated by '\t' optionally enclosed by '"' lines terminated by '\n' (`id`, `nplay_user_id`, `price`, `is_ucs`, `creation_date`, `last_modified`, `wappush_link`, `retry_count`, `msisdn`, `message`, `delivered_time`, `state`, `mcc`, `operator_code`, `service_name`, `action`, `ticket_id`, `scheduled_time`, `short_code`, `charge_msisdn`, `meta_data`)


Thursday, January 5, 2012

to repair a corrupted myisam table

first, to make sure the table not in use.

you may use the mysql client utility ready by mysql server installation "mysqlcheck" to do the repair 
sample command as follow:

shell> mysqlcheck -u <user_name> -p<password> --auto-repair <database_name> <table_name> &