Redis学习笔记(3)-XShell连接CentOSMini,并安装Redis
使用XShell远程连接CentOSMini
点击download下载XShell5.0。
下载之后安装。配置XShell。
配置XShell前的准备
打开VM,启动CentOSMini。CentOSMini启动之后进入Terminal。
[root@localhost ~]# ip addr
输入命令ip addr ,回车查看inet地址。
切换回Windows,打开CMD,输入命令ipconfig,回车查看IPv4地址。
>ipconfig
比对两个ip地址是否在同一IP段,即IP地址形式如{1}.{2}.{3}.{4},比对1,2,3部分是否相同,相同即为同一IP段,此为XShell连通虚拟机安装的CentOSMini的前提。
配置XShell
打开XShell,点击对话->新建,弹窗如图
输入名称,自己任意起名,这里我起名CentOSMini。
主机框输入,查询到的CentOSMini的inet地址。
端口号,默认22,如果端口被占用可能导致连接失败。
点击用户身份验证,输入CentOSMini的账户和密码
配置完成,尝试连接。如果连接失败,请自行排查原因。
默认连接成功,开始安装Redis。
安转Redis
以下配置,默认用户都未完成,如果已经完成,再次执行不会有影响。
加载插件gcc
[root@localhost ~]# yum gcc
加载插件wget
[root@localhost ~]# yum wget
下载及安装Redis
Redis安装包网址
最新的安装包为redis-3.0.7.tar.gz
[root@localhost ~]#wget http://download.redis.io/releases/redis-3.0.7.tar.gz
[root@localhost ~]#tar zxvf redis-3.0..tar.gz
[root@localhost ~]# cd redis-3.0.
[root@localhost redis-3.0.]# make MALLOC=libc
启动Redis
[root@localhost redis-3.0.]# src/redis-server
:C Apr ::08.132 # Warning: no config file specified, using the default config. In order to specify a config file use src/redis-server /path/to/redis.conf
:M Apr ::08.132 * Increased maximum number of open files to (it was originally set to ).
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 3.0. (/) bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port:
| `-._ `._ / _.-' | PID: 14891
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-' :M Apr ::08.134 # WARNING: The TCP backlog setting of cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of .
:M Apr ::08.134 # Server started, Redis version 3.0.
:M Apr ::08.134 # WARNING overcommit_memory is set to ! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
:M Apr ::08.134 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
:M Apr ::08.135 * DB loaded from disk: 0.001 seconds
:M Apr ::08.135 * The server is now ready to accept connections on port
测试Redis
在XShell,打开一个新的终端标签
[root@localhost ~]# ls
anaconda-ks.cfg redis-3.0. redis-3.0..tar.gz
[root@localhost ~]# cd redis-3.0.
[root@localhost redis-3.0.]# src/redis-cli
127.0.0.1:> KEYS *
) "user:1"
) "test"
) "Manager"
) "name"
127.0.0.1:>
退出Redis命令行
[root@localhost redis-3.0.]# src/redis-cli
127.0.0.1:> quit
[root@localhost redis-3.0.]#
关闭Redis
Redis命令行下
[root@localhost redis-3.0.]# src/redis-cli
127.0.0.1:> shutdown
非Redis命令行下
[root@localhost redis-3.0.]# src/redis-cli shutdown
Redis学习笔记(3)-XShell连接CentOSMini,并安装Redis的更多相关文章
- redis学习笔记(2)
redis学习笔记第二部分 --配置文件介绍 二,解析redis的配置文件redis.conf常见配置参数说明redis.conf 配置项说明如下:1. Redis默认不是以守护进程的方式运行,可以通 ...
- Redis学习笔记六:持久化实验(AOF,RDB)
作者:Grey 原文地址:Redis学习笔记六:持久化实验(AOF,RDB) Redis几种持久化方案介绍和对比 AOF方式:https://blog.csdn.net/ctwctw/article/ ...
- Redis学习笔记~目录
回到占占推荐博客索引 百度百科 redis是一个key-value存储系统.和Memcached类似,它支持存储的value类型相对更多,包括string(字符串).list(链表).set(集合). ...
- Redis学习笔记4-Redis配置详解
在Redis中直接启动redis-server服务时, 采用的是默认的配置文件.采用redis-server xxx.conf 这样的方式可以按照指定的配置文件来运行Redis服务.按照本Redi ...
- Redis学习笔记7--Redis管道(pipeline)
redis是一个cs模式的tcp server,使用和http类似的请求响应协议.一个client可以通过一个socket连接发起多个请求命令.每个请求命令发出后client通常会阻塞并等待redis ...
- (转)redis 学习笔记(1)-编译、启动、停止
redis 学习笔记(1)-编译.启动.停止 一.下载.编译 redis是以源码方式发行的,先下载源码,然后在linux下编译 1.1 http://www.redis.io/download 先 ...
- Redis学习笔记(二)-key相关命令【转载】
转自 Redis学习笔记(二)-key相关命令 - 点解 - 博客园http://www.cnblogs.com/leny/p/5638764.html Redis支持的各种数据类型包括string, ...
- Redis 学习笔记4: Redis 3.2.1 集群搭建
在CenOS 6.7 linux环境下搭建Redis 集群环境 1.下载最新的Redis版本 本人下载的Redis版本是3.2.1版本,下载之后,解压,编译(make): 具体操作可以参考我的博文:R ...
- Redis学习笔记(2)——Redis的下载安装部署
一.下载Redis Redis的官网下载页上有各种各样的版本,如图 但是官网下载的Redis项目不正式支持Windows.如果需要再windows系统上部署,要去GitHub上下载.我下载的是Redi ...
- Redis学习笔记(1)- CentOS 6.4 安装Redis
Redis学习笔记(1)- CentOS 6.4 安装Redis 2013.10.13 学习环境 vm 10.1 + 默认.新装的干净 CentOS 6.4 64BIT系统 准备 1 ...
随机推荐
- 【洛谷P3960】列队题解
[洛谷P3960]列队题解 题目链接 题意: Sylvia 是一个热爱学习的女孩子. 前段时间,Sylvia 参加了学校的军训.众所周知,军训的时候需要站方阵. Sylvia 所在的方阵中有 n×m ...
- javascript小括号、中括号、大括号学习总结
作为一名编程人员,和括号打交道是必不可少的.你可知道在不同的上下文中,括号的作用是不一样的,今天就让我们简单总结下javascript小括号.中括号.大括号的用法. 总的来说,JavaScript中小 ...
- 出错with root cause
[背景:] 我自己写了一个项目,主页可以看到一个数据库里的一个应用的users用户表的所有数据,包括用户的年龄,姓名,出生日期等信息.后来又想再增加一个注册功能,写好了之后进行单元测试,结果就出现了w ...
- now
- AngularJS 关于ng-model和ng-bind还有{{}}
What's the difference between ng-model and ng-bind ng-bind has one-way data binding ($scope --> v ...
- 我的C#跨平台之旅(三):使用Entity Framework开发REST API
添加NuGet引用:EntityFramework 创建实体类:Book.Author 以及数据传输类:BookDTO.BookDetailDTO,代码如下: 创建DbContext类:BookDbC ...
- Leetcode11 Container With Most Water 解题思路 (Python)
今天开始第一天记录刷题,本人编程小白,如果有写的不对.或者能更完善的地方请个位批评指正! 准备按tag刷,第一个tag是array: 这个是array的第一道题:11. Container With ...
- phantomjs的安装和使用链接
1.先下载phantomjs并解压2.将phantomjs的bin目录配置到环境变量中3.测试phantomjs,cmd下输入phantomjs进入 (按 Ctrl + c 组 合键退出和 phant ...
- 【百度杯】ctf夺旗大战,16万元奖励池等你拿
寻找安全圈内最会夺flag的CTF职业玩家,将以个人方式参与夺旗,完全凭借个人在CTF中的技艺及造诣获得奖金回报. 周末少打一局LOL,玩一玩CTF也能挣个万元零花钱! **比赛时间: 9月至17年3 ...
- 每天学点SpringCloud(十):SpringCloud监控
今天我们来学习一下actuator这个组件,它不是SpringCloud之后才有的,而是SpringBoot的一个starter,Spring Boot Actuator.我们使用SpringClou ...