`
bayaci
  • 浏览: 265641 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

自己经历的mysql cluter配置过程(二)配置文件

阅读更多

自己经历的mysql cluter配置过程

76.my.cnf

#mpleMySQLconfigfileformediumsystems.
#
#Thisisforasystemwithlittlememory(32M-64M)whereMySQLplays
#animportantpart
,orsystemsupto128MwhereMySQLisusedtogetherwith
#otherprograms(suchasawebserver)
#
#Youcancopythisfileto
#/etc/my.cnftosetglobaloptions
,
#mysql-data-dir/my.cnftosetserver-specificoptions(inthis
#installationthisdirectoryis/var/lib/mysql)or
#~/.my.cnftosetuser-specificoptions.
#
#Inthisfile
,youcanusealllongoptionsthataprogramsupports.
#Ifyouwanttoknowwhichoptionsaprogramsupports
,runtheprogram
#withthe
"--help"option.

#ThefollowingoptionswillbepassedtoallMySQLclients
[client]
#password
=your_password
port
=3307
socket
=/var/lib/mysql/mysql.sock

#Herefollowsentriesforsomespecificprograms

#TheMySQLserver
[mysqld]
datadir
=/var/lib/mysql
user
=root
port
=3306
socket
=/var/lib/mysql/mysql.sock
skip-locking
key_buffer
=16M
max_allowed_packet
=1M
table_cache
=64
sort_buffer_size
=512K
net_buffer_length
=8K
read_buffer_size
=256K
read_rnd_buffer_size
=512K
myisam_sort_buffer_size
=8M

#datadir
=/mysqldata



#Don'tlistenonaTCP/IPportatall.Thiscanbeasecurityenhancement
,
#ifallprocessesthatneedtoconnecttomysqldrunonthesamehost.
#AllinteractionwithmysqldmustbemadeviaUnixsocketsornamedpipes.
#NotethatusingthisoptionwithoutenablingnamedpipesonWindows
#(viathe
"enable-named-pipe"option)willrendermysqlduseless!
#
#skip-networking

#ReplicationMasterServer(default)
#binaryloggingisrequiredforreplication
log-bin
=mysql-bin

#requireduniqueidbetween
1and2^32-1
#defaultsto
1ifmaster-hostisnotset
#butwillnotfunctionasamasterifomitted
server-id
=1

#ReplicationSlave(commentoutmastersectiontousethis)
#
#Toconfigurethishostasareplicationslave
,youcanchoosebetween
#twomethods:
#
#
1)UsetheCHANGEMASTERTOcommand(fullydescribedinourmanual)-
#thesyntaxis:
#
#CHANGEMASTERTOMASTER_HOST
=<host>,MASTER_PORT=<port>,
#MASTER_USER
=<user>,MASTER_PASSWORD=<password>;
#
#whereyoureplace<host>
,<user>,<password>byquotedstringsand
#<port>bythemaster'sportnumber(
3306bydefault).
#
#Example:
#
#CHANGEMASTERTOMASTER_HOST
='125.564.12.1',MASTER_PORT=3306,
#MASTER_USER
='joe',MASTER_PASSWORD='secret';
#
#OR
#
#
2)Setthevariablesbelow.However,incaseyouchoosethismethod,then
#startreplicationforthefirsttime(evenunsuccessfully
,forexample
#ifyoumistypedthepasswordinmaster-passwordandtheslavefailsto
#connect)
,theslavewillcreateamaster.infofile,andanylater
#changeinthisfiletothevariables'valuesbelowwillbeignoredand
#overriddenbythecontentofthemaster.infofile
,unlessyoushutdown
#theslaveserver
,deletemaster.infoandrestarttheslaverserver.
#Forthatreason
,youmaywanttoleavethelinesbelowuntouched
#(commented)andinsteaduseCHANGEMASTERTO(seeabove)
#
#requireduniqueidbetween
2and2^32-1
#(anddifferentfromthemaster)
#defaultsto
2ifmaster-hostisset
#butwillnotfunctionasaslaveifomitted
#server-id
=2
#
#Thereplicationmasterforthisslave-required
#master-host
=<hostname>
#
#Theusernametheslavewilluseforauthenticationwhenconnecting
#tothemaster-required
#master-user
=<username>
#
#Thepasswordtheslavewillauthenticatewithwhenconnectingto
#themaster-required
#master-password
=<password>
#
#Theportthemasterislisteningon.
#optional-defaultsto
3306
#master-port
=<port>
#
#binarylogging-notrequiredforslaves
,butrecommended
#log-bin
=mysql-bin

#Pointthefollowingpathstodifferentdedicateddisks
#tmpdir
=/tmp/
#log-update
=/path-to-dedicated-directory/hostname

#UncommentthefollowingifyouareusingBDBtables
#bdb_cache_size
=4M
#bdb_max_lock
=10000


#UncommentthefollowingifyouareusingInnoDBtables
innodb_data_home_dir
=/var/lib/mysql/
innodb_data_file_path
=ibdata1:10M:autoextend
innodb_log_group_home_dir
=/var/lib/mysql/
#innodb_log_arch_dir
=/var/lib/mysql
#Youcanset.._buffer_pool_sizeupto
50-80%
#ofRAMbutbewareofsettingmemoryusagetoohigh
innodb_buffer_pool_size
=16M
innodb_additional_mem_pool_size
=2M
#Set.._log_file_sizeto
25%ofbufferpoolsize
innodb_log_file_size
=5M
innodb_log_buffer_size
=8M
innodb_flush_log_at_trx_commit
=1
innodb_lock_wait_timeout
=50


ndbcluster#runNDBstorageengine
ndb-connectstring
=192.168.1.79#locationofmanagementserver
[mysqldump]
quick
max_allowed_packet
=16M

[mysql]
no-auto-rehash
#RemovethenextcommentcharacterifyouarenotfamiliarwithSQL
#safe-updates

[isamchk]
key_buffer
=20M
sort_buffer_size
=20M
read_buffer
=2M
write_buffer
=2M

[myisamchk]
key_buffer
=20M
sort_buffer_size
=20M
read_buffer
=2M
write_buffer
=2M

[mysqlhotcopy]
interactive-timeout


[MYSQL_CLUSTER]
ndb-connectstring
=192.168.1.79#locationofmanagementserver



16.my.cnf

#ExampleMySQLconfigfileformediumsystems.
#
#Thisisforasystemwithlittlememory(32M-64M)whereMySQLplays
#animportantpart
,orsystemsupto128MwhereMySQLisusedtogetherwith
#otherprograms(suchasawebserver)
#
#Youcancopythisfileto
#/etc/my.cnftosetglobaloptions
,
#mysql-data-dir/my.cnftosetserver-specificoptions(inthis
#installationthisdirectoryis/var/lib/mysql)or
#~/.my.cnftosetuser-specificoptions.
#
#Inthisfile
,youcanusealllongoptionsthataprogramsupports.
#Ifyouwanttoknowwhichoptionsaprogramsupports
,runtheprogram
#withthe
"--help"option.

#ThefollowingoptionswillbepassedtoallMySQLclients
[client]
#password
=your_password
port
=3306
socket
=/var/lib/mysql/mysql.sock

#Herefollowsentriesforsomespecificprograms

#TheMySQLserver
[mysqld]
port
=3306
socket
=/var/lib/mysql/mysql.sock
skip-locking
key_buffer
=16M
max_allowed_packet
=1M
table_cache
=64
sort_buffer_size
=512K
net_buffer_length
=8K
read_buffer_size
=256K
read_rnd_buffer_size
=512K
myisam_sort_buffer_size
=8M


ndbcluster#runNDBstorageengine
ndb-connectstring
=192.168.1.79#locationofmanagementserver


#Don'tlistenonaTCP/IPportatall.Thiscanbeasecurityenhancement
,
#ifallprocessesthatneedtoconnecttomysqldrunonthesamehost.
#AllinteractionwithmysqldmustbemadeviaUnixsocketsornamedpipes.
#NotethatusingthisoptionwithoutenablingnamedpipesonWindows
#(viathe
"enable-named-pipe"option)willrendermysqlduseless!
#
#skip-networking

#ReplicationMasterServer(default)
#binaryloggingisrequiredforreplication
log-bin
=mysql-bin

#requireduniqueidbetween
1and2^32-1
#defaultsto
1ifmaster-hostisnotset
#butwillnotfunctionasamasterifomitted
server-id
=1

#ReplicationSlave(commentoutmastersectiontousethis)
#
#Toconfigurethishostasareplicationslave
,youcanchoosebetween
#twomethods:
#
#
1)UsetheCHANGEMASTERTOcommand(fullydescribedinourmanual)-
#thesyntaxis:
#
#CHANGEMASTERTOMASTER_HOST
=<host>,MASTER_PORT=<port>,
#MASTER_USER
=<user>,MASTER_PASSWORD=<password>;
#
#whereyoureplace<host>
,<user>,<password>byquotedstringsand
#<port>bythemaster'sportnumber(
3306bydefault).
#
#Example:
#
#CHANGEMASTERTOMASTER_HOST
='125.564.12.1',MASTER_PORT=3306,
#MASTER_USER
='joe',MASTER_PASSWORD='secret';
#
#OR
#
#
2)Setthevariablesbelow.However,incaseyouchoosethismethod,then
#startreplicationforthefirsttime(evenunsuccessfully
,forexample
#ifyoumistypedthepasswordinmaster-passwordandtheslavefailsto
#connect)
,theslavewillcreateamaster.infofile,andanylater
#changeinthisfiletothevariables'valuesbelowwillbeignoredand
#overriddenbythecontentofthemaster.infofile
,unlessyoushutdown
#theslaveserver
,deletemaster.infoandrestarttheslaverserver.
#Forthatreason
,youmaywanttoleavethelinesbelowuntouched
#(commented)andinsteaduseCHANGEMASTERTO(seeabove)
#
#requireduniqueidbetween
2and2^32-1
#(anddifferentfromthemaster)
#defaultsto
2ifmaster-hostisset
#butwillnotfunctionasaslaveifomitted
#server-id
=2
#
#Thereplicationmasterforthisslave-required
#master-host
=<hostname>
#
#Theusernametheslavewilluseforauthenticationwhenconnecting
#tothemaster-required
#master-user
=<username>
#
#Thepasswordtheslavewillauthenticatewithwhenconnectingto
#themaster-required
#master-password
=<password>
#
#Theportthemasterislisteningon.
#optional-defaultsto
3306
#master-port
=<port>
#
#binarylogging-notrequiredforslaves
,butrecommended
#log-bin
=mysql-bin

#Pointthefollowingpathstodifferentdedicateddisks
#tmpdir
=/tmp/
#log-update
=/path-to-dedicated-directory/hostname

#UncommentthefollowingifyouareusingBDBtables
#bdb_cache_size
=4M
#bdb_max_lock
=10000

#UncommentthefollowingifyouareusingInnoDBtables
#innodb_data_home_dir
=/var/lib/mysql/
#innodb_data_file_path
=ibdata1:10M:autoextend
#innodb_log_group_home_dir
=/var/lib/mysql/
#innodb_log_arch_dir
=/var/lib/mysql/
#Youcanset.._buffer_pool_sizeupto
50-80%
#ofRAMbutbewareofsettingmemoryusagetoohigh
#innodb_buffer_pool_size
=16M
#innodb_additional_mem_pool_size
=2M
#Set.._log_file_sizeto
25%ofbufferpoolsize
#innodb_log_file_size
=5M
#innodb_log_buffer_size
=8M
#innodb_flush_log_at_trx_commit
=1
#innodb_lock_wait_timeout
=50

[mysqldump]
quick
max_allowed_packet
=16M

[mysql]
no-auto-rehash
#RemovethenextcommentcharacterifyouarenotfamiliarwithSQL
#safe-updates

[isamchk]
key_buffer
=20M
sort_buffer_size
=20M
read_buffer
=2M
write_buffer
=2M

[myisamchk]
key_buffer
=20M
sort_buffer_size
=20M
read_buffer
=2M
write_buffer
=2M

[mysqlhotcopy]
interactive-timeout


[MYSQL_CLUSTER]
ndb-connectstring
=192.168.1.79#locationofmanagementserver

19.my.cnf

#ExampleMySQLconfigfileformediumsystems.
#
#Thisisforasystemwithlittlememory(32M-64M)whereMySQLplays
#animportantpart
,orsystemsupto128MwhereMySQLisusedtogetherwith
#otherprograms(suchasawebserver)
#
http://images.csdn.net/syntaxhighlighting
分享到:
评论

相关推荐

    Docker+Redis_CLUTER 实验

    Docker+Redis_CLUTER 实验

    MySQL必知必会常识技巧实战宝典

    15 MySQL复制:最简单也最容易配置出错.mp4 16 读写分离设计:复制延迟?其实是你用错了.mp4 17 高可用设计:你怎么活用三大架构方案?.mp4 18 金融级高可用架构:必不可少的数据核对.mp4 19 高可用套件:选择这么多,...

    扇区对齐工具

    4K对齐提高U盘SD提高读写速度,空间充分使用

    k8s-multi-node-cluter-on-aws

    k8s-multi-node-cluter-on-aws

    linux高可用性,负载均衡,可扩展性

    红帽集群套件(RedHat Cluter Suite, RHCS)是一套综合的软件组件,可以通过在部署时采用不同的配置,以满足你的对高可用性,负载均衡,可扩展性,文件共享和节约成本的需要。 对于需要最大正常运行时间的应用来说...

    Redis集群部署及增加安全性验证

    Redis单机之前已经进行了安装,现在我们通过一台虚拟机创建六个实例进行伪集群搭建并为集群...依次修改redis01-redis06中redis.conf配置文件中以下两个参数 (1)Port将默认端口6379修改为指定端口号 (2)Bind将12

    Clustering:具有相似位串分数的Cluter类似分子

    聚类目标也是将群集分为多个步骤,因此可以使用多个线程来加快处理速度。 要编辑的主要脚本是driver.java 用相似的位串分数将相似的分子聚类。

    使用RHCS套件实现高可用性集群

    红帽集群套件(RedHat Cluter Suite, RHCS)是一套综合的软件组件,可以通过在部署时采用不同的配置,以满足你的对高可用性,负载均衡,可扩展性,文件共享和节约成本的需要。 对于需要最大正常运行时间的应用来说...

    x-jdbc:简单的基于jdbc规范的读写分离框架

    jdbc的想法:当应用想使用读写分离功能时,可以很方便的接入,因为x-jdbc就是一个jar包,并扩展了Spring的自定义标签方便应用通过xjdbc:cluter,xjdbc:rwds来定义数据源,并将x-jdbc的数据源配置在你应用的ORM框架中....

    31 讲带你搞懂 SkyWalking

    │ 开篇词:从剖析 ...│ 第20讲:深入剖析 Configuration 插件,实现可插拔接入多种配置中心.mp4 │ 第21讲:Cluter 插件剖析,你想要的集群模式它都有.mp4 │ 第23讲:深入剖析 regiter-receiver-plugin

    详解通过源码解析Node.js中cluster模块的主要功能实现

    众所周知,Node.js中的JavaScript代码执行在单线程中,非常脆弱...,但cluter模块在多次fork这份代码时,却没有报端口已被占用? Master是如何将接收的请求传递至worker中进行处理然后响应的? 让我们从Node.js项目的l

    google服务器集群介绍

    google公司发表的关于集群部署的论文

    DBSCAN:Objective-C Implementation of Density-Based Spatial Clustering of Applications with Noise (基于密度的聚类算法)

    DBSCAN 具有噪声的基于密度的应用程序空间聚类的 Objective-C 实现 基于速度的算法 效果图 用法: NSArray points = @[[ NSValue ... DBSCAN *cluter = [[DBSCAN alloc ] initWithRadius: 100 minNumberOfP

    HFSWR中用于目标检测的空间扩展杂波的主瓣消除

    高频表面波雷达(HFSWR)已成功开发用于预警,尤其是用于监视移动中的船只。 但是,空间覆盖杂波(SSC)可能会遮盖住宽广的方向,例如HFSWR中的海杂波和电离层杂波可能使它蒙蔽。 一些方法已经为消除SSC做出了很大的...

Global site tag (gtag.js) - Google Analytics