日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

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

發布時間:2023/12/20 数据库 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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.

總結

以上是生活随笔為你收集整理的mysql5.6 memcached_MySQL 5.6 安装配置InnoDB memcached Plugin的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。