本人下载了MySQL cluster 7.3.7 (下载地址:
http://dev.mysql.com/downloads/cluster/) 二进制版本。本人参考博客:
http://blog.itpub.net/26230597/viewspace-1087713/ 进行安装,目前已经在管理节点和数据节点安装好了Cluster。
但是在 SQL节点上安装Cluster就出现了问题。
SQL 节点安装步骤如下:
解压文件
shell>tar -zxvf mysql-cluster-gpl-7.3.7-linux-glibc2.5-i686.tar.gz
拷贝安装文件
shell>mv /home/David/cluster/mysql-cluster-gpl-7.3.7-linux2.6-x86_64 /usr/local/mysql
添加mysql用户
shell>groupadd mysql
shell>useradd -g mysql mysql
添加权限
shell>chown -R mysql:mysql /usr/local/mysql
拷贝配置文件
shell>cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf
初始化数据库
shell>cd /usr/local/mysql
shell>scripts/mysql_install_db --user=mysql
报错:
sh: 1: ./bin/my_print_defaults: not found
FATAL ERROR: Neither host 'ubuntu' nor 'localhost' could be looked up with
./bin/resolveip
Please configure the 'hostname' command to return a correct
hostname.
If you want to solve this at a later stage, restart this script
with the --force option
本人采用了如下方法来解决:
解决方法1:
查看 /etc/hosts, 其内容如下:
127.0.0.1 localhost
127.0.1.1 ubuntu
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
127.0.0.1 localhost,localhost.localdomain
172.3.200.159 localhost,localhost.locqaldomain
完全符合网上所说“要添加 127.0.0.1 localhost到/etc/hosts文件中“。最后一行”172.3.200.159“是本人的ip地址。
解决方法2:
修改 ~/.bashrc文件的内容:
vi ~/.bashrc
export PATH=/usr/local/mysql/bin:$PATH
source ~/.bashrc
重新启动机器,重新执行命令:scripts/mysql_install_db --user=mysql
出现了如下错误:
FATAL ERROR: Could not find ./bin/my_print_defaults
If you compiled from source, you need to run 'make install' to
copy the software into the correct location ready for operation.
If you are using a binary release, you must either be at the top
level of the extracted archive, or pass the --basedir option
pointing to that location.
又参考网页: http://blog.sina.com.cn/s/blog_546cc4350101g1pj.html
执行命令:/usr/local/mysql/scripts/mysql_install_db –user=mysql –basedir=/usr/local/mysql –datadir=/usr/local/mysql/data &
又出现error:
root@ubuntu:/usr/local/mysql/bin# /usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data &
[1] 2264
root@ubuntu:/usr/local/mysql/bin# sh: 1: /usr/local/mysql/bin/my_print_defaults: not found
FATAL ERROR: Neither host 'ubuntu' nor 'localhost' could be looked up with
/usr/local/mysql/bin/resolveip
Please configure the 'hostname' command to return a correct
hostname.
If you want to solve this at a later stage, restart this script
with the --force option
采用以上两种方法,仍然无法解决问题,到底该如何解决了???
请告诉帮忙解答,谢谢!