• CentOS7离线安装devtoolset-9并编译redis6.0.5


    首先参照https://www.cnblogs.com/wdw984/p/13330074.html,来进行如何安装Centos和离线下载rpm包。

    离线下载jemalloc,上传到CentOS的/data/rpm/jemalloc目录

    因为redis6.0.5推荐使用jemalloc管理内存,所以我们先安装jemalloc,按照以下顺序安装rpm包(整理好的离线包,点击下载

    rpm -ivh audit-libs-python-2.8.5-4.el7.x86_64.rpm
    rpm -ivh scl-utils-20130529-19.el7.x86_64.rpm
    rpm -ivh checkpolicy-2.5-8.el7.x86_64.rpm
    rpm -ivh libsemanage-python-2.5-14.el7.x86_64.rpm
    rpm -ivh libcgroup-0.41-21.el7.x86_64.rpm
    rpm -ivh python-IPy-0.75-6.el7.noarch.rpm
    rpm -ivh setools-libs-3.3.8-4.el7.x86_64.rpm
    rpm -ivh policycoreutils-python-2.5-34.el7.x86_64.rpm
    rpm -ivh rh-varnish5-runtime-3.1-4.el7.x86_64.rpm
    rpm -ivh rh-varnish5-jemalloc-5.0.1-2.el7.x86_64.rpm
    rpm -ivh jemalloc-3.6.0-8.el7.centos.x86_64.rpm

    去redis官网下载redis6.0.5的gz包(http://download.redis.io/releases/redis-6.0.5.tar.gz)

    把下载的gz包上传到CentOS中,比如/data/rpm目录中

    使用tar xzf redis-6.0.5.tar.gz解压缩gz包,进入redis-6.0.5目录,执行make命令

    由于目前我们使用的gcc版本是4.8,所以在编译redis6.05的时候会报错

    下面我们安装高版本的gcc来编译它。

    首先去下载devtoolset-9的rpm包,上传到/data/rpm/devtoolset-9目录中(整理好的离线包,点击下载

    按照以下顺序安装rpm文件

    rpm -ivh mpfr-3.1.1-4.el7.x86_64.rpm
    rpm -ivh libmpc-1.0.1-3.el7.x86_64.rpm
    rpm -ivh cpp-4.8.5-39.el7.x86_64.rpm
    rpm -ivh gcc-4.8.5-39.el7.x86_64.rpm
    rpm -ivh scl-utils-20130529-19.el7.x86_64.rpm
    rpm -ivh zip-3.0-11.el7.x86_64.rpm
    rpm -ivh unzip-6.0-21.el7.x86_64.rpm
    rpm -ivh libquadmath-4.8.5-39.el7.x86_64.rpm
    rpm -ivh libgfortran5-8.3.1-2.1.1.el7.x86_64.rpm
    rpm -ivh libgcc-4.8.5-39.el7.i686.rpm
    rpm -ivh dwz-0.11-3.el7.x86_64.rpm
    yum localinstall perl*.rpm
    rpm -ivh python-srpm-macros-3-32.el7.noarch.rpm
    rpm -ivh redhat-rpm-config-9.1.0-88.el7.centos.noarch.rpm
    rpm -ivh avahi-libs-0.6.31-20.el7.x86_64.rpm
    rpm -ivh boost-regex-1.53.0-28.el7.x86_64.rpm
    rpm -ivh libcgroup-0.41-21.el7.x86_64.rpm
    rpm -ivh audit-libs-python-2.8.5-4.el7.x86_64.rpm
    rpm -ivh libsemanage-python-2.5-14.el7.x86_64.rpm
    rpm -ivh setools-libs-3.3.8-4.el7.x86_64.rpm
    rpm -ivh python-IPy-0.75-6.el7.noarch.rpm
    rpm -ivh checkpolicy-2.5-8.el7.x86_64.rpm
    rpm -ivh policycoreutils-python-2.5-34.el7.x86_64.rpm
    rpm -ivh devtoolset-9-runtime-9.1-0.el7.x86_64.rpm
    rpm -ivh devtoolset-9-elfutils-libelf-0.176-6.el7.x86_64.rpm
    rpm -ivh devtoolset-9-elfutils-libs-0.176-6.el7.x86_64.rpm
    rpm -ivh devtoolset-9-elfutils-0.176-6.el7.x86_64.rpm
    rpm -ivh devtoolset-9-dyninst-10.1.0-4.el7.x86_64.rpm
    rpm -ivh devtoolset-9-binutils-2.32-16.el7.x86_64.rpm
    rpm -ivh devtoolset-9-memstomp-0.1.5-5.el7.x86_64.rpm
    rpm -ivh devtoolset-9-oprofile-1.3.0-4.el7.x86_64.rpm
    rpm -ivh devtoolset-9-dwz-0.12-1.1.el7.x86_64.rpm
    rpm -ivh devtoolset-9-libstdc++-devel-9.3.1-2.el7.x86_64.rpm
    rpm -ivh devtoolset-9-strace-5.1-7.el7.x86_64.rpm
    rpm -ivh devtoolset-9-valgrind-3.15.0-9.el7.x86_64.rpm
    rpm -ivh devtoolset-9-make-4.2.1-2.el7.x86_64.rpm
    rpm -ivh devtoolset-9-ltrace-0.7.91-2.el7.x86_64.rpm
    rpm -ivh boost-system-1.53.0-28.el7.x86_64.rpm
    rpm -ivh devtoolset-9-systemtap-runtime-4.1-9.el7.x86_64.rpm
    rpm -ivh efivar-libs-36-12.el7.x86_64.rpm
    rpm -ivh mokutil-15-2.el7.centos.x86_64.rpm
    rpm -ivh devtoolset-9-systemtap-client-4.1-9.el7.x86_64.rpm
    rpm -ivh kernel-debug-devel-3.10.0-1127.13.1.el7.x86_64.rpm
    rpm -ivh devtoolset-9-systemtap-devel-4.1-9.el7.x86_64.rpm
    rpm -ivh devtoolset-9-systemtap-4.1-9.el7.x86_64.rpm
    rpm -ivh devtoolset-9-perftools-9.1-0.el7.x86_64.rpm
    rpm -ivh ctags-5.8-13.el7.x86_64.rpm
    rpm -ivh devtoolset-9-gcc-9.3.1-2.el7.x86_64.rpm
    rpm -ivh devtoolset-9-gcc-c++-9.3.1-2.el7.x86_64.rpm
    rpm -ivh tcl-8.5.13-8.el7.x86_64.rpm

    安装完成后,运行scl enable devtoolset-9 bash在当前会话中启用高版本的gcc

    然后我们运行gcc --version就可以看到我们的gcc版本大于4.8了

    如果要每次登录都自动切换成高版本的gcc,需要运行一下 vi /etc/profile 在最后一行加入scl enable devtoolset-9 bash

    然后我们在切换到redis6.0.5目录,进行make,顺利编译完成

    然后我们启用网络(service network start),进行make test,通过测试

    安装(make install)并运行redis

    运行redis-cli进行一下测试

    至此,我们完成了离线编译安装redis6.0.5

  • 相关阅读:
    Python xrange与range的区别返回的结果不一样
    matlab画立方体
    python查询数据类型
    Ubuntu下安装微信(electronic-wechat)
    python判断数组中是否有重复元素
    python构建数组
    Numpy中np.max(即np.amax)的用法
    你不知道C#只带有 get 访问器的属性是只读属性?
    Windows 平台安装配置 MongoDB
    一日一技:Ocelot网关使用IdentityServer4认证
  • 原文地址:https://www.cnblogs.com/wdw984/p/13330761.html
Copyright © 2020-2023  润新知