当前位置:网站首页>Redis系列——redis启动,客户端day1-2
Redis系列——redis启动,客户端day1-2
2022-06-26 07:01:00 【简明编程】
Redis系列——redis启动,客户端,GUI
Redis启动
前台启动
前台启动其实就是我们在day1-1看到的最后的启动方式
若我们关闭terminal就会关闭
redis-server
redis-cli
后台启动
即使关闭terminal也不会关闭redis
首先我们需要找到reids的配置文件进行相关配置
找到redis配置文件
redis的配置文件叫redis.comf位置在/etc/redis下
通过如下命令可以找到
whereis redis

复制redis.conf
我们将redis.conf原始配置进行复制为redis_copy.conf
cp redis.conf redis_copy.conf

修改配置文件
修改监听地址为0.0.0.0
原始为127.0.0.1表示本地访问,修改为0.0.0.0表示可以在任意IP进行访问,因为0.0.0.0(unspecified)表示本机的总广播地址,是IP地址集合(你这样理解就可以了),任意IP皆可访问
bind 0.0.0.0
修改守护进程为yes
表示允许后台启动
daemonize yes
修改密码(这个看你自己)
requirepass 123456
其他配置
//修改端口
port 6379
//修改工作目录
dir .
//修改数据库数量,1表示使用第一个库,共有16个库(0--15)
databases 1
//设置最大内存
maxmemory 512mb
//设置日志文件位置
logfile "redis.log"
启动(加上配置文件)
redis-server /etc/redis/redis.conf
开机自启动(推荐)
编辑服务文件
cd /etc/systemd/system
vim redis.service
内容如下:
[Unit]
Description=redis-server
After=network.target
[Service]
Type=forking
ExecStart=/usr/bin/redis-server /etc/redis/redis.conf
PrivateTmp=true
[Install]
WantedBy=multi-user.target
重新加载服务
systemctl daemon-reload
开机自启动(若启动失败可以重启再启动)
systemctl start redis
systemctl enable redis

客户端(这里指命令行客户端)
就是redis-cli
redis-cli [options] [commonds]
options:
- -h 127.0.0.1 :表示指定要连接的redis节点的IP地址
- -p 6379:指定端口号
- -a 123456:指定访问密码为123456
commonds
- ping:进行心跳测试,正常返回pong
GUI
https://github.com/lework/RedisDesktopManager-Windows/releases
接下来正常安装就可以
边栏推荐
- Development trends and prospects of acrylamide crystallization market in the world and China 2022-2027
- shell 输入验证仅限字母数字
- Big factory interview TCP protocol classic 15 consecutive questions! 22 pictures to make you fully understand
- China's wind farm operation industry's "fourteenth five year plan" planning direction and investment risk prediction report 2022-2027
- Distribution operation of D
- 营销技巧:相比较讲产品的优点,更有效的是要向客户展示使用效果
- China polyimide film market demand and future investment risk outlook report 2022-2027
- 专业课-代码题记录
- I have been testing at Tencent for several years
- If you meet a female driver who drives didi as an amateur, you can earn 500 yuan a day!
猜你喜欢

【路径规划】基于改进人工势场实现机器人路径规划附matlab代码

LabVIEW Arduino TCP/IP遠程智能家居系統(項目篇—5)

MySQL

【图像增强】基于人工多重曝光融合AMEF实现图像去雾附matlab代码

Stm32f1 and stm32subeide programming example - thermal sensor driver

Easyar use of unity

Installation and login of MySQL database

Open source demo| you draw and I guess -- make your life more interesting

Kotlin Compose 状态恢复 rememberSaveable 与 remember
![[image fusion] MRI-CT image fusion based on gradient energy, local energy and PCA fusion rules with matlab code](/img/fc/fd81dedaa6b7c7542f9d74b04f247c.png)
[image fusion] MRI-CT image fusion based on gradient energy, local energy and PCA fusion rules with matlab code
随机推荐
Service interface test guide
Hudi compilation of data Lake architecture
Massive log collection tool flume
MySQL
Spark3.3.0 source code compilation supplement - Crazy certificate problem
Rust中的过程宏
大厂面试TCP协议经典十五连问!22张图让你彻底弄明白
MATLAB线性规划模型学习笔记
Analyze 5 indicators of NFT project
Easyar use of unity
[image enhancement] image defogging based on artificial multiple exposure fusion amef with matlab code
Global and Chinese silicon carbide monocrystal furnace market survey and future production and marketing demand analysis report 2022-2027
SQL Basics
浅析一道经典题
Cocoscreator plays spine animation
. Net 20th anniversary! Microsoft sends a document to celebrate
一芯实现喷雾|WS2812驱动|按键触摸|LED显示|语音播报芯片等功能,简化加湿器产品设计
SQL query statement
What is data mining?
China polyimide film market demand and future investment risk outlook report 2022-2027