- 論壇徽章:
- 0
|
本帖最后由 starive 于 2014-11-05 14:25 編輯
本人下載了MySQL cluster 7.3.7 (下載地址:http://dev.mysql.com/downloads/cluster/) 二進(jìn)制版本。本人參考博客:http://blog.itpub.net/26230597/viewspace-1087713/ 進(jìn)行安裝,目前已經(jīng)在管理節(jié)點(diǎn)和數(shù)據(jù)節(jié)點(diǎn)安裝好了Cluster。但是在 SQL節(jié)點(diǎn)上安裝Cluster就出現(xiàn)了問題。
SQL 節(jié)點(diǎn)安裝步驟如下:
解壓文件
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
添加權(quán)限
shell>chown -R mysql:mysql /usr/local/mysql
拷貝配置文件
shell>cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf
初始化數(shù)據(jù)庫
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, 其內(nèi)容如下:
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
完全符合網(wǎng)上所說“要添加 127.0.0.1 localhost到/etc/hosts文件中“。最后一行”172.3.200.159“是本人的ip地址。
解決方法2:
修改 ~/.bashrc文件的內(nèi)容:
vi ~/.bashrc
export PATH=/usr/local/mysql/bin PATH
source ~/.bashrc
重新啟動機(jī)器,重新執(zhí)行命令:scripts/mysql_install_db --user=mysql
出現(xiàn)了如下錯誤:
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.
又參考網(wǎng)頁: http://blog.sina.com.cn/s/blog_546cc4350101g1pj.html
執(zhí)行命令:/usr/local/mysql/scripts/mysql_install_db –user=mysql –basedir=/usr/local/mysql –datadir=/usr/local/mysql/data &
又出現(xiàn)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
采用以上兩種方法,仍然無法解決問題,到底該如何解決了???
本人仔細(xì)看了博客http://blog.itpub.net/26230597/viewspace-1087713/的安裝方法,和博客的方法只有以下兩個區(qū)別:
區(qū)別:
博客是 mysql-cluster-gpl-7.2.4-linux2.6-x86_64.tar.gz
我的是 mysql-cluster-gpl-7.3.7-linux-glibc2.5-i686.tar.gz
一個64位,一個32位
博客的是 linux2.6, 我的是linux-glibc2.5
其實(shí),這個問題在這臺機(jī)器(后面簡稱主機(jī)C)上不是第一次出現(xiàn)了。因?yàn)槲乙罱╩ysql集群,所以首先在 三臺機(jī)器上面都安裝上了mysql。不過安裝環(huán)境有區(qū)別: 主機(jī)A的環(huán)境是:Win7下的VirtualBox + Ubuntu + MySQL, 主機(jī)B的環(huán)境是:Win7下的VirtualBox + Ubuntu + MySQL, 主機(jī)C的環(huán)境是:Ubuntu系統(tǒng) + MySQL。主機(jī)C的系統(tǒng)直接在機(jī)器上面安裝的,不是虛擬環(huán)境,安裝方法:wubi安裝。
最開始在三臺主機(jī)分別安裝MySQL時,主機(jī)A和主機(jī)B都能順利安裝,但是主機(jī)C上面安裝有問題,出現(xiàn)的問題跟現(xiàn)在搭建cluster的問題一模一樣(詳見我發(fā)布的帖子: http://www.itpub.net/thread-1894039-1-1.html)
為什么每次在主機(jī)C上面執(zhí)行 scripts/mysql_install_db --user=mysql, 都會出現(xiàn)這種錯誤了,難道是因?yàn)槲抑苯影惭bUbuntu的原因嗎,還是Wubi安裝帶來的bug??? 這個難題都困惱我半個月了,在stackoverflow,itpub和csdn上面都沒有人能解答???
請告訴幫忙解答,謝謝! |
|