環(huán)境:虛擬機(jī)中分配的3個(gè)虛擬機(jī)系統(tǒng)分別為centos71,centos71蹲蒲,centos7-manager届搁。
設(shè)計(jì)如下centos71與centos72 分別作數(shù)據(jù)節(jié)點(diǎn)和sql節(jié)點(diǎn)。centos7-manager作為管理節(jié)點(diǎn)卡睦。
由于安裝時(shí)沒有選擇網(wǎng)絡(luò)么翰,導(dǎo)致虛擬機(jī)無法上網(wǎng)辽旋。解決辦法:
vim /etc/sysconfig/network-scripts/ifcfg-ens33?
將文件中
ONBOOT=no ? ??
改為
ONBOOT=yes
之后刷新network.service,即可上網(wǎng)
$ service network start
Starting network (via systemctl):? ? ? ? ? ? ? ? ? ? ? ? ? [? OK? ]
使用yum安裝,yum會(huì)自動(dòng)解決依賴問題码耐。
使用rpm的方式時(shí)候溶其,依賴問題需要自己解決(主要是缺少python-paramiko瓶逃,python2-crypto廓块。運(yùn)氣不好也會(huì)遇到‘Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-wUzz6E/pycrypto/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-RBAH0V-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-wUzz6E/pycrypto/’這樣的錯(cuò)誤)契沫。
由于新裝的Centos7系統(tǒng)需要更新
sudo yum update?? 或是 sudo yum upgrade
更新完成之后,配置yum的mysql的源拴清,在[mysql yum 源](https://dev.mysql.com/downloads/repo/yum/) 選擇與自己系統(tǒng)的合適的rpm文件会通。我下載的是Red Hat Enterprise Linux 7 / Oracle Linux 7.
$ sudo yum install mysql-cluster-community-server
...
No package mysql-cluster-community-server available.
這是因?yàn)閙ysql 源配置不成功造成的涕侈!
sudo rpm -Uhv mysql57-community-release-el7-11.noarch.rpm
出現(xiàn)
Updating / installing...
? 1:mysql57-community-release-el7-11 ################################# [100%]
說明安裝成功!
查看mysql的源信息
yum repolist? all? | grep mysql
$ sudo yum-config-manager? --disable mysql57-community
$ sudo yum-config-manager? --enable mysql-cluster-7.6-community
$ yum repolist? all? | grep mysql
$ sudo yum install mysql-cluste-community-server?
Error: Package: mysql-cluster-community-client-7.6.3-1.el7.x86_64 (mysql-cluster-7.6-community)
? ? ? ? ? Requires: perl(Class::MethodMaker)
Error: Package: akonadi-mysql-1.9.2-4.el7.x86_64 (@anaconda)
? ? ? ? ? Requires: mariadb-server
? ? ? ? ? Removing: 1:mariadb-server-5.5.56-2.el7.x86_64 (@anaconda)
? ? ? ? ? ? ? mariadb-server = 1:5.5.56-2.el7
? ? ? ? ? Obsoleted By: mysql-cluster-community-server-7.6.3-1.el7.x86_64 (mysql-cluster-7.6-community)
? ? ? ? ? ? ? Not found
以上的錯(cuò)誤主要是因?yàn)槲锤聀erl。根據(jù)[官網(wǎng)手冊(cè)](https://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/)給出的指導(dǎo)
el7中noarch.rpm無法下載窟哺。需要到[pkgs.org--perl](https://centos.pkgs.org/7/epel-x86_64/epel-release-7-11.noarch.rpm.html)下載配置epel-release-***.rpm即可且轨。在下載el7
$ wget http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm
下載成功后
$ rpm -Uhv epel-release-7-11.noarch.rpm
對(duì)于
Error: Package: akonadi-mysql-1.9.2-4.el7.x86_64 (@anaconda) Requires: mariadb-server Removing: 1:mariadb-server-5.5.56-2.el7.x86_64 (@anaconda) mariadb-server = 1:5.5.56-2.el7 Obsoleted By: mysql-cluster-community-server-7.6.3-1.el7.x86_64 (mysql-cluster-7.6-community) Not found
解決辦法
$ sudo yum erase mysql
$ sudo yum install mysql-cluste-community-server?
即可正確安裝虚婿!
安裝管理節(jié)點(diǎn)
$ sudo? yum install mysql-cluster-community-management-server
安裝數(shù)據(jù)節(jié)點(diǎn)
sudo yum install mysql-cluster-community-data-node
總結(jié):對(duì)于安裝mysql cluster 請(qǐng)參看[官方文檔](https://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/#repo-qg-yum-installing)