zoukankan      html  css  js  c++  java
  • centOS7安装 redis server

    官网

    一、安装gcc依赖

    由于 redis 是用 C 语言开发,安装之前必先确认是否安装 gcc 环境(gcc -v),如果没有安装,执行以下命令进行安装

     yum install -y gcc 

    二、通过yum方式安装

     yum install redis

    二、启动redis服务      

      /bin/systemctl  start  redis.service

    三、测试redis

    redis-cli
    set  'test'  'hello'
    get  'test'

      

    修改配置

    1.找配置文件

    (test_services) [root@67 local]# whereis  redis.config     
    redis: /etc/redis.conf

     2.打开配置文件 (修改前先备份) 

    cp /etc/redis.conf /etc/redis_bak.conf

    nano /etc/redis.conf

     

     

     

     修改配置文件后重启redis

      /bin/systemctl  restart  redis.service

    常用命令

        启动  /bin/systemctl  start  redis.service
    
        重启  /bin/systemctl  restart  redis.service
    
        关闭  /bin/systemctl  stop  redis.service



    参考文档:

    Centos7安装Redis

    Redis设置密码和取消密码

     

    查看redis服务进程 / Redis是否启动的三种方式

    方法一:查看redis服务进程情况,这里拿redis服务举例,其他服务查询更改名字即可

    ps -ef|grep redis

    方法二:查看6379(为redis的端口号)端口号是否被占用

    lsof -i :6379

    方法三:显示tcp的端口和进程等相关情况

    netstat -tnlp
  • 相关阅读:
    restfulframework详解
    restful规范
    02-模板字符串
    01-学习vue前的准备工作
    vue系列
    crawler_编码转换_unicode(年)
    002-算法-递归法
    001-算法-递推法
    000-算法-基础概念
    linux_后台启动多个java -jar 程序,及关闭
  • 原文地址:https://www.cnblogs.com/kaerxifa/p/13608240.html
Copyright © 2011-2022 走看看