mysql5.6 memcached_MySQL 5.6 安裝配置InnoDB memcached Plugin

準備工作, 安裝libmemached包,提供一些memcat/cp/dump命令,方便測試。

# yum install libmemcached.x86_64 -y

1. Setup required tables.

mysql> source MYSQL_HOME/share/innodb_memcached_config.sql

Query OK, 1 row affected (0.00 sec)

Database changed

Query OK, 0 rows affected (0.04 sec)

Query OK, 0 rows affected (0.04 sec)

Query OK, 0 rows affected (0.02 sec)

Query OK, 1 row affected (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Database changed

Query OK, 0 rows affected (0.03 sec)

Query OK, 1 row affected (0.01 sec)

[root@localhost:test 11:58:56]> show databases;

+--------------------+

| Database?????????? |

+--------------------+

| information_schema |

| db01?????????????? |

| innodb_memcache??? |

| mysql????????????? |

| performance_schema |

| test?????????????? |

+--------------------+

6 rows in set (0.00 sec)

[root@localhost:innodb_memcache 12:04:01]> show tables;

+---------------------------+

| Tables_in_innodb_memcache |

+---------------------------+

| cache_policies??????????? |

| config_options??????????? |

| containers??????????????? |

+---------------------------+

3 rows in set (0.00 sec)

2. Install the daemon plugin

mysql> install plugin daemon_memcached soname "libmemcached.so";

Uninstall the daemon plugin

mysql> uninstall plugin daemon_memcached;

3. Start memcache

a. Set variable daemon_memcached_option when mysql is running.

> set global variable daemon_memcached_option = '-p11222'

b. Set option daemon_memcached_option during mysql start.

$ mysqld .... --daemon_memcached_option="-p11222"

c. Set daemon_memcached_option in my.cnf.

$ grep -i memcache /usr/local/mysql/my.cnf

daemon_memcached_option="-p11222"

4. Verify memcache status.

a. Check listen port.

[mysql@slc4-ra0002pxe159 ~]$ netstat -nultpa|grep -i list

tcp??????? 0????? 0 :::11222??????????????????? :::*??????????????????????? LISTEN????? 681/mysqld

b. Check memcache contents.

$ export MEMCACHED_SERVERS=127.0.0.1:11222

$ touch memcache/mime.types

$ memcp memcache/mime.types

$ memcat memcache/mime.types

$ telnet 127.0.0.1 11222

Trying 127.0.0.1...

Connected to 127.0.0.1.

Escape character is '^]'.

set all 10 0 9

123456789

STORED

get all

VALUE all 10 9

123456789

END

quit

Connection closed by foreign host.

[root@localhost:innodb_memcache 12:24:09]> select *? from test.demo_test;

+------------+-----------+------+------+------+

| c1???????? | c2??????? | c3?? | c4?? | c5?? |

+------------+-----------+------+------+------+

| all??????? | 123456789 |?? 10 |??? 2 |??? 0 |

| mime.types |?????????? |??? 0 |??? 1 |??? 0 |

+------------+-----------+------+------+------+

2 rows in set (0.00 sec)

5. Tuning memcache.

[root@localhost:test 11:56:44]> show variables like '%memcache%';

+----------------------------------+------------------+

| Variable_name??????????????????? | Value??????????? |

+----------------------------------+------------------+

| daemon_memcached_enable_binlog?? | OFF????????????? |

| daemon_memcached_engine_lib_name | innodb_engine.so |

| daemon_memcached_engine_lib_path |????????????????? |

| daemon_memcached_option????????? | -p11222????????? |

| daemon_memcached_r_batch_size??? | 1??????????????? |

| daemon_memcached_w_batch_size??? | 1??????????????? |

+----------------------------------+------------------+

daemon_memcached_r_batch_size batch commit size for read operations (get). It specifies after how many memcached read operations the system automatically does a commit. By default, this is set to 1 so that every get request can access the very latest committed data in the InnoDB table, whether the data was updated through memcached or by SQL. When its value is greater than 1, the counter for read operations is incremented once for every get call. The flush_all call resets both the read and write counters.

daemon_memcached_w_batch_size batch commit for any write operations (set, replace, append, prepend, incr, decr, and so on) By default, this is set as 1, so that no uncommitted data is lost in case of an outage, and any SQL queries on the underlying table can access the very latest data. When its value is greater than 1, the counter for write operations is incremented once for every add, set, incr, decr, and delete call. The flush_all call resets both the read and write counters.

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/454942.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/454942.shtml
英文地址,請注明出處:http://en.pswp.cn/news/454942.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

Java 監聽器,國際化

1. 監聽器 1.1 概述 監聽器: 主要是用來監聽特定對象的創建或銷毀、屬性的變化的! 是一個實現特定接口的普通java類! 對象: 自己創建自己用 (不用監聽) 別人創建自己用 (需要監聽) Servlet中哪些對象需要監…

patator mysql 字典_利用patator進行子域名爆破

前言:原來朋友寫的一個子域名爆破工具挺好用,這前幾天API接口關了.痛苦萬分.自己也寫了一個類似的但是不咋穩定.特地google找了下 找到一款patator.效果和速度還是不錯的。knock的速度真心受不了啊patator是由Python寫的 不用安裝下載即可.下載地址:http://code.goo…

div 超出高度滾動條,超出寬度點點點

超出高度滾動條style"width:230px; height: 180px; overflow: auto;"超出寬度點點點style"width: 220px; overflow: hidden; white-space:nowrap; text-overflow:ellipsis;"轉載于:https://www.cnblogs.com/thinkingthigh/p/7603703.html

mp4(H264容器)的詳細文件格式分析

十六進制碼流分析: ftyp Box 00 00 00 1C: size ,28,表示此BOX有28個字節,表示長度的四個字節也計算在內。以下同 66 74 79 70: type,表示BOX TYPE,此處為ftyp 6D 70 34 32: 可能是兼容的格式信息,/mp42 00 00 00…

hdu 5925 搜索

題意&#xff1a;一個圖&#xff0c;n個障礙&#xff0c;求聯通塊 思路&#xff1a; 圖很大&#xff0c;障礙物很少。把聯通的障礙物塊摳出來&#xff0c;然后暴力。 代碼&#xff1a; #include<bits/stdc.h> using namespace std; #define MEM(a,b) memset(a,b,sizeof(a…

分析數據庫CitusDB:提供彈性計算能力

本文講的是分析數據庫CitusDB&#xff1a;提供彈性計算能力,企業數據庫市場很龐大&#xff0c;在這個領域既有Oracle這樣行家&#xff0c;也有IBM(DB2)和微軟(SQL Server)這樣的跨界巨頭。它們都與中小企業常用到的開源數據庫MySQL一樣&#xff0c;都屬于傳統關系型數據庫。似乎…

mysql不能創建innodb類型表_MYSQL have_innodb DISABLED無法創建innodb類型的表

今天在一臺MYSQL服務器上發現&#xff0c;明明用了engineinnodb創建的表&#xff0c;結果創建出來卻成了myisam的表。再看show variables like %innodb%;have_innodb 成了DISABLED。經過一番試驗&#xff0c;發現是我關閉數據庫后&#xff0c;直接刪除ibdata1文件造成的。刪除該…

[bzoj1059]矩陣游戲

雖然是一道水難題&#xff0c;但是我這種蒟蒻還是要講一講的。 Description 小Q是一個非常聰明的孩子&#xff0c;除了國際象棋&#xff0c;他還很喜歡玩一個電腦益智游戲——矩陣游戲。矩陣游戲在一個N*N黑白方陣進行&#xff08;如同國際象棋一般&#xff0c;只是顏色是隨意的…

H264 RTP頭分析

h264 RTP頭解析流程 結合NALDecoder.c分析 協議分析 &#xff1a;每一個RTP數據報都由頭部&#xff08;Header&#xff09;和負載&#xff08;Payload&#xff09;兩個部分組成&#xff0c;其中頭部前 12 個字節的含義是固定的&#xff0c;而負載則可以是音頻或者視頻數據。 一…

golang mysql 插入_Mysql學習(一)添加一個新的用戶并用golang操作Mysql

Mysql添加一個新的用戶并賦予權限添加一個自己的用戶到mysql首先我們需要先用root用戶登錄mysql&#xff0c;但是剛安裝完沒有密碼&#xff0c;我們先跳過密碼ailumiyanaailumiyana:~/Git_Project/Go_Test$ sudo mysqld_safe --skip-grant-tables2019-01-07T01:35:51.559420Z m…

云計算構建基石之Hyper-V:虛擬機管理

本文講的是云計算構建基石之Hyper-V:虛擬機管理,作為云計算的重要基石&#xff0c;虛擬化技術的好壞起著關鍵作用。Hyper-V作為微軟重要的虛擬化解決技術&#xff0c;在微軟云計算構建解決方案中&#xff0c;更是關鍵至關鍵&#xff0c;基礎之基礎。在本系列文章中&#xff0c;…

Delphi語言最好的JSON代碼庫 mORMot學習筆記1

mORMot沒有控件安裝&#xff0c;直接添加到lib路徑,工程中直接添加syncommons&#xff0c;syndb等到uses里 --------------------------------------------------------- 在進行網絡編程中需要JSON對象的構建與解析&#xff0c;這個Delphi XE自帶&#xff1a;{$IF CompilerVers…

3GP文件格式分析

1. 概述現在很多智能手機都支持多媒體功能&#xff0c;特別是音頻和視頻播放功能&#xff0c;而3GP文件格式是手機端普遍支持的視頻文件格式。目前很多手機都支持h263視頻編碼格式的視頻文件播放&#xff0c;還有些手機支持h264。音頻文件格式普遍支持amr&#xff0c;有些手…

mysql group concat_MySQL 的 GROUP_CONCAT 函數詳解

GROUP_CONCAT(expr) 函數會從 expr 中連接所有非 NULL 的字符串。如果沒有非 NULL 的字符串&#xff0c;那么它就會返回 NULL。語法如下&#xff1a;GROUP_CONCAT 語法規則它在遞歸查詢中用的比較多&#xff0c;但要使用好它并不容易。所以讓我們一起來看看吧&#xff1a;假設有…

ORACLE數據庫 常用命令和Sql常用語句

ORACLE 賬號相關 如何獲取表及權限 1.COPY表空間backup scottexp登錄管理員賬號system2.創建用戶 create user han identified(認證) by mima default tablespace users&#xff08;默認的表空間&#xff09; quota&#xff08;配額&#xff09;10M on users;創建賬號分配權限g…

光榮之路測試開發面試linux考題之四:性能命令

Hi,大家好我是tom,I am back.今天要給大家講講linux系統一些性能相關命令。 1.fdisk 磁盤管理 是一個強大的危險命令&#xff0c;所有涉及磁盤的操作都由該命令完成&#xff0c;包括&#xff1a;新增磁盤、增刪改磁盤分區等。 1.fdisk -l 查看磁盤分區情況 Disk /dev/sda: 27.8…

一起學并發編程 - 優雅關閉

Java中原來在Thread中提供了stop()方法來終止線程&#xff0c;但這個方法是不安全的&#xff0c;所以一般不建議使用。文本將介紹兩種可以優雅的終止線程的方式...<!-- more --> 第一種 在JAVA《Java多線程模式》中有一種叫Two-Phase Termination&#xff08;兩步終止&am…

mac安裝完mysql后關機特別慢_mysql-Mac終端下遇到的問題總結

為了方便啟動mysql服務&#xff0c;修改/etc/.bash_profile文件&#xff0c;如下alias mysql"/usr/local/mysql/bin/mysql"alias mysqladmin"/usr/local/mysql/bin/mysqladmin"或者alias mysqlstart"sudo /usr/local/mysql/support-files/mysql.serve…

sending data mysql slow Mysql查詢非常慢的可能原因

1.用explain看看mysql的執行情況,可以得知,task_id掃描了近20萬條數據,而且這個task_id不是索引 2.為這個task_id所在的表,將此字段添加索引后,查詢就變得很快了 轉載于:https://www.cnblogs.com/Skrillex/p/7365590.html

mybatis 添加語句返回對象_mybatis的insert語句插入數據時的返回值的實現

mybatis的insert語句插入數據時的返回值的實現,語句,返回值,那條,都是,站長站mybatis的insert語句插入數據時的返回值的實現易采站長站&#xff0c;站長之家為您整理了mybatis的insert語句插入數據時的返回值的實現的相關內容。mybatis的sql語句一般是配置在配置文件中&#xf…