当前位置:网站首页>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 testIn 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
边栏推荐
- Node mongodb installation
- Introduction to XML I
- A data person understands and deepens the domain model
- XML入门三
- C语言小型商品管理系统
- E-week finance | Q1 the number of active people in the insurance industry was 86.8867 million, and the licenses of 19 Payment institutions were cancelled
- C language staff management system
- Using nsproxy to forward messages
- C#基础深入学习二
- ViewBinding和DataBinding的理解和区别
猜你喜欢

C#/VB. Net to add text / image watermarks to PDF documents
提高MySQL深分页查询效率的三种方案
![[cloud native | kubernetes] in depth understanding of ingress (12)](/img/34/67eae1e5df89bb0a356a1c29a5e007.png)
[cloud native | kubernetes] in depth understanding of ingress (12)

Etcd storage, watch and expiration mechanism

A data person understands and deepens the domain model

Introduction to reverse debugging PE structure resource table 07/07

Go 语言入门很简单:Go 实现凯撒密码
Three schemes to improve the efficiency of MySQL deep paging query

unity不识别rider的其中一种解决方法

三星量产3纳米产品引台媒关注:能否短期提高投入产出率是与台积电竞争关键
随机推荐
Node mongodb installation
Annual comprehensive analysis of China's mobile reading market in 2022
How real-time cloud interaction helps the development of education industry
It is six orders of magnitude faster than the quantum chemical method. An adiabatic artificial neural network method based on adiabatic state can accelerate the simulation of dual nitrogen benzene der
.Net之延迟队列
C language Dormitory Management Query Software
.NET 使用 redis
三星量产3纳米产品引台媒关注:能否短期提高投入产出率是与台积电竞争关键
OPPO Find N2产品形态首曝:补齐各项短板
[cloud native | kubernetes] in depth understanding of ingress (12)
Personalized online cloud database hybrid optimization system | SIGMOD 2022 selected papers interpretation
动画与过渡效果
C#基础补充
After the game starts, you will be prompted to install HMS core. Click Cancel, and you will not be prompted to install HMS core again (initialization failure returns 907135003)
源码编译安装MySQL
Comparative study of the gods in the twilight Era
CANN算子:利用迭代器高效实现Tensor数据切割分块处理
C语言图书租赁管理系统
WPF double slider control and forced capture of mouse event focus
C array supplement