mysql-cluster安裝和部署
一>刪除以前安裝的內容
1 rpm -qa | grep mysql
2 find / -name mysql
3 重點是以前的資料檔案和庫檔案/usr/local、/var/lib。
二>安裝
yum install iptables-services -y
yum install -y perl perl-devel
yum remove mysql
rm -rf /var/lib/mysql
cp -f my.cnf /etc/
mkdir /usr/local/mysql
tar -zxvfmysql-cluster-gpl-7.4.6-linux-glibc2.5-x86_64.tar.gz
mvmysql-cluster-gpl-7.4.6-linux-glibc2.5-x86_64 /usr/local/mysql/mysqlc
vi /etc/passwd 檢視有沒有mysql使用者。
groupadd mysql
useradd mysql -g mysql
chown -R mysql:mysql /usr/local/mysql
cd /usr/local/mysql/mysqlc
scripts/mysql_install_db --user=mysql
這裡會出現問題:
[root@vmware-143 mysqlc]#scripts/mysql_install_db --user=mysql
FATAL ERROR: please install the followingPerl modules before executing scripts/mysql_install_db:
Data::Dumper
需要安裝yum install -y perl-Module-Install.noarch
mkdir /usr/local/mysql/bin
cp -f /usr/local/mysql/mysqlc/bin/ndbd /usr/local/mysql/bin
cp -f/usr/local/mysql/mysqlc/bin/ndb_mgm /usr/local/mysql/bin
cp -f /usr/local/mysql/mysqlc/bin/ndb_mgmd/usr/local/mysql/bin
mkdir /usr/local/mysql/etc
cd /usr/local/my_cluster_step/
cp -f config.ini /usr/local/mysql/etc/
cp -f/usr/local/mysql/mysqlc/support-files/mysql.server /etc/init.d/mysqld
三>配置
1 my.cnf 修改裡的ip為管理節點的ip。
cp -f my.cnf /etc/
2 config.ini
cp -f config.ini /usr/local/mysql/etc/
四>啟動
1 啟動管理節點
cd /usr/local/mysql/bin
/usr/local/mysql/bin/ndb_mgmd -f/usr/local/mysql/etc/config.ini –initial
2 啟動ndb節點
cd /usr/local/mysql/bin/
sh ndbd –initial
3 啟動mysql節點
service mysqld start
五>訪問配置
1
[root@vmware-142 bin]# mysql -u root
ERROR 2002 (HY000): Can't connect to localMySQL server through socket '/tmp/mysql.sock' (2)
解決方法:
ln -s /usr/local/mysql/mysqlc/mysql.sock/tmp/mysql.sock
或者
mysql -uroot -p -S/usr/local/mysql/mysqlc/mysql.sock
2 進入mysql後,
mysql> use mysql;
mysql> UPDATE user SET Password = PASSWORD('newpass') WHERE user= 'root';
mysql> FLUSH PRIVILEGES;
3 訪問
1)is not allowed toconnect to this MySQL server
可能是防火牆的問題
iptables -I INPUT -ptcp --dport 3306 -j ACCEPT
service iptables restart
不能重啟,重啟就不能訪問了。
serviceiptables stop 停止防火牆
方法二:開啟vim/etc/sysconfig/iptables 新增所需配置的埠-A INPUT -p tcp -mstate --state NEW -m tcp --dport 3306 -j ACCEPT
2)can not connect to mysql server on 10038
相關文章
- CentOS 6.5上安裝MySQL-Cluster 7.3.4過程筆記CentOSMySql筆記
- kettle的安裝和部署
- hbase和zookeeper的安裝和部署
- MHA安裝和部署步驟
- Linux Haproxy 安裝和部署Linux
- Dubbo-zookeeper的部署和安裝
- Glassfish下的openCMS安裝和部署
- MySQL-ClusterMySql
- Oracle 19C的下載和安裝部署(圖形安裝和靜默安裝)Oracle
- ClickHouse(03)ClickHouse怎麼安裝和部署
- docker安裝部署djanggo和pythonDockerGoPython
- Zabbix安裝部署
- canal安裝部署
- Doris安裝部署
- greenplum安裝部署
- SQLT 安裝部署SQL
- ZooKeeper 安裝部署
- Dubbo安裝部署
- Zookeeper安裝部署
- ELK安裝部署
- chromedriver安裝部署Chrome
- redis sentinel哨兵模式安裝部署和切換Redis模式
- GlassFish安裝下載和Eclipse熱部署Eclipse熱部署
- Centos7安裝安裝部署dockerCentOSDocker
- SQOOP安裝部署OOP
- Oozie--安裝部署
- Apache Ranger安裝部署ApacheRanger
- Hive 3.1.2安裝部署Hive
- Saltstack基本安裝部署
- RocketMQ安裝及部署MQ
- flume的安裝部署
- Linux安裝部署Linux
- Hive的安裝部署Hive
- Redis之安裝部署Redis
- cloudstack +xenserver 安裝部署CloudServer
- 安裝部署VMware VCenter
- 安裝go 1.5 & 部署Go
- Hadoop 安裝部署Hadoop