zoukankan      html  css  js  c++  java
  • 虚拟机CentOS7.0 部署Redis 并配置网络实现外部远程访问

    安装gcc和tcl

    yum install gcc-c++

    yum install -y tcl

    下载Redis

    wget http://download.redis.io/releases/redis-3.2.8.tar.gz

     

    解压源码

    tar -zxvf redis-3.2.8.tar.gz

    进入到解压目录

    cd redis-3.2.8

    编译安装redis

    make

    make install

    配置Redis 能允许外部远程访问

    修改配置

    vi redis.conf

     

     

    保存退出vi

    配置Redis 随系统启动

    ./utils/install_server.sh

    设置iptables规则,允许外部访问6379端口

    iptables -I INPUT 1 -p tcp -m state --state NEW -m tcp --dport 6379 -j ACCEPT
    service iptables save

     若报错【The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.】

     安装iptables服务

    yum install iptables-services

     配置iptables开机自启

    systemctl enable iptables.service

    关闭firewalld防火墙

    systemctl stop firewalld.service
    systemctl disable firewalld.service

    至此,配置完成。

    Redis服务查看、开启、关闭

    a.通过【ps -ef|grep redis】命令查看Redis进程

    b.开启Redis服务操作通过/etc/init.d/redis_6379 start命令,也可通过(service redis_6379 start)


    c.关闭Redis服务操作通过/etc/init.d/redis_6379 stop命令,也可通过(service redis_6379 stop)

    最后使用外部工具访问 Redis

     

    redis.conf配置信息

  • 相关阅读:
    20.GC日志详解及日志分析工具
    19.JVM调优工具锦囊
    两个页面的传参(转自博客园的春哥也编程)
    纯js实现背景图片切换
    关于引用类型用ref传参的问题
    C++ return
    C++内存管理
    Chrome插件开发一(配置文件)
    C++对象传递
    const 与 #define 的比较
  • 原文地址:https://www.cnblogs.com/ZeroSunny/p/12674848.html
Copyright © 2011-2022 走看看