MyRocks是关系型数据库Mysql 基于RocksDB 的存储引擎,一个可嵌入的、持久的键值存储。Percona MyRocks 是集于 Percona Server for MySQL的.

RocksDB存储基于日志结构的合并树(LSM tree)。它针对快速存储进行了优化,有出色的空间和写入效率以及可接受的读取性能。因此,如果您的工作负载使用SSD等快速存储,MyRocks与其他存储引擎相比具有以下优势:

需要更少的存储空间

提供更高的存储耐用性

确保更好的IO容量

安装 Percona MyRocks

  1. 下载安装包

    [root@HDDC-DFNV-L3-Nredis03 peona-server-8.0.32-24]# ll
    total 115764
    -rw-r----- 1 root root 2172240 Mar 10 03:55 percona-icu-data-files-8.0.32-24.1.el7.x86_64.rpm
    -rw-r----- 1 root root 16856148 Mar 10 03:55 percona-server-client-8.0.32-24.1.el7.x86_64.rpm
    -rw-r----- 1 root root 1932780 Mar 10 03:55 percona-server-devel-8.0.32-24.1.el7.x86_64.rpm
    -rw-r----- 1 root root 18054024 Mar 10 03:55 percona-server-rocksdb-8.0.32-24.1.el7.x86_64.rpm
    -rw-r----- 1 root root 76730136 Mar 10 03:55 percona-server-server-8.0.32-24.1.el7.x86_64.rpm
    -rw-r----- 1 root root 1560508 Mar 10 03:55 percona-server-shared-8.0.32-24.1.el7.x86_64.rpm
    -rw-r----- 1 root root 1226512 Mar 10 03:55 percona-server-shared-compat-8.0.32-24.1.el7.x86_64.rpm
  2. 安装os系统包
    yum -y install cmake gcc gcc-c++ ncurses ncurses-devel bison readline-devel jemalloc zlib zlib-devel  valgrind valgrind-devel   net-tools

    3. 初始化  Percona Server for MySQL

 
[root@HDDC-DFNV-L3-Nredis03 percona-server-8.0.32-24]# pwd
/root/percona-server-8.0.32/percona-server-8.0.32-24
[root@HDDC-DFNV-L3-Nredis03 percona-server-8.0.32-24]# ll
total 115764
-rw-r----- 1 root root 2172240 Mar 10 03:55 percona-icu-data-files-8.0.32-24.1.el7.x86_64.rpm
-rw-r----- 1 root root 16856148 Mar 10 03:55 percona-server-client-8.0.32-24.1.el7.x86_64.rpm
-rw-r----- 1 root root 1932780 Mar 10 03:55 percona-server-devel-8.0.32-24.1.el7.x86_64.rpm
-rw-r----- 1 root root 18054024 Mar 10 03:55 percona-server-rocksdb-8.0.32-24.1.el7.x86_64.rpm
-rw-r----- 1 root root 76730136 Mar 10 03:55 percona-server-server-8.0.32-24.1.el7.x86_64.rpm
-rw-r----- 1 root root 1560508 Mar 10 03:55 percona-server-shared-8.0.32-24.1.el7.x86_64.rpm
-rw-r----- 1 root root 1226512 Mar 10 03:55 percona-server-shared-compat-8.0.32-24.1.el7.x86_64.rpm
[root@HDDC-DFNV-L3-Nredis03 percona-server-8.0.32-24]# [root@HDDC-DFNV-L3-Nredis03 percona-server-8.0.32-24]# yum localinstall -y *.rpm Installed:
percona-icu-data-files.x86_64 0:8.0.32-24.1.el7 percona-server-client.x86_64 0:8.0.32-24.1.el7 percona-server-devel.x86_64 0:8.0.32-24.1.el7
percona-server-rocksdb.x86_64 0:8.0.32-24.1.el7 percona-server-server.x86_64 0:8.0.32-24.1.el7 percona-server-shared.x86_64 0:8.0.32-24.1.el7
percona-server-shared-compat.x86_64 0:8.0.32-24.1.el7 Complete!

4.启动mysql 并修改 root 密码

[root@HDDC-DFNV-L3-Nredis03 system]# systemctl start mysqld

mysql日志文件中找到初始的默认密码。接着修改root账户的默认密码:

[root@HDDC-DFNV-L3-Nredis03 system]# cat /var/log/mysqld.log |grep -E "pass"
2023-05-12T02:38:46.620826Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: ,DlCHuMer5fT [root@HDDC-DFNV-L3-Nredis03 system]# mysql -uroot -p',DlCHuMer5fT' -S /var/lib/mysql/mysql.sock
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.32-24 Copyright (c) 2009-2023 Percona LLC and/or its affiliates
Copyright (c) 2000, 2023, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> SET PASSWORD FOR root@localhost = '123gsDDDug#dd6';
Query OK, 0 rows affected (0.01 sec)

5. enable-rocksdb 引擎

[root@HDDC-DFNV-L3-Nredis03 ~]# ps-admin --enable-rocksdb -u root -p
Enter password: Checking if RocksDB plugin is available for installation ...
INFO: ha_rocksdb.so library for RocksDB found at /usr/lib64/mysql/plugin/ha_rocksdb.so. Checking RocksDB engine plugin status...
INFO: RocksDB engine plugin is not installed. Installing RocksDB engine...
INFO: Successfully installed RocksDB engine plugin. mysql> show engines;
+--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+
| ndbcluster | NO | Clustered, fault-tolerant tables | NULL | NULL | NULL |
| FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL |
| PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO |
| ROCKSDB | YES | RocksDB storage engine | YES | YES | YES |
| InnoDB | DEFAULT | Percona-XtraDB, Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
| MyISAM | YES | MyISAM storage engine | NO | NO | NO |
| ndbinfo | NO | MySQL Cluster system information storage engine | NULL | NULL | NULL |
| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO |
| CSV | YES | CSV storage engine | NO | NO | NO |
| ARCHIVE | YES | Archive storage engine | NO | NO | NO |
+--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+
12 rows in set (0.02 sec)

6. rocksdb 引擎测试

mysql> create database chongzh;
Query OK, 1 row affected (0.01 sec)
mysql> use chongzh;
Database changed
mysql> create table r1 (id int, foo char(25)) engine=rocksdb;
Query OK, 0 rows affected (0.00 sec)
mysql> insert into r1 (id,foo) values (1,'test'),(2,'wow'),(3,'q');
Query OK, 3 rows affected (0.00 sec)
Records: 3 Duplicates: 0 Warnings: 0
mysql> select * from r1;
+------+------+
| id | foo |
+------+------+
| 1 | test |
| 2 | wow |
| 3 | q |
+------+------+
3 rows in set (0.01 sec)

与InnoDB相比,MyRocks存储引擎缺少以下功能:

Online DDL is not supported due to the lack of atomic DDL support.

ALTER TABLE .. EXCHANGE PARTITION.

SAVEPOINT

Transportable tablespace

Foreign keys

Spatial indexes

Fulltext indexes

Gap locks

Group Replication

Partial Update of LOB in InnoDB

​与InnoDB相比,MyRocks存储引擎​优势:

1. rocksdb压缩率非常高,大约只有innodb的1/3,同时也要比压缩后的innodb小。
2. rocksdb读性能对比innodb还是差不少,但是跟压缩后的innodb相比,某些场景下,还是有一定优势。
3. 写入性能非常优秀。
4. 非常适合写多读少,并且对容量比较敏感的业务场景。
参考:
  • https://docs.percona.com/percona-server/8.0/myrocks/limitations.html

  • https://www.percona.com/software/mysql-database/percona-server

percona-server-rocksdb-8.0.32 安装的更多相关文章

  1. IntraWeb.v14.0.32安装及破解指南

    一.下载 首先从这里下载14.0.32版本的IntraWeb: 链接:http://pan.baidu.com/s/1c0rjnKO 密码:8kv2 二.卸载旧版 1. 我的Delphi版本是XE6, ...

  2. Win server 2012 +IIS8.0下安装SSL证书

    SSL证书的申请: 成功在景安申请证书后,会得到一个有密码的压缩包文件,输入证书密码后解压得到五个文件:for Apache.for IIS.for Ngnix.for Other Server,这个 ...

  3. ubuntu安装Percona Server

    Percona Server是mysql数据库的一个衍生版本,在性能,稳定性和可管理性上都有很大的提升,目前淘宝的mysql数据库就是基于Percona Server,请原谅我这么喜欢研究淘宝的技术. ...

  4. MongoDB4.0.0的安装配置—windows

    一.背景 由于要学习MongoDB,所以就下载了最新的MongoDB 的Community Server版的4.0.0版本.可能是新的版本的缘故,在安装配置上与MongoDB3有许多不同,而且在3中的 ...

  5. percona server 二进制安装下编译tpcc-mysql的坑

    出于习惯,percona server的部署都是通过二进制包自动化安装,结果遇到一个硕大无比的坑,编译TPCC-MySQL时出现警告 10:49:36 root@DB-Master:~/tpcc-my ...

  6. CentOS 7.2 安装配置 Percona Server

    个人比较喜欢 MYSQL 的轻量,今天花了一点时间把阿里云上的 MYSQL5.7 换成了 Percona-Server ,Percona 是一个开源的 MySQL 衍生版.InnoDB的数据库引擎使得 ...

  7. Percona Server 5.6 安装TokuDB

    系统:Red Hat Enterprise Linux Server release 6.3 (Santiago) 数据库:Percona-Server-5.6.29-rel76.2-Linux.x8 ...

  8. mysql 5.7/percona server/mariadb 10.2安装与服务器参数优化

    建议使用percona server linux generic版,从https://www.percona.com/downloads/Percona-Server-LATEST/下载,现在不在推荐 ...

  9. CentOS 7.5 安装与配置 Percona Server 5.7

    个人比较喜欢 MYSQL 的轻量,今天花了一点时间把阿里云上的 MYSQL5.7 换成了 Percona-Server .Percona 是一个开源的 MySQL 衍生版,TokuDB 的数据库引擎使 ...

  10. 如何在 CentOS 7 上安装 Percona Server

    在这篇文章中我们将了解关于 Percona 服务器,一个开源的MySQL,MariaDB的替代品.InnoDB的数据库引擎使得Percona 服务器非常有吸引力,如果你需要的高性能,高可靠性和高性价比 ...

随机推荐

  1. System.IO.IOException:“找不到资源“views.buttonstylepage.xaml”。”

    初学作为记录(事发场景): WPFDemo的程序集中,定义了一个Views文件夹,该文件夹放一些页面Page.UI层面的东西.用Frame空间做导航的时候,始终报一个错误   //   System. ...

  2. Promise和await、同步和异步

    1.同步和异步是什么: ​ ①同步:同步是指如果一个进程在执行某个请求的时候,如果该请求需要等待一段时间,那么该进程会一直等待下去,直到收到返回信息才继续执行下去 ​ ②异步: 指一个请求在执行某个请 ...

  3. windows系统下使用java语言,在mysql数据库中做定时数据备份、删除

    有这样一个业务需求,需要将数据归档的表每月定时备份,并且删除之前表中的数据,话不多说,直接上代码! 注意:这种方法适合数据量小,业务要求不高的场景! 项目采用SpringBoot  + MyBatis ...

  4. Python3.10 的开发环境的搭建

    安装 下载 Python3.10 或者其他版本:Download Python | Python.org 如果 Windows 操作系统下载,默认是下载 64 位操作系统的 exe 安装包:pytho ...

  5. node-sass与node版本对照图

  6. put、delete、post、get四种传参方式

    PUT: this.$http.put('url', { modifyTime:this.sizeForm.modifyTime, mqttRes:this.sizeForm.mqttRes, udp ...

  7. AIGC时代:未来已来

    摘要:人工智能的快速发展使得我们进入了AIGC时代.AIGC时代的到来,将会带来巨大的机遇和挑战. 本文分享自华为云社区<GPT-4发布,AIGC时代的多模态还能走多远?系列之一: AIGC时代 ...

  8. 垃圾回收之G1收集过程

    G1 中提供了 Young GC.Mixed GC 两种垃圾回收模式,这两种垃圾回收模式,都是 Stop The World(STW) 的. G1 没有 fullGC 概念,需要 fullGC 时,调 ...

  9. 数据挖掘决策树—R实现

    决策树 决策树是一种树形结构,其中每个内部节点表示一个属性上的测试,每个分支代表一个测试输出,每个叶节点代表一种类别.分类树(决策树)是一种十分常用的分类方法.它是一种监督学习,所谓监督学习就是给定一 ...

  10. KubeSphere 高可用集群搭建并启用所有插件

    介绍 大多数情况下,单主节点集群大致足以供开发和测试环境使用.但是,对于生产环境,您需要考虑集群的高可用性.如果关键组件(例如 kube-apiserver.kube-scheduler 和 kube ...