日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

mysql cluster linux_【完美】Mysql-cluster数据库集群搭建(linux)

發布時間:2024/7/5 数据库 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 mysql cluster linux_【完美】Mysql-cluster数据库集群搭建(linux) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

介紹

《Mysql-cluster數據庫集群介紹》

安裝系統:Linux CentOS7.4查看是否安裝mysqlrpm -qa | grep mysql普通刪除rpm -e mysql強力刪除rpm -e --nodeps mysql通過wget安裝wget?https://dev.mysql.com/get/Downloads/MySQL-Cluster-7.5/mysql-cluster-gpl-7.5.8-linux-glibc2.12-x86_64.tar.gz(如果沒有安裝wget,執行yum -y install wget)解壓tar xvf?mysql-cluster-gpl-7.5.8-linux-glibc2.12-x86_64.tar.gz新建文件夾(用于NDB)mkdir?/usr/local/mysql-clustermkdir?/usr/local/mysql-cluster/logsmkdir?/usr/local/mysql-cluster/data(用于Mysql)mkdir/usr/local/mysqlmkdir/usr/local/mysql/datamkdir/usr/local/mysql/data/mysql一句話:mkdir/usr/local/mysql-cluster?/usr/local/mysql-cluster/logs?/usr/local/mysql-cluster/data/usr/local/mysql/usr/local/mysql/data?/usr/local/mysql/data/mysql復制程序cp??mysql-cluster-gpl-7.5.8-linux-glibc2.12-x86_64/bin/ndb_mgm* /usr/local/mysql-clustercp??mysql-cluster-gpl-7.5.8-linux-glibc2.12-x86_64/bin/ndbd /usr/local/mysql-clustercp -r?mysql-cluster-gpl-7.5.8-linux-glibc2.12-x86_64/.?/usr/local/mysql管理節點配置新建配置文件vi??/usr/local/mysql-cluster/config.ini------------------------------------------------------------------[ndbd default]

NoOfReplicas=1

DataMemory=6144M

IndexMemory=1024MStopOnError=0StringMemory=5MMaxNoOfConcurrentTransactions=100000MaxNoOfConcurrentOperations=110000MaxNoOfLocalOperations=250000MaxNoOfConcurrentIndexOperations=81920MaxNoOfConcurrentScans=256MaxNoOfLocalScans=1000MaxNoOfOpenFiles=1000MaxNoOfAttributes=10000ODirect=1MaxNoOfTables=20320MaxNoOfOrderedIndexes=2048MaxNoOfUniqueHashIndexes=2048

[ndb_mgmd]NodeId=1

HostName=192.168.1.1

DataDir=/usr/local/mysql-cluster/logs

[ndbd]

NodeId=2HostName=192.168.1.1

DataDir=/usr/local/mysql-cluster/data

[mysqld]NodeId=3

HostName=192.168.1.1

[ndbd]NodeId=4

HostName=192.168.1.2

DataDir=/usr/local/mysql-cluster/data

[mysqld]NodeId=5

HostName=192.168.1.2[mysqld]-------------------------------------------------------------------開始編輯? insert鍵

退出編輯? esc鍵

保存退出? :wq

強制退出? :q!數據節點配置

touch /usr/local/mysql/error.log

touch /usr/local/mysql/mysql.pidvi/usr/local/mysql/support-files/my-default.cnf--------------------------------------------------------------------[mysqld]

basedir = /usr/local/mysql

datadir = /usr/local/mysql/data/mysqlpid-file = /usr/local/mysql/mysql.pid

log-error = /usr/local/mysql/error.log

user = root

port = 3306tmp_table_size = 256Mmax_heap_table_size = 256Mndbclusterndb-connectstring=192.168.1.1

[mysql_cluster]

ndb-connectstring=192.168.1.1

[ndbd]

ndb-connectstring=192.168.1.1[mysql_safe]log-error = /usr/local/mysql/error.log--------------------------------------------------------------------cp?/usr/local/mysql/support-files/my-default.cnf /etc/my.cnf

啟動管理節點/usr/local/mysql-cluster/ndb_mgmd --configdir=/usr/local/mysql-cluster -f /usr/local/mysql-cluster/config.ini --initial --reload/usr/local/mysql-cluster/ndb_mgm -e show(查看和管理)/usr/local/mysql-cluster/ndb_mgm -e shutdown(關閉集群)/usr/local/mysql-cluster/ndb_mgm -eexit(退出)數據節點/usr/local/mysql-cluster/ndbd --initialSQL節點新增用戶組mysql和用戶msyqlgroupadd mysqluseradd -g mysql mysql#(如果沒有權限,可登錄root去新增)cd /usr/local/mysql#修改文件權限chown -R mysql:mysql ./#初始化mysqlbin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data/mysql(如果data ..有數據則新建data和data/mysql)出現以下信息則標示成功[Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID:82246b8e-e62b-11e7-b5ad-000c29aa8807.

[Note] A temporary password is generated for root@localhost:hWuJyniWd3,.記下UUID和密碼#復制mysql到服務自動啟動里面

cp support-files/mysql.server /etc/init.d/mysqld#修改權限為755 也就是root可以執行

chmod 755 /etc/init.d/mysqld#復制配置文件到etc下,因為默認啟動先去etc下加載配置文件

cp support-files/my-default.cnf /etc/my.cnf啟動,重啟,停止mysql服務service mysqld startservice mysqld restartservice mysqld stop查看mysql是否已啟動/etc/rc.d/init.d/mysqld status

linux下mysql錯誤Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)點擊鏈接查看解決方案-------------------------------------------------------------Your password has expired. To log in you must change it using a client that supports expired passwords點擊鏈接查看解決方案

-------------------------------------------------------------Host is not allowed to connect to this MySQL server點擊鏈接查看解決方案

-------------------------------------------------------------Unable to connect with connect string: nodeid=0,172.24.221.100:1186

點擊鏈接查看解決方案

-------------------------------------------------------------

總結

以上是生活随笔為你收集整理的mysql cluster linux_【完美】Mysql-cluster数据库集群搭建(linux)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。