隨筆 - 175  文章 - 202  trackbacks - 0
          <2011年7月>
          262728293012
          3456789
          10111213141516
          17181920212223
          24252627282930
          31123456

          第一個Blog,記錄哈哈的生活

          常用鏈接

          留言簿(16)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          收藏夾

          Java links

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          @import url(http://www.aygfsteel.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);
          因為連接數的問題,我不得不在一臺機器上多啟 mysql instance

          1. 建立兩個 mysql 數據庫實例
          mysql_install_db --datadir=xxx
          2. 配置 /etc/my.cnf

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

          # Here follows entries for some specific programs
          [mysqld_multi] 
          mysqld = /usr/bin/mysqld_safe 
          mysqladmin = /usr/bin/mysqladmin 
          user = mysql
          password = mysql

          [mysqld1]
          datadir = /home/intple/mysql/data1
          max_connections = 800

          long_query_time = 0.1
          #log-queries-not-using-indexes
          slow_query_log = 1
          slow_query_log_file = /var/log/mysql-slow.log

          port = 3306
          socket = /home/intple/mysql/data1/mysql.sock
          skip-locking
          key_buffer_size = 384M
          max_allowed_packet = 1M
          table_open_cache = 512
          sort_buffer_size = 2M
          read_buffer_size = 2M
          read_rnd_buffer_size = 8M
          myisam_sort_buffer_size = 64M
          thread_cache_size = 32
          query_cache_size = 512M
          # Try number of CPU's*2 for thread_concurrency
          thread_concurrency = 32

          log-bin=mysql-bin

          server-id = 1

          binlog_format=mixed

          innodb_buffer_pool_size = 20G
          innodb_additional_mem_pool_size = 32M
          innodb_thread_concurrency = 32
          # Set .._log_file_size to 25 % of buffer pool size
          innodb_log_file_size = 256M
          innodb_log_buffer_size = 32M
          innodb_flush_log_at_trx_commit = 1
          innodb_autoextend_increment = 64M
          innodb_lock_wait_timeout = 200

          [mysqld2]
          datadir = /home/intple/mysql/data2
          max_connections = 800

          long_query_time = 0.1
          #log-queries-not-using-indexes
          slow_query_log = 1
          slow_query_log_file = /var/log/mysql2-slow.log

          port = 3307
          socket = /home/intple/mysql/data2/mysql2.sock
          skip-locking
          key_buffer_size = 384M
          max_allowed_packet = 1M
          table_open_cache = 512
          sort_buffer_size = 2M
          read_buffer_size = 2M
          read_rnd_buffer_size = 8M
          myisam_sort_buffer_size = 64M
          thread_cache_size = 32
          query_cache_size = 512M
          # Try number of CPU's*2 for thread_concurrency
          thread_concurrency = 32

          log-bin=mysql-bin

          server-id = 1

          binlog_format=mixed

          innodb_buffer_pool_size = 20G
          innodb_additional_mem_pool_size = 32M
          innodb_thread_concurrency = 32
          # Set .._log_file_size to 25 % of buffer pool size
          innodb_log_file_size = 256M
          innodb_log_buffer_size = 32M
          innodb_flush_log_at_trx_commit = 1
          innodb_autoextend_increment = 64M
          innodb_lock_wait_timeout = 200

          [mysqldump]
          quick
          max_allowed_packet = 16M

          [mysql]
          no-auto-rehash
          # Remove the next comment character if you are not familiar with SQL
          #safe-updates

          [myisamchk]
          key_buffer_size = 256M
          sort_buffer_size = 256M
          read_buffer = 2M
          write_buffer = 2M

          [mysqlhotcopy]
          interactive-timeout

          3. 啟動
          mysqld_multi start 1 &
          mysqld_multi start 2 &
          posted on 2011-07-12 15:59 哈哈的日子 閱讀(567) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
          博客園   IT新聞   Chat2DB   C++博客   博問  
           
          主站蜘蛛池模板: 九台市| 姚安县| 科技| 桑日县| 扎兰屯市| 临江市| 商南县| 韶山市| 玛曲县| 密云县| 永和县| 襄汾县| 克什克腾旗| 施秉县| 石嘴山市| 皮山县| 南川市| 武平县| 张北县| 刚察县| 乡城县| 福建省| 花莲县| 普宁市| 张家口市| 庄浪县| 泰安市| 汉阴县| 新郑市| 洛浦县| 黄浦区| 茂名市| 恭城| 通化市| 内乡县| 忻城县| 思南县| 镇雄县| 兴安盟| 临安市| 临汾市|