linux centos下载sl,linux下redis的安装、启动、关闭和卸载

edis 在Linux 和 在Windows 下的安装是有很大的不同的,和通常的软件安装是一样的.

一  下载 Redis 安装包

去redis 官网下载reids 安装包, redis 官网默认只提供Linux 的安装包,所以不用担心下载到windows 的安装包.笔者下载的是 redis-3.2.1.tar.gz. 下载的为redis 源码,应该使用源码安装方式安装redis.

二 安装redis

1. 解压: tar -zxvf redis-3.2.1.tar.gz

8244a956f6d116a93b8380dbc8fc27af.png

2. 进入解压后的目录,并执行编译操作:  make test

72245e9768f9b5b8ea66f6d98b68a3a7.png

3. 编译测试结束后,出现以下信息,证明没有问题:编译的命令放在src目录下

8535ae330e2f3ec9c5c6f5fca7b75b11.png

4. 编译成功之后,执行install操作即可:sudo make install

337b5268a4d264016a6a36328292928d.png

5. 目前redis 已经安装成功了redis 的相关命令都存放在../redis-3.2.1/src 目录下,同时在/usr/local/bin/ 目录下生成了如下文件:

f495f9b388bb877ee36597702871f1f1.png

二 redis 的卸载

1. 查看reids 是否在运行,如果在运行的话,先关闭

86829f790530541e65a66b2f47b5f0be.png

从图上可以看出,redis-server 目前正在6379 端口运行

2. 如果redis-server 服务正在后台运行,那么需停止redis-server 服务:

正常停止redis-server 服务,使用reids 客户端命令: redis-cli shutdown

d75826d5d8fe2363289503a3da075056.png

如果停止不了,则采取杀死进程的方式:kill -9 PID

2da7a5c31d357361b67ca95028b9528d.png

3. 删除/usr/local/lib 目录下与redis 相关的命令:

b1fbe911d49b8e0dd182e3857758bbd0.png

4. 删除redis 解压后的目录 redis-3.2.1 即可

三 redis 的启动

redis 安装成功之后,会生成相应的reids 命令文件, 所有的命令都在src 目录下,同时会再/usr/local/bin 目录下生成reids-* 的几个命令,这样我们在调用redis 的相关命令的时候可以不使用绝对路径.启动reids 有很多中方式,后台启动,脚本启动等.

1. redis 后台启动: redis-server &

此种方式没有指定配置文件,会使用默认的配置,并打印一个Warning: no config file ....

5e960e487daea0fb849a8f8222a757ac.png

按ctrl + C 可退出redis 启动窗口,此时redis 并不会关闭,而是会再后台运行,可通过命令查看: ps aux | grep redis

efef35a72d034d4a65d725ff3b287e07.png

2. 指定配置文件启动: redis-server  ***/redis.conf

解压redis 的原文后, 目录中有一个redis 配置模板 redis.conf , 我们可以复制一份,然后修改成自己的redis配置文件. 此处笔者只修改一个端口号, 将端口号修改为8080, 然后使用 此配置文件启动redis 服务

af972a12d2ad5b95fe42bdde5c34132c.png

关闭使用命令: redis-cli -p 8080 shutdown

3. 设置开机启动:

四 redis 客户客户段连接:

redis 安装成功之后,会生成redis-cli 客户端, 可以通过redis-cli 命令连接本地或者远程的redis服务器.redis-cli 命令有很多参数,常用的选项有-h -p -u -a , 对应于ip地址,端口号,用户名,密码,可通过 redis-cli --help 来查看redis-cli 的常用选项

1. 连接本地redis 示例:

212b460aff72fb662730cd73c4a15919.png

2. 连接远程redis:

83569b6a3a96b4fc41302d147cd8f5d7.png

五 关闭redis

1. 正常关闭本地redis :  redis-cli shutdown, 默认关闭本地6379的redis

df1815ac08fcf742e28834f91205992c.png

如果正常关闭不了,可以通过杀死线程关闭:

1a440b6f8515d3b11c1dccec90296f44.png

2. 远程关闭redis 服务器: redis-cli -h xxx.xxx.xxx.xxx  -p xxxx -u xxxx -a xxxx  shutdown

42cde42c0b13456d217d17741dbfe5b6.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
GrADS - Grid Analysis and Display System Version 1.8 http://grads.iges.org/grads GrADS Executables for UNIX & Linux GrADS is distributed free of charge, however certain copyright restrictions do apply; please read the "Licensing Information" at the end of this file. Versions of GrADS are available for several flavors of UNIX, Linux, PCs running Windows 95/NT or DOS, and MacIntosh computers. For download information consult http://grads.iges.org/grads/downloads.html The executables contained in this tar file are typically placed in the directory /usr/local/bin. If you do not have write permission for your /usr/local/bin directory, you can put them in the ~/bin subdirectory of your home directory. cd /usr/local/bin uncompress tarfile.Z tar xvf tarfile After unpacking the first tar file, you should have the following executables: gradsc Classic GrADS - readline only gradshdf GrADS with NCSA netCDF HDF, LATS, GUI, SDF gradsnc GrADS with unidata netCDF, LATS, GUI, SDF gradsdods DODS-enabled GrADS with unidata netCDF, LATS, GUI, SDF gribmap "Maps" a GRIB data set to a GrADS descriptor file gribscan Extracts grid info from a GRIB data set gxeps Converts GrADS metafiles to Postscript gxtran Displays metafiles stnmap Maps station data wgrib See http://wesley.wwb.noaa.gov/wgrib.html The second tar file (data.tar.Z) contains the GrADS fonts and maps data sets is also necessary and can be downloaded from http://grads.iges.org/grads/downloads.html. The contents of data.tar are typically placed in the directory /usr/local/lib/grads, the default location for these files. If you do not have write permission for /usr/local/lib/grads, you can place the files elsewhere, but you must also change the environment variable GADDIR so the GrADS executables will know where to find these files. cd dirname uncompress data.tar.Z tar xvf data.tar setenv GADDIR dirname (If dirname is not /usr/local/lib/grads) Documentation and Additional Information ---------------------------------------- Consult the GrADS homepage http://grads.iges.org/grads LICENSING INFORMATION --------------------- Grid Analysis and Display System (GrADS) Version 1.8 Copyright (c) 1988-2001 by Brian Doty (Center for Ocean-Land-Atmosphere Interactions, Institute for Global Environment and Society, Calverton, MD 20705) All Rights Reserved. Permission is granted for an individual or institution to use this software provided that: 1) The software is not sold in any way. 2) The software is not redistributed beyond your immediate working group without permission. 3) Attribution is given for any GrADS figures used in publications. 4) This copyright and no-warranty information is kept in a conspicuous location and that all references to this notice are maintained. 5) The user agrees to the following NO WARRANTY notice. NO WARRANTY The Grid Analysis and Display System (GrADS) is provided free of charge, thus is provided "as is" WITHOUT WARRANTY OF ANY KIND, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The entire risk as to the quality and performance of the program is with you. Should the GrADS program prove defective, you assume the cost of all necessary servicing, repair, or correction. In no event will Brian Doty and/or the Center for Ocean-Land-Atmosphere Interactions and/or the Institute for Global Environment and Society be liable to you for damages, including any lost profits, lost monies, or other special, incidental or consequential damages arising out of the use or inability to use (including but not limited to loss of data or data be rendered inaccurate or losses sustained by third parties or a failure of the program to operate with other software) the program, even if you have been advised of the possibility of such damages, or for any claim by any other party.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值