Install Mysql cluster on Fedora box

Each MySQL Cluster host computer running an SQL node must have installed on it a MySQL. For management nodes and data nodes,
it is not necessary to install the MySQL server binary,
but management nodes require the management server daemon (ndb_mgmd) and data nodes require the data node daemon (ndbd).

It is also a good idea to install the management client (ndb_mgm) on the management server host.
This section covers the steps necessary to install the correct binaries for each type of Cluster node.

Important Note:
If you have mysql installed already than remove that from computer using following command
[root@localhost siwan]# yum remove mysql mysql-server mysql-libs mysql-common

Open http://dev.mysql.com/downloads/
click on * MySQL Cluster url:
http://dev.mysql.com/downloads/select.php?id=14
Scoll down,
Under “Current Realeases” section
You will see the following text;
MySQL Cluster 7.0.8a GA
Select the Red Hat Enterprise Linux here and download following packages.

Select Operating System: Red Hat Enterprise Linux
As per linux edition(4 and 5) and computer and Os comptable(64bit or 32bit download the RPMs
I am using the Fedora 11 as OS and 32bit Intel machine.
I used or downloaded following RPM files from above URL:
MySQL-Cluster-gpl-debuginfo-7.0.8a-0.rhel5.i386.rpm
MySQL-Cluster-gpl-embedded-7.0.8a-0.rhel5.i386.rpm
MySQL-Cluster-gpl-server-7.0.8a-0.rhel5.i386.rpm
MySQL-Cluster-gpl-7.0.8a-0.rhel5.src.rpm
MySQL-Cluster-gpl-7.0.8a-0.sles11.src.rpm
MySQL-Cluster-gpl-devel-7.0.8a-0.rhel5.i386.rpm
MySQL-Cluster-gpl-tools-7.0.8a-0.rhel5.i386.rpm
MySQL-Cluster-gpl-test-7.0.8a-0.rhel5.i386.rpm
MySQL-Cluster-gpl-client-7.0.8a-0.rhel5.i386.rpm
MySQL-Cluster-gpl-extra-7.0.8a-0.rhel5.i386.rpm
MySQL-Cluster-gpl-storage-7.0.8a-0.rhel5.i386.rpm
MySQL-Cluster-gpl-shared-7.0.8a-0.rhel5.i386.rpm
MySQL-Cluster-gpl-management-7.0.8a-0.rhel5.i386.rpm

SQL node installation — RPM files. On each machine to be used for hosting a cluster SQL node, install the Server RPM by executing the following command as the system root user, replacing the name shown for the RPM as necessary to match the name of the RPM downloaded from the MySQL web site:

How to repeat:
Make sure you have nothing in /var/lib/mysql and /var/lock/subsys/mysql.
The do :
rpm -i MySQL-client-5.1.25-0.glibc23.x86_64.rpm MySQL-server-5.1.25-0.glibc23.x86_64.rpm

[root@localhost MysqlClusterSoft]# rpm -iv MySQL-Cluster-gpl-*

Forcely install the above rpms again, for that use following command.
[root@localhost MysqlClusterSoft]# rpm -ivh –force MySQL-Cluster-gpl-server-7.0.8a-0.rhel5.i386.rpm

Following command you can use for uninstall the Mysql cluster.
[root@localhost MysqlClusterSoft]# rpm -e -F MySQL-Cluster-gpl-*

[root@localhost MysqlClusterSoft]# yum install mysql mysql-server

[root@localhost MysqlClusterSoft]# rpm -Uhv MySQL-Cluster-gpl-server-7.0.8a-0.rhel5.i386.rpm
Preparing… ########################################### [100%]
1:MySQL-Cluster-gpl-serve########################################### [100%]
091113 17:05:13 [Warning] Forcing shutdown of 3 plugins
091113 17:05:13 [Warning] Forcing shutdown of 3 plugins

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password ‘new-password’
/usr/bin/mysqladmin -u root -h localhost.localdomain password ‘new-password’

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.

See the manual for more instructions.

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available at http://www.mysql.com/
Support MySQL by buying support/licenses from http://shop.mysql.com/

[root@localhost MysqlClusterSoft]#

[root@localhost MysqlClusterSoft]# rpm -Uhv MySQL-Cluster-gpl-client-7.0.8a-0.rhel5.i386.rpm
Preparing… ########################################### [100%]
package MySQL-Cluster-gpl-client-7.0.8a-0.rhel5.i386 is already installed

After all installtion Please reboot the machine. and Run the nbdb server and load the sample data.
Use following article…
http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-multi-load-data-queries.html

Force remove the rpm from linux box

I installed the Mysql-cluster on fedora11 box.
When I tried the wordpress local setup on by box I got following error.
Your PHP installation appears to be missing the MySQL extension which is required by WordPress.”

I used the noraml command for uninstalling the rpm package.
#rpm -e PACKAGE_NAME
I tried so many things but failed. Nothing is removed. Then I tried this command. I still got following result.

#yum list Mysql*.*
Installed Packages
MySQL-Cluster-gpl-debuginfo.i386 7.0.8a-0.rhel5 installed
MySQL-Cluster-gpl-extra.i386 7.0.8a-0.rhel5 installed
MySQL-Cluster-gpl-management.i386 7.0.8a-0.rhel5 installed
MySQL-Cluster-gpl-server.i386 7.0.8a-0.rhel5 installed
MySQL-Cluster-gpl-shared.i386 7.0.8a-0.rhel5 installed
MySQL-Cluster-gpl-storage.i386 7.0.8a-0.rhel5 installed
MySQL-Cluster-gpl-tools.i386

I tried the following commands…
#yum remove MySQL-Cluster-gpl-shared
This really worked…Yes this is final solution.

[root@localhost siwan]# yum install mysql mysql-server php-mysql mysql-common mysql-libs

[root@localhost siwan]# /etc/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: httpd: Could not reliably determine the server’s fully qualified domain name, using localhost.localdomain for ServerName

This will solved your problem. Following links I found usefull:

http://www.rikers.org/rpmbook/node18.html
http://www.rikers.org/rpmbook/node20.html
http://www.rikers.org/rpmbook/node19.html

solved – bash: phpize: command not found

This error is due to “phpize” command not available on your server.

To fix, install php-devel package.

If your server have yum (Eg: Fedora)

[root@localhost siwan]# phpize
bash: phpize: command not found
[root@localhost siwan]# yum -y install php-devel

[root@localhost siwan]# phpize
Cannot find config.m4.
Make sure that you run ‘/usr/bin/phpize’ in the top level source directory of the module

[root@localhost siwan]#
How to install the eaccelerator on fedora9?
use follwoing command

[root@localhost siwan]# yum install php-eaccelerator

How to install and setup varnish on fedora9

Varnish is an HTTP accelerator designed for content-heavy dynamic web sites. In contrast to other HTTP accelerators, many of which began life as client-side proxies or origin servers, Varnish was designed from the ground up as an HTTP accelerator.

Use following command:
[root@localhost siwan]# su
[root@localhost siwan]# yum install varnish
ncurses are needed for textual “graphical” configuration.
[root@localhost siwan]# yum install ncurses-devel

Edit the setting of varnish
[root@localhost siwan]# vim /etc/varnish/default.vcl

Start the varnish.
[root@localhost varnish]# /etc/init.d/varnish start

on startup set varnish on
[root@localhost varnish]# /sbin/chkconfig varnish on

Software for making diagram or flowchart in fedora

Aftter doning some R&D I found some flowchart and open source graphics softwares.
I installed on my Fedora9. Gimp is like photoshop but I do not find that as good as Photoshop.

1. inkscape
Features: An Open Source vector graphics editor, with capabilities similar to Illustrator, CorelDraw,
or Xara X, using the W3C standard Scalable Vector Graphics (SVG) file format.
Installation command
[root@localhost siwan]# yum install inkscape
Site Url: http://www.inkscape.org/index.php

2. Dia
Features:Dia is a program for creating diagrams of all kinds. It can create many types of diagrams, including UML, network and flowchart diagrams. The engine is very flexible and dynamically loads diagram-types from disk. Dia can also print diagrams and export tham to a number pf formats including EPS, SVG, and PNG
Installation command
[root@localhost siwan]# yum install dia
Site Url:http://live.gnome.org/Dia

How to use hosts file on Mac, Windows and Linux

The hosts file is a computer file used by an operating system to map hostnames to IP addresses.
On many operating systems, the host file content is used preferentially over other methods,
such as the Domain Name System (DNS). Unlike DNS, the hosts file is under the control of the local computer’s administrator

Locate the file “Hosts” on your computer:
Windows
Windows 95/98/Me c:\windows\hosts
Windows NT/2000/XP Pro c:\winnt\system32\drivers\etc\hosts
Windows XP Home c:\windows\system32\drivers\etc\hosts

Linux
/etc/hosts or /etc/host.conf or /etc/nsswitch.conf

Symbian
C:\system\data\hosts

Mac OS
/private/etc/hosts or /etc/hosts

In that file you can edit entry like this

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost localhost yourlocaldomain.com , example.com
::1 localhost6.localdomain6 localhost6
192.168.2.200 intranet

directory.example.com 71.155.186.91

How to setup mongrel cluster setup on fedora

First install the following gems:
#su
#gem install mongrel
#gem install mongrel_cluster
#cd project_name
#mongrel_rails cluster::configure -e production -p 3000 -N 3 -c /home/siwan/project_name -a 127.0.0.1 —-prefix /project_name
# mongrel_rails cluster::start

You are able to start your applicaton at http://127.0.0.1:3000, http://127.0.0.1:3001 and http://127.0.0.1:3002

for all the cluster
# mongrel_rails cluster::stop

Advanced prepairation for production realeaze
$ mkdir /etc/mongrel_cluster

#vim /etc/mongrel_cluster/project_name.yml
copy and paste following text;
user: project_name
cwd: //home/siwan/project_name
log_file: /home/siwan/project_name/mongrel.log
port: “3000”
environment: production
group: dev
address: localhost
pid_file: /home/siwan/project_name/tmp/pids/mongrel.pid
servers: 3

or you can run the following command

or copy and paste the content from config/mongrel_cluster.yml file to /etc/mongrel_cluster/project_name.yml

# ln -s /home/siwan/project_name/config/mongrel_cluster.yml /etc/mongrel_cluster/project_name.yml

Then open your httpd.conf file for apache configration:

<Proxy balancer://project_name>
BalancerMember http://127.0.0.1:3000
BalancerMember http://127.0.0.1:3001
BalancerMember http://127.0.0.1:3002
</Proxy>

<VirtualHost *:80>
ProxyPreserveHost On
# Avoid open you server to proxying
ProxyRequests Off
# Options +FollowSymLinks
RewriteEngine On

RewriteRule ^/(images|stylesheet|javascript|html)/?(.*) /home/siwan/project_name/public/$0 [L]
ServerAdmin siwan@yahoo.co.in
DocumentRoot /home/project_name/
ServerName example.com
RewriteRule  ^/(.*)$  balancer://project_name%{REQUEST_URI} [P,QSA,L]
</VirtualHost>

Restart the apache server
#/etc/init.d/httpd restart

Command for restart the mongrel servers from any where
# mongrel_rails cluster::restart -C /etc/mongrel_cluster/project_name.yml

How to install mysql-connector-java / mysql-connector-odbc on fedora

I am using the Fedora9 for installation
I downloaded rmp file from this location.
http://rpm.pbone.net/index.php3/stat/4/idpl/7221422/com/mysql-connector-java-3.1.12-5.fc9.i386.rpm.html

If you are using the fedora 10 or 11, you can use this url;
http://www.rpmfind.net/linux/rpm2html/search.php?query=mysql-connector-java&submit=Search+…&system=fedora+9&arch=

[siwan@localhost ]$ su
Password:
[root@localhost ]# rpm -Uvh mysql-connector-java-3.1.12-5.fc9.i386.rpm
Preparing… ########################################### [100%]
1:mysql-connector-java ########################################### [100%]
[root@localhost ]#

how to install mysql-connector-odbc on fedora

I downloaded rmp file from this location.
http://rpm.pbone.net/index.php3?stat=3&search=mysql-connector-odbc&srodzaj=3

[root@localhost Desktop]# rpm -Uvh mysql-connector-odbc-3.51.24r1071-1.fc9.i386.rpm
Preparing… ########################################### [100%]
1:mysql-connector-odbc ########################################### [100%]
[root@localhost Desktop]#