当前位置:网站首页>Redis - how to install redis and configuration (how to quickly install redis on ubuntu18.04 and centos7.6 Linux systems)
Redis - how to install redis and configuration (how to quickly install redis on ubuntu18.04 and centos7.6 Linux systems)
2022-07-04 13:50:00 【Alascanfu】
Contents of this article
How to install quickly Redis And configure environment variables
Ubuntu18.04 Linux Lower installation Redis
Preparation
redis-6.2.6.tar.gz Installation package
tcl8.6.1-src.tar Installation package ( To solve the problem
make test
In the process encounter“You need tcl 8.5 or newer in order to run the Redis test”
The problem of )
Ubuntu 18.04 Installation in environment
Step one : Unzip and download it, and put it in ~/downloads/redis-6.2.6.tar.gz To /usr/local Directory and rename
# Enter the directory where the user downloaded the installation package
$ cd ~/downloads
# decompression redis-6.2.6.tar.gz To /usr/local Under the table of contents
$ sudo tar -zxvf redis-6.2.6.tar.gz -C /usr/local
# Go to the application folder
$ cd /usr/local
# rename
$ sudo mv ./redis-6.2.6 ./redis
# Change folder permissions
$ sudo chown -R hadoop ./redis/
Step two : Enter into /usr/local/redis/src Compile below (make)
$ cd /usr/local/redis/src && make
Pay attention to point one : If there is Command ‘gcc’ not found , because redis It was the author who passed C Written in language , There is no installation in the system gcc Or the version is too low to compile and run , There is no such instruction operation to compile .
Solution
# Update installation source
$ sudo apt-get update
# install gcc
$ sudo apt-get install gcc
After completing the above operations , Again in /usr/local/redis/src
Execute under directory make
Pay attention to point two : When we do it again make
On command , Show error: jemalloc/jemalloc.h: No such file or directory when , Official documents suggest that this is about the distributor allocator
The problem of , If there is MALLOC This environment variable , We'll use this environment variable To build Redis.libc
It's not the default allocator , The default is jemalloc
because jemalloc
Proved to be better than libc
Less fragmentation problems
, In order to solve the problem caused by the above default values . We just need to do the following :
$ make MALLOC=libc
After completing the above operations , Again in /usr/local/redis/src
Execute under directory make
Step three : Conduct make test test redis The function of
$ make test
Pay attention to point one : In execution redis The test command make test In the process , encounter “You need tcl 8.5 or newer in order to run the Redis test” The problem with
Solution
Will be ready tcl8.6.1-src.tar.gz Extract and configure the installation
# Enter the directory where the user downloaded the installation package
$ cd ~/downloads
# decompression tcl8.6.1-src.tar.gz Go to the specified directory
$ tar -zxvf ./tcl8.6.1-src.tar.gz -C ~/software
$ cd ~/software/tcl8.6.1/unix
# Enter the software and start the configuration
$ sudo ./configure
# install
$ sudo make
$ sudo make install
After completing the above operations , Enter into /usr/local/redis/src
Under the table of contents perform make test Conduct redis test
Step four : install redis After and start
$ cd /usr/local/redis/src
$ sudo make install
$ redis-server
The startup is successful, as shown in the figure :
Configure environment variables
# Modify environment variable configuration
$ vim ~/.bashrc
# Make the modification of environment variable configuration effective
$ source ~/.bashrc
~./bashrc Ubuntu18.04 Next
export REDIS_HOME=/usr/local/redis
export PATH=${REDIS_HOME}/src:${JAVA_HOME}/bin:${HADOOP_HOME}/bin:${HADOOP_HOME}/sbin:${HBASE_HOME}/bin:${ZOOKEEPER_HOME}/bin:${MY_HOME}/bin:$PATH
Be accomplished QwQ
CentOS 7.6 Linux Lower installation Redis
Preparation
redis-6.2.6.tar.gz Installation package
CentOS 7.6 Installation in environment
Step one : install Redis rely on
because Redis Is based on C Written in language , So first you need to install Redis The required gcc rely on .
sudo yum install -y gcc tcl
Step two : Unzip and download it, and put it in ~/downloads/redis-6.2.6.tar.gz To /usr/local Directory and rename
# Enter the directory where the user downloaded the installation package
$ cd ~/downloads
# decompression redis-6.2.6.tar.gz To /usr/local Under the table of contents
$ sudo tar -zxvf redis-6.2.6.tar.gz -C /usr/local
# Go to the application folder
$ cd /usr/local
# rename
$ sudo mv ./redis-6.2.6 ./redis
# Change folder permissions
$ sudo chown -R hadoop ./redis/
Step three : Enter the redis After the folder Installation
# Go to decompress the good redis Under the table of contents
$ cd /usr/local/redis
$ make && make install
# The default path after installation is /usr/local/bin Under the table of contents
$ cd /usr/local/bin
# Check if the installation is successful
[[email protected] bin]# ll
Total usage 18904
-rwxr-xr-x. 1 root root 4829528 6 month 15 10:48 redis-benchmark
lrwxrwxrwx. 1 root root 12 6 month 15 10:48 redis-check-aof -> redis-server
lrwxrwxrwx. 1 root root 12 6 month 15 10:48 redis-check-rdb -> redis-server
-rwxr-xr-x. 1 root root 5003816 6 month 15 10:48 redis-cli
lrwxrwxrwx. 1 root root 12 6 month 15 10:48 redis-sentinel -> redis-server
-rwxr-xr-x. 1 root root 9518952 6 month 15 10:48 redis-server
Step four : Start and test
# Because the global environment variables have been configured, you can start directly
$ redis-server
# test
[[email protected] redis]$ redis-cli
127.0.0.1:6379> keys *
(empty array)
127.0.0.1:6379> exit
Be accomplished QwQ
边栏推荐
猜你喜欢
Oracle 被 Ventana Research 评为数字创新奖总冠军
Node の MongoDB安装
Is the outdoor LED screen waterproof?
实战:fabric 用户证书吊销操作流程
C#/VB. Net to add text / image watermarks to PDF documents
Personalized online cloud database hybrid optimization system | SIGMOD 2022 selected papers interpretation
Oracle was named the champion of Digital Innovation Award by Ventana research
Building intelligent gray-scale data system from 0 to 1: Taking vivo game center as an example
Comparative study of the gods in the twilight Era
CANN算子:利用迭代器高效实现Tensor数据切割分块处理
随机推荐
在 Apache 上配置 WebDAV 服务器
iptables基础及Samba配置举例
用fail2ban阻止密码尝试攻
Reptile exercises (I)
再说rsync+inotify实现数据的实时备份
MySQL45讲——学习极客时间MySQL实战45讲笔记—— 06 | 全局锁和表锁_给表加个字段怎么有这么多阻碍
使用宝塔部署halo博客
OpenHarmony应用开发之如何创建DAYU200预览器
Zhongang Mining: in order to ensure sufficient supply of fluorite, it is imperative to open source and save flow
Deploy halo blog with pagoda
C basic supplement
2022kdd pre lecture | 11 first-class scholars take you to unlock excellent papers in advance
Scripy framework learning
Go 语言入门很简单:Go 实现凯撒密码
Introduction to reverse debugging PE structure resource table 07/07
Redis —— How To Install Redis And Configuration(如何快速在 Ubuntu18.04 与 CentOS7.6 Linux 系统上安装 Redis)
面试官:Redis中哈希数据类型的内部实现方式是什么?
Reading cognitive Awakening
模块化笔记软件综合评测:Craft、Notion、FlowUs
易周金融 | Q1保险行业活跃人数8688.67万人 19家支付机构牌照被注销