热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

虚拟机Ubuntu9.04下MySQL集群的配置方法

大家在网上都能找到都是RedHat系统等等,对Ubuntu系统MySQL集群就没有介绍文章我现在写写Ubuntu这个MySQL集群方法。新手不要骂我,呵呵。介绍网络环境:测试环境:Server1:ndbd192.168.245.11Server2:ndbd192.168.245.12Server3:mysqld–ndb-cluster192.168.245.13ndbd

大家在网上都能找到都是RedHat系统等等,对Ubuntu系统MySQL集群就没有介绍文章

我现在写写Ubuntu这个MySQL集群方法。新手不要骂我,呵呵。

介绍网络环境:

测试环境:
Server1: ndbd 192.168.245.11
Server2: ndbd 192.168.245.12
Server3: mysqld –ndb-cluster 192.168.245.13
ndbd: 数据库节点。
mysqld –ndb-cluster: MySQL服务器节点,程序直接访问的是这台机器的IP。默认端口仍是3306。
ndbd_mgm ndbd_mgmd:管理节点。管理/查看各库节点和服务器节点的状态。

二、集群方案
1.管理节点:server3(192.168.245.13)
2.存储节点:server1(192.168.245.11),server2(192.168.245.12)
3.SQL节点:server1(192.168.245.11),server2(192.168.245.12),server3(192.168.245.13)

三、mysql安装和配置

1.安装,sudo apt-get install mysql-server

2.配置这三台服务器上配置my.cnf,这三台服务器都要配置
vim /etc/mysql/my.cnf
—————————————–my.cnf开始——————————————–
ubuntu@ubuntu:~$ cat /etc/mysql/my.cnf
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - “/etc/mysql/my.cnf” to set global options,
# - “~/.my.cnf” to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with –help to get a list of available options and with
# –print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/serve ... ables.html

# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain “#” chars…
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0

[mysqld]
#
# * Basic Settings
#

#
# * IMPORTANT
# If you make changes to these settings and your system uses apparmor, you may
# also need to also adjust /etc/apparmor.d/usr.sbin.mysqld.
#

user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
language = /usr/share/mysql/english
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
# bind-address = 127.0.0.1
#
# * Fine Tuning
#
key_buffer = 16M
max_allowed_packet = 16M
thread_stack = 128K
thread_cache_size = 8
#max_cOnnections= 100
#table_cache = 64
#thread_cOncurrency= 10
#
# * Query Cache Configuration
#
query_cache_limit = 1M
query_cache_size = 16M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
#log = /var/log/mysql/mysql.log
#
# Error logging goes to syslog. This is a Debian improvement
#
# Here you can see queries with especially long duration
#log_slow_queries = /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
# other settings you may need to change.
#server-id = 1
#log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 10
max_binlog_size = 100M
#binlog_do_db = include_database_name
#binlog_ignore_db = include_database_name
#
# * BerkeleyDB
#
# Using BerkeleyDB is now discouraged as its support will cease in 5.1.12.
skip-bdb
#
# * MyISAM
#
# MyISAM is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more MyISAM related options. There are many!
# You might want to disable MyISAM to shrink the mysqld process by circa 100MB.
#skip-innodb
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI “tinyca”.
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem

ndbcluster
ndb-cOnnectstring=192.168.245.13

[mysqldump]
quick
quote-names
max_allowed_packet = 16M

[mysql]
#no-auto-rehash # faster start of mysql but no tab completition

[isamchk]
key_buffer = 16M

#
# * NDB Cluster
#
# See /usr/share/doc/mysql-server-*/README.Debian for more information.
#
# The following configuration is read by the NDB Data Nodes (ndbd processes)
# not from the NDB Management Nodes (ndb_mgmd processes).
#
[MYSQL_CLUSTER]

ndb-cOnnectstring=192.168.245.13

#
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with ‘.cnf’, otherwise they’ll be ignored.
#
!includedir /etc/mysql/conf.d/

ubuntu@ubuntu:~$
———————————my.cnf结束———————————————————

主要在:[mysqld]下添加:

ndbcluster
ndb-cOnnectstring=192.168.245.13
和添加
[MYSQL_CLUSTER]

ndb-cOnnectstring=192.168.245.13

上面三台服务器都要一样


推荐阅读
  • 分享css中提升优先级属性!important的用法总结
    web前端|css教程css!importantweb前端-css教程本文分享css中提升优先级属性!important的用法总结微信门店展示源码,vscode如何管理站点,ubu ... [详细]
  • 本文介绍了在Web应用系统中,数据库性能是导致系统性能瓶颈最主要的原因之一,尤其是在大规模系统中,数据库集群已经成为必备的配置之一。文章详细介绍了主从数据库架构的好处和实验环境的搭建方法,包括主数据库的配置文件修改和设置需要同步的数据库等内容。MySQL的主从复制功能在国内外大型网站架构体系中被广泛采用,本文总结了作者在实际的Web项目中的实践经验。 ... [详细]
  • 本文介绍了在开发Android新闻App时,搭建本地服务器的步骤。通过使用XAMPP软件,可以一键式搭建起开发环境,包括Apache、MySQL、PHP、PERL。在本地服务器上新建数据库和表,并设置相应的属性。最后,给出了创建new表的SQL语句。这个教程适合初学者参考。 ... [详细]
  • Ubuntu 9.04中安装谷歌Chromium浏览器及使用体验[图文]
    nsitionalENhttp:www.w3.orgTRxhtml1DTDxhtml1-transitional.dtd ... [详细]
  • Python项目实战10.2:MySQL读写分离性能优化
    本文介绍了在Python项目实战中进行MySQL读写分离的性能优化,包括主从同步的配置和Django实现,以及在两台centos 7系统上安装和配置MySQL的步骤。同时还介绍了创建从数据库的用户和权限的方法。摘要长度为176字。 ... [详细]
  • 系统安装Debian系统的安装方式和Ubuntu系统的安装方式几乎是一样的,毕竟Ubuntu系统是基于Debian的,就如同CentOS基于Redhat ... [详细]
  • 如何查看电脑系统版本_腾讯云服务器系统版本怎么看?Windows和Centos版本怎么选?...
    腾讯云服务器系统版本怎么看?想要知道自己的腾讯云服务器系统版本是哪个,可以登录云服务器后台管理系统查看,或者使用命令行查询,如果不会操作& ... [详细]
  • Oracle Database 10g许可授予信息及高级功能详解
    本文介绍了Oracle Database 10g许可授予信息及其中的高级功能,包括数据库优化数据包、SQL访问指导、SQL优化指导、SQL优化集和重组对象。同时提供了详细说明,指导用户在Oracle Database 10g中如何使用这些功能。 ... [详细]
  • 在说Hibernate映射前,我们先来了解下对象关系映射ORM。ORM的实现思想就是将关系数据库中表的数据映射成对象,以对象的形式展现。这样开发人员就可以把对数据库的操作转化为对 ... [详细]
  • mac php错误日志配置方法及错误级别修改
    本文介绍了在mac环境下配置php错误日志的方法,包括修改php.ini文件和httpd.conf文件的操作步骤。同时还介绍了如何修改错误级别,以及相应的错误级别参考链接。 ... [详细]
  • 本文介绍了在MacOS系统上安装MySQL的步骤,并详细说明了如何设置MySQL服务的开机启动和如何修改MySQL的密码。通过下载MySQL的macos版本并按照提示一步一步安装,在系统偏好设置中可以找到MySQL的图标进行设置。同时,还介绍了通过终端命令来修改MySQL的密码的具体操作步骤。 ... [详细]
  • 主流操作系统简介
    主流操作系统简介子墨居士操作系统理论定义为管理计算机硬件资源,控制其他程序运行并为用户提供交互操作界面的系统软件的集合。操作系统是计算机系统的关键组成部分࿰ ... [详细]
  • 下载地址http:www.kbengine.org这货不错安装在Linux上安装(CentosDebianUbuntuetc.)服务端,请在终端输入:pythonkbenginek ... [详细]
  • 新新于2005-09-1415:02:23发表:利用chbg程序动态制作屏保XScreenSaver是一个开放的框架,就像一个服务器,任何一个可以在根窗 ... [详细]
  • deb文件格式本是ubuntu的安装文件,那么我想要在fedora中安装,需要把deb格式转化成rpm格式,我们用skype举例:1.下载转换工具alien_8.78.tar.gz2.deb转化成 ... [详细]
author-avatar
挖掘机销售mv
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有