广告
返回顶部
首页 > 资讯 > 数据库 >Centos 7 安装RocksDB
  • 454
分享到

Centos 7 安装RocksDB

2024-04-02 19:04:59 454人浏览 八月长安
摘要

1、安装依赖yum -y install lrzsz git GCc gcc-c++ lz4-devel  yum -y install snappy snappy-devel zlib zlib-deve

1、安装依赖

yum -y install lrzsz git GCc gcc-c++ lz4-devel
 yum -y install snappy snappy-devel zlib zlib-devel bzip2 bzip2-devel lz4 lz4-devel zstd

2、下载安装cmake(gflags-2.2.2对cmake版本有要求)

curl -O   https://cmake.org/files/v3.6/cmake-3.6.0-linux-x86_64.tar.gz
mv cmake-3.6.0-Linux-x86_64.tar.gz /opt/
cd /opt/
tar -xvzf cmake-3.6.0-Linux-x86_64.tar.gz 
yum remove cmake

cat >>/etc/profile <<EOF

export PATH=\$PATH:/opt/cmake-3.6.0-Linux-x86_64/bin

EOF
source /etc/profile

3、安装依赖gflags

wget   Https://GitHub.com/gflags/gflags/arcHive/v2.2.2.tar.gz
我这里是windows下载好上传的文件包
tar -xvzf gflags-2.2.2.tar.gz
cd gflags-2.2.2/
mkdir build
cd build/
cmake -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DINSTALL_HEADERS=ON -DINSTALL_SHARED_LIBS=ON -DINSTALL_STATIC_LIBS=ON ..
make
make install
添加lib信息
cat >>/etc/profile <<EOF

export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/usr/local/lib
EOF
source /etc/profile

4、下载安装rocksdb

wget https://github.com/facebook/rocksdb/archive/v6.4.6.tar.gz
我这里用的是windows下载的包
tar -xvzf rocksdb-6.4.6.tar.gz 
cd rocksdb-6.4.6/
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/rocksdb ..
make
make install

cat >>/etc/profile <<EOF

export CPLUS_INCLUDE_PATH=\$CPLUS_INCLUDE_PATH:/usr/local/rocksdb/include/
export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/usr/local/rocksdb/lib64/
export LIBRARY_PATH=\$LIBRARY_PATH:/usr/local/rocksdb/lib64/

EOF

source /etc/profile

5、ldb工具进行测试

cd rocksdb-6.4.6/build/tools/

[root@es1 tools]# ./ldb -help
ldb - RocksDB Tool

commands MUST specify --db=<full_path_to_db_directory> when necessary

The following optional parameters control if keys/values are input/output as hex or as plain strings:
  --key_hex : Keys are input/output as hex
  --value_hex : Values are input/output as hex
  --hex : Both keys and values are input/output as hex

The following optional parameters control the database internals:
  --column_family=<string> : name of the column family to operate on. default: default column family
  --ttl with 'put','get','scan','dump','query','batchput' : DB supports ttl and value is internally timestamp-suffixed
  --try_load_options : Try to load option file from DB.
  --ignore_unknown_options : Ignore unknown options when loading option file.
  --bloom_bits=<int,e.g.:14>
  --fix_prefix_len=<int,e.g.:14>
  --compression_type=<no|snappy|zlib|bzip2|lz4|lz4hc|xpress|zstd>
  --compression_max_dict_bytes=<int,e.g.:16384>
  --block_size=<block_size_in_bytes>
  --auto_compaction=<true|false>
  --db_write_buffer_size=<int,e.g.:16777216>
  --write_buffer_size=<int,e.g.:4194304>
  --file_size=<int,e.g.:2097152>


Data Access Commands:
  put <key> <value>  [--ttl]
  get <key> [--ttl]
  batchput <key> <value> [<key> <value>] [..] [--ttl]
  scan [--from] [--to]  [--ttl] [--timestamp] [--max_keys=<N>q]  [--start_time=<N>:- is inclusive] [--end_time=<N>:- is exclusive] [--no_value]
  delete <key>
  deleterange <begin key> <end key>
  query [--ttl]
    Starts a REPL shell.  Type help for list of available commands.
  approxsize [--from] [--to] 
  checkconsistency


Admin Commands:
  dump_wal --walfile=<write_ahead_log_file_path> [--header]  [--print_value]  [--write_committed=true|false] 
  compact [--from] [--to] 
  reduce_levels --new_levels=<New number of levels> [--print_old_levels]
  change_compaction_style --old_compaction_style=<Old compaction style: 0 for level compaction, 1 for universal compaction> --new_compaction_style=<New compaction style: 0 for level compaction, 1 for universal compaction>
  dump [--from] [--to]  [--ttl] [--max_keys=<N>] [--timestamp] [--count_only] [--count_delim=<char>] [--stats] [--bucket=<N>] [--start_time=<N>:- is inclusive] [--end_time=<N>:- is exclusive] [--path=<path_to_a_file>]
  load [--create_if_missing] [--disable_wal] [--bulk_load] [--compact]
  manifest_dump [--verbose] [--JSON] [--path=<path_to_manifest_file>]
  list_column_families full_path_to_db_directory 
  create_column_family --db=<db_path> <new_column_family_name>
  drop_column_family --db=<db_path> <column_family_name_to_drop>
  dump_live_files
  idump [--from] [--to]  [--input_key_hex] [--max_keys=<N>] [--count_only] [--count_delim=<char>] [--stats]
  repair
  backup [--backup_env_uri]  [--backup_dir]  [--num_threads]  [--stderr_log_level=<int (InfoLogLevel)>] 
  restore [--backup_env_uri]  [--backup_dir]  [--num_threads]  [--stderr_log_level=<int (InfoLogLevel)>] 
  checkpoint [--checkpoint_dir] 
  write_extern_sst <output_sst_path>
  ingest_extern_sst <input_sst_path> [--move_files]  [--snapshot_consistency]  [--allow_global_seqno]  [--allow_blocking_flush]  [--ingest_behind]  [--write_global_seqno] 

[root@es1 tools]# pwd
/root/rocksdb-6.4.6/build/tools
[root@es1 tools]# ./ldb --db=/tmp/test_db --create_if_missing put a1 b1
OK

[root@es1 tools]# ./ldb --db=/tmp/test_db scan
a1 : b1

[root@es1 tools]# ./ldb --db=/tmp/test_db get a1
b1

[root@es1 tools]# ./ldb --db=/tmp/test_db get a2
Failed: NotFound: 
[root@es1 tools]# cd /tmp/test_db/
[root@es1 test_db]# ll
总用量 536
-rw-r--r--. 1 root root    26 11月 20 11:10 000003.log
-rw-r--r--. 1 root root    16 11月 20 11:10 CURRENT
-rw-r--r--. 1 root root    37 11月 20 11:10 IDENTITY
-rw-r--r--. 1 root root     0 11月 20 11:10 LOCK
-rw-r--r--. 1 root root 17288 11月 20 11:11 LOG
-rw-r--r--. 1 root root 16731 11月 20 11:10 LOG.old.1574219445796772
-rw-r--r--. 1 root root 17288 11月 20 11:10 LOG.old.1574219486641937
-rw-r--r--. 1 root root 17288 11月 20 11:11 LOG.old.1574219490543572
-rw-r--r--. 1 root root    13 11月 20 11:10 MANIFEST-000001
-rw-r--r--. 1 root root  5120 11月 20 11:10 OPTIONS-000005
[root@es1 test_db]# more 000003.log


您可能感兴趣的文档:

--结束END--

本文标题: Centos 7 安装RocksDB

本文链接: https://www.lsjlt.com/news/44465.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • Centos 7 安装RocksDB
    1、安装依赖yum -y install lrzsz git gcc gcc-c++ lz4-devel  yum -y install snappy snappy-devel zlib zlib-deve...
    99+
    2022-10-18
  • Centos 7 安装RocksDB完整过程
    [root@es1 ~]# yum -y install lrssz git gcc gcc-c++ lz4-devel 已加载插件:fastestmirror Determining fastest mi...
    99+
    2022-10-18
  • Centos 7安装unbound
    1.关闭firewall:#停止firewallsystemctl stop firewalld.service#禁止firewall开机启动systemctl disable firewalld.service2.永久关闭vi /etc/...
    99+
    2023-01-30
    Centos unbound
  • CentOS 7安装Docker
    若无linux系统,详见https://www.jb51.net/article/232585.htm 进行下载安装 工欲善其事,必先利其器,为方便传输文件与复制粘贴,需要先安装几个的工具: 1、linux中安装ssh ...
    99+
    2022-06-04
    CentOS安装Docker Linux安装Docker
  • centos 7 安装python3
    yum install openssl-devel -y wget https://www.python.org/ftp/python/3.6.8/Python-3.6.8.tgz tar zxvf Python...
    99+
    2023-01-31
    centos
  • centos 7 安装python3.6
    centos7 默认安装了python2.7.5,当需要使用python3的时候,可以手动下载python源码后编译安装.python 官网:www.python.org1.安装python可能用到的依赖yum install openss...
    99+
    2023-01-31
    centos
  • CentOS 7 安装宝塔
    哈喽大家好,这篇文章将向大家介绍如何在自己的服务器上安装宝塔。       注意:服务器必须为没有安装过任何软件的纯净环境,如果不是则需要前往控制台重装系统(尤其是安装过Apache/Nginx、MySQL、PHP等)       这里我们...
    99+
    2023-10-23
    centos 服务器 linux
  • CentOS 7 安装 postgreSQL 9.4
    CentOS 7仓库中的postgresql软件包太老,我们希望从postgresql 官方获取支持,尤其是关于postgresql 集群方面的支持,比如pgpool 。安装postgresql 9.4yu...
    99+
    2022-10-18
  • CentOS 7 安装Owncloud 9.1.3
    首先安装好CentOS系统,系统的安装这里就不介绍了安装完之后首先配置好IP地址# vi /etc/sysconfig/network-scripts/ifcfg-eth0   BOOT...
    99+
    2022-10-18
  • CentOS 7 安装 Oracle 11.2.0.4
    本文转自: https://www.cnblogs.com/xqzt/p/5456401.html 但结合实际情况,内容稍有改动。 一、安装环境 CentOS Linux release 7.2.1511...
    99+
    2022-10-18
  • CentOS 7下安装Python3.6
    •安装python3.6可能使用的依赖 yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel   •到python...
    99+
    2023-01-30
    CentOS
  • centos 7 下安装python3
    http://www.linuxidc.com/Linux/2016-04/129784.htm 这篇文章的确不错...
    99+
    2023-01-31
    centos
  • centos 7 yum 安装 pyth
    sudo yum install epel-releasesudo yum install python34...
    99+
    2023-01-31
    centos yum pyth
  • CentOS 7 下安装 Python
    当前最新的 CentOS 7.3 默认安装的是 Python 2 ,并且默认的官方 yum 源中不提供 Python 3 的安装包。最近需要在机器上装awscli,需要python2.6.5+或python3.3+,python3我这边通...
    99+
    2023-01-31
    CentOS Python
  • Centos 7安装 redmine 3
    一、配置网卡,能够访问互联网(略)========================================================二、配置环境yum -y install patch make gcc gcc-c++ gcc...
    99+
    2023-01-31
    Centos redmine
  • Centos 7安装mysql-5.7.22
    注意:5.7.20版本之后,默认不带my.cnf配置文件!安装epel更新源(对应系统版本)下载epel文件epel-release-latest-7.noarch.rpmwget https://mirrors.aliyun.com/ep...
    99+
    2023-01-30
    mysql Centos
  • centos 7 安装python3和P
    一、添加epel源yum install epel-release二、安装Python3.4,装完再升级吧yum install python34三、安装pip3yum install python34-setuptoolseasy_ins...
    99+
    2023-01-31
    centos
  • centos 7怎么安装php
    本文操作环境:centos7系统、PHP7.2版、DELL G3电脑centos7怎么安装php?Centos7安装PHP7.2建议方法# 安装EPEL yum存储库 yum install epel-release -y # 安装Re...
    99+
    2017-06-11
    contos7
  • CentOS 7 安装 cacti 1.1.x
    由于cacti 1.1.x系列发布后,变化比较大,集成了很多插件,自带自动发现功能,所以记录下来,比较适合复制粘贴。环境:CentOS 7.4安装前提a、安装系统补丁yum update...
    99+
    2022-10-18
  • CentOS 7上安装Python 3.
    CentOS 7默认安装了Python 2.7,系统本身也使用它来启用系统命令例如‘yum’ 虽然作为开发人员我可以用Python 2.7做很多事情,但我真的想要利用Python 3附带的新语言功能。自从Python 3.6在去年年底问世以...
    99+
    2023-01-31
    CentOS Python
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作