解决yum安装redis出现No-package-redis-available

 不知道是怎么回事,yum install redis 出现No package redis available
 Loaded plugins: priorities, update-motd, upgrade-helper
No package redis available.
Error: Nothing to do

 在网上搜了很多方法比如epel什么的都不行,于是我就用最原始的方法安装redis,redis启动了
这里写图片描述
 下面就来讲解一下怎么安装的

1. Redis安装

1.1 安装c++

yum install gcc-c++

1.2 在线下载redis

http://download.redis.io/releases/redis-2.8.18.tar.gz

1.3 将下载的tar.gz解压

tar xzf redis-2.8.18.tar.gz

1.4 编译redis(将.c文件编译为.o文件)

1.4.1 进入解压文件夹

cd redis-2.8.18

1.4.2 执行make

 1) 如果没有安装gcc,编译将出现错误提示(如果安装失败,必须删除文件夹,重新解压)

 2) 安装成功
这里写图片描述

1.5 安装

 make PREFIX=/usr/local/redis install
这里写图片描述
 安装完成后在/usr/local/redis/bin下有几个可执行文件

1.6 copy文件

 redis启动需要一个配置文件,可以修改端口号等信息,记得先修改daemonize yes

cp redis.conf /usr/local/redis

1.7 启动redis

 首先进入

cd /usr/local/redis/

 执行

./bin/redis-server ./redis.conf

 redis默认端口6370,通过当前服务进程查看

ps -ef | grep -i redis

 如果请求时遇到MISCONF Redis is configured to save RDB snapshots,
but is currently not able to persist on disk. Commands that may modify the data set are disabled.
Please check Redis logs for details about the error.

 Redis被配置为保存数据库快照,但它目前不能持久化到硬盘。用来修改集合数据的命令不能用。请查看Redis日志的详细错误信息。

原因

 强制关闭Redis快照导致不能持久化。

解决方案

 将stop-writes-on-bgsave-error设置为no

127.0.0.1:6379> config set stop-writes-on-bgsave-error no

 结束!

版权声明:本文为博主原创文章,未经博主允许不得转载


关注公众号:猿小雷
获取更多文章,第一之间掌握技术。
有问题请在公众号内回复,小雷会一一回答。

这里写图片描述

### Redis 7.4 Installation Guide For the installation of Redis version 7.4 within a Node.js environment, one can utilize NPM (Node Package Manager), which comes bundled with Node.js installations. The command to install the `redis` package via NPM is as follows: ```bash ./npm install redis ``` This command installs the latest compatible version of the Redis client library for use in Node.js applications at the time of writing this guide; however, specific versions like Redis 7.4 might require additional steps or direct downloads from official sources since NPM packages may not always correspond directly to server-side Redis versions[^1]. To ensure compatibility and functionality when working with a specified version such as Redis 7.4, consider downloading it directly from the official website or repository suitable for your operating system. After obtaining the desired version, follow the platform-specific instructions provided by the Redis documentation. #### Verifying Installation on Linux Systems After installing Redis through appropriate channels, verify its successful setup using commands tailored towards checking service status and running instances. For systems based on CentOS or similar distributions where YUM is available, managing OpenStack components could provide insights into handling services but does not apply specifically here unless integrating with cloud infrastructure[^3]. Instead, focus on basic verification methods applicable across Unix-like environments: ```bash systemctl start redis.service systemctl enable redis.service systemctl status redis.service ``` These commands initiate the Redis service, set it to launch upon boot, and display current operational details about the process respectively. #### Configuring Access Credentials When configuring access credentials for databases connected over HTTP interfaces—such as those mentioned while setting up web-based platforms—it's important to adhere closely to security best practices rather than default settings that expose sensitive information publicly[^2]. Ensure strong passwords are used instead of examples given (`root/root`) during actual deployments. #### Customizing Backend Paths In scenarios involving e-commerce solutions built atop frameworks requiring backend configuration files—for instance, Magento—the ability to customize admin URLs enhances both usability and security measures against unauthorized access attempts[^4]. While this customization pertains more so to application-level configurations post-installation, understanding how paths influence overall architecture remains beneficial knowledge.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值