Wednesday, October 5, 2011

Mangento exporting SQL issue

While exporting mySQL if you every get into the problem]

ERROR 1064 (42000) at line 688: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USING BTREE,
  KEY `FK_CATALO' at line 9

and the mySQL is 
UNIQUE KEY `IDX_BASE` (`entity_type_id`,`entity_id`,`attribute_id`,`store_id`) USING BTREE

You need to replace all such instance by 

UNIQUE KEY `IDX_BASE` USING BTREE(`entity_type_id`,`entity_id`,`attribute_id`,`store_id`)

Tuesday, October 4, 2011

How to making Linux multihomed to connect to 2 ISP

To make my Ubuntu Server on more robust I have connected it to 2 ISP so that I can have redundant last mile. Also one of my ISP gives me unlimited bandwidth while the other is costlier but more reliable.

To make your linux server multihomed, I am assuming that you have atleast 2 network interfaces. In my case both are ethernet (eth0 and eth1)

Make sure both the networks are working individually up by setting it on /etc/network/interface
sudo vi /etc/network/interface

auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
        metric 100

auto eth1
iface eth1 inet static
        metric 200

Now if you go to your terminal, you should be able to
>ip route show dev eth1  proto kernel  scope link  src dev eth0  proto kernel  scope link  src
default via dev eth0  metric 100
default via dev eth1  metric 200

With this if your eth0 goes down, your eth1 will take over and vice-versa.
But this is still a long way from making your network multihoned where your can do load balancing.

All you need to do is to add  multihop route in your /etc/rc.local
ip route append default scope global nexthop via dev eth0 weight 5 nexthop via dev eth1 weight 1

USB for Ubuntu Server

Ubuntu Server does not come with auto-mount for USB.
You will need to install the light weight usbmount

sudo apt-get install usbmount