隨筆 - 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++博客   博問  
           
          主站蜘蛛池模板: 保靖县| 瑞丽市| 阜阳市| 青川县| 获嘉县| 连山| 阳西县| 通化县| 甘泉县| 平和县| 石阡县| 会东县| 锦屏县| 浏阳市| 岗巴县| 黔西县| 文登市| 浠水县| 胶南市| 扶余县| 自贡市| 团风县| 长海县| 大关县| 无锡市| 准格尔旗| 金湖县| 洛隆县| 静安区| 普兰县| 肇州县| 晋宁县| 东丽区| 望江县| 太康县| 濮阳县| 达州市| 九龙县| 增城市| 桂平市| 金阳县|