mysql cluster 的Yum安裝及配置(1)

環(huán)境:虛擬機中分配的3個虛擬機系統(tǒng)分別為centos71,centos71,centos7-manager。

設(shè)計如下centos71與centos72 分別作數(shù)據(jù)節(jié)點和sql節(jié)點。centos7-manager作為管理節(jié)點。

由于安裝時沒有選擇網(wǎng)絡(luò),導(dǎo)致虛擬機無法上網(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會自動解決依賴問題。

使用rpm的方式時候,依賴問題需要自己解決(主要是缺少python-paramiko,python2-crypto。運氣不好也會遇到‘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/’這樣的錯誤)。

由于新裝的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.

這是因為mysql 源配置不成功造成的!

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

以上的錯誤主要是因為未更新perl。根據(jù)[官網(wǎng)手冊](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

對于

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é)點

$ sudo? yum install mysql-cluster-community-management-server

安裝數(shù)據(jù)節(jié)點

sudo yum install mysql-cluster-community-data-node

總結(jié):對于安裝mysql cluster 請參看[官方文檔](https://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/#repo-qg-yum-installing)

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容