安装 redis [standlone模式]
下载redis版本:https://redis.io/download 我下载的是:redis-3.0.6
下载后,在linux上 tar -zxvf redis-3.0.6,进入redis-3.0.6 目录,使用make进行编译
在安装Redis,使用make命令编译的时候,抛出异常
[root@node1 redis-3.0.6]# make
cd src && make all
make[1]: Entering directory `/usr/local/development/redis-3.0.6/src'
CC adlist.o
/bin/sh: cc: command not found
make[1]: *** [adlist.o] Error 127
make[1]: Leaving directory `/usr/local/development/redis-3.0.6/src'
make: *** [all] Error 2
这个是本地的Linux没有安装gcc的原因,因为我的Linux没有联网所以使用离线安装,也就是先再Windows上下载RPM包,然后移动到Linux上手动安装
安装gcc的步骤:
在ftp://mirror.switch.ch/pool/4/mirror/scientificlinux/6.8/x86_64/os/Packages/连接里 下载gcc所需的RPM包
从网上查,需要下面这些包
cloog-ppl-0.15.7-1.2.el6.x86_64.rpm
cpp-4.4.7-17.el6.x86_64.rpm
gcc-4.4.7-17.el6.x86_64.rpm
gcc-c++-4.4.7-17.el6.x86_64.rpm
glibc-devel-2.12-1.192.el6.x86_64.rpm
glibc-headers-2.12-1.192.el6.x86_64.rpm
kernel-headers-2.6.32-642.el6.x86_64.rpm
libgomp-4.4.7-17.el6.x86_64.rpm
libstdc++-devel-4.4.7-17.el6.x86_64.rpm
mpfr-2.4.1-6.el6.x86_64.rpm
ppl-0.10.2-11.el6.x86_64.rpm
下载完后,新建个目录(在你安装应用的目录下即可,随意),将这些刚下载的包放到目录下,使用
[root@node1 gcc]# rpm -Uvh ppl-0.10.2-11.el6.x86_64.rpm
warning: ppl-0.10.2-11.el6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 192a7d7d: NOKEY
error: Failed dependencies:
libgmp.so.3()(64bit) is needed by ppl-0.10.2-11.el6.x86_64
可以看到使用rpm -ivh 有依赖问题,所以我使用的忽略依赖,强制安装
[root@node1 gcc]# rpm -ivh cloog-ppl-0.15.7-1.2.el6.x86_64.rpm --nodeps --force
warning: cloog-ppl-0.15.7-1.2.el6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 192a7d7d: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:cloog-ppl-0.15.7-1.2.el6 ################################# [100%]
[root@node1 gcc]# rpm -ivh cpp-4.4.7-17.el6.x86_64.rpm --nodeps --force
warning: cpp-4.4.7-17.el6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 192a7d7d: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:cpp-4.4.7-17.el6 ################################# [100%]
查看gcc是否安装成功
[root@node1 redis-3.0.6]# gcc --version
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-17)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
所有的RPM包安装完后,再使用make命令,抛出下面异常
[root@node1 redis-3.0.6]# make
cd src && make all
make[1]: Entering directory `/usr/local/development/redis-3.0.6/src'
CC adlist.o
/usr/libexec/gcc/x86_64-redhat-linux/4.4.7/cc1: error while loading shared libraries: libgmp.so.3: cannot open shared object file: No such file or directory
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory `/usr/local/development/redis-3.0.6/src'
make: *** [all] Error 2
说是缺少libgmp.so.3 我从http://www.rpmfind.net/linux/rpm2html/search.php?query=gmp&submit=Search+...&system=&arch=连接中下载里了 gmp-4.3.1-12.el6.x86_64.rpm 这个包并安装,再次使用make还是抛出异常
[root@node1 redis-3.0.6]# make
cd src && make all
make[1]: Entering directory `/usr/local/development/redis-3.0.6/src'
CC adlist.o
In file included from adlist.c:34:
zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directory
zmalloc.h:55:2: error: #error "Newer version of jemalloc required"
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory `/usr/local/development/redis-3.0.6/src'
make: *** [all] Error 2
在Redis的目录中有个redme文件,里面有这么一段
Selecting a non-default memory allocator when building Redis is done by setting
the `MALLOC` environment variable. Redis is compiled and linked against libc
malloc by default, with the exception of jemalloc being the default on Linux
systems. This default was picked because jemalloc has proven to have fewer
fragmentation problems than libc malloc.
To force compiling against libc malloc, use:
% make MALLOC=libc
To compile against jemalloc on Mac OS X systems, use:
% make MALLOC=jemalloc
Verbose build
这段大概意思是:在Redis时选择一个内存分配器是通过MALLOC变量来设置的,jemalloc是Linux的默认的值。如果你的linux中没有jemalloc 所以抛出这个异常。
使用make MALLOC=libc
安装完成
.......
.......
.......
LINK redis-cli
CC redis-benchmark.o
LINK redis-benchmark
CC redis-check-dump.o
LINK redis-check-dump
CC redis-check-aof.o
LINK redis-check-aof
Hint: It's a good idea to run 'make test' ;)
make[1]: Leaving directory `/usr/local/development/redis-3.0.6/src'
在{redis_home}/src/ 下,启动服务端 使用命令 ./redis-server
[root@node1 src]# ./redis-server
4017:C 16 Sep 15:06:57.727 # Warning: no config file specified, using the default config. In order to specify a config file use ./redis-server /path/to/redis.conf
4017:M 16 Sep 15:06:57.727 * Increased maximum number of open files to 10032 (it was originally set to 1024).
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 3.0.6 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 4017
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
4017:M 16 Sep 15:06:57.728 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
4017:M 16 Sep 15:06:57.728 # Server started, Redis version 3.0.6
4017:M 16 Sep 15:06:57.728 # WARNING overcommit_memory is set to 0! 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.
4017:M 16 Sep 15:06:57.728 # 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.
4017:M 16 Sep 15:06:57.728 * The server is now ready to accept connections on port 6379
4017:M 16 Sep 15:08:59.648 # User requested shutdown...
4017:M 16 Sep 15:08:59.648 * Saving the final RDB snapshot before exiting.
4017:M 16 Sep 15:08:59.649 * DB saved on disk
4017:M 16 Sep 15:08:59.649 # Redis is now ready to exit, bye bye...
在{redis_home}/src/ 下,启动客户端 使用命令 ./redis-cli
127.0.0.1:6379> set zhang 123
OK
127.0.0.1:6379> get zhang
"123"
查看redis 进程
[root@node1 redis-3.0.6]# ps -ef|grep redis
root 4071 3341 0 15:15 pts/4 00:00:00 ./redis-server *:6379
root 4075 3244 0 15:15 pts/2 00:00:00 grep --color=auto redis
=============================================================================================================================================================
停止redis 服务
[root@node1 src]# ./redis-cli shutdown
redis服务端
4071:M 16 Sep 15:17:03.867 # User requested shutdown...
4071:M 16 Sep 15:17:03.867 * Saving the final RDB snapshot before exiting.
4071:M 16 Sep 15:17:04.248 * DB saved on disk
4071:M 16 Sep 15:17:04.248 # Redis is now ready to exit, bye bye...
查看redis进程
[root@node1 src]# ps -ef |grep redis
root 4080 3341 0 15:19 pts/4 00:00:00 grep --color=auto redis
[root@node1 src]#
安装 redis [standlone模式]的更多相关文章
- spark的standlone模式安装和application 提交
spark的standlone模式安装 安装一个standlone模式的spark集群,这里是最基本的安装,并测试一下如何进行任务提交. require:提前安装好jdk 1.7.0_80 :scal ...
- Spring Boot 入门(十):集成Redis哨兵模式,实现Mybatis二级缓存
本片文章续<Spring Boot 入门(九):集成Quartz定时任务>.本文主要基于redis实现了mybatis二级缓存.较redis缓存,mybaits自带缓存存在缺点(自行谷歌) ...
- linux安装redis及主从复制、读写分离、哨兵模式
Redis安装与部署 版本最好选择3.0及以上.以后还可以部署Redis集群. 1.下载: [root@bogon redis-3.0.0]# cd /usr/local [root@bogon lo ...
- Ubuntu安装redis并配置远程、密码以及开启php扩展
一.前言 redis是当前流行的nosql数据库,很多网站都用它来做缓存,今天我们来安装并配置下redis 二.安装并配置redis 1.安装redis sudo apt-get install re ...
- centos7.0 安装redis集群
生产环境下redis基本上都是用的集群,毕竟单机版随时都可能挂掉,风险太大.这里我就来搭建一个基本的redis集群,功能够用但是还需要完善,当然如果有钱可以去阿里云买云数据库Redis版的,那个还是很 ...
- windows下与linux下安装redis及redis扩展
1. Redis的介绍 Redis是一个开源的使用ANSI C语言编写.支持网络.可基于内存亦可持久化的日志型.Key-Value数据库,并提供多种语言的API.从2010年3月15日起 ...
- 离线安装redis集群
Step0:redis集群组件需求 Step1:离线安装ruby Step2:离线安装rubygems Step3:安装rubygems的 redis api Step4:离线安装tcl 8.6 St ...
- windows下安装redis以及简单的事例
1.安装服务端下载地址:http://code.google.com/p/servicestack/wiki/RedisWindowsDownload我下载了一个 redis-2.0.0服务器包,解压 ...
- CentOS 安装Redis
redis是当前比较热门的NOSQL系统之一,它是一个key-value存储系统.和Memcached类似,但很大程度补偿了memcached的不足,它支持存储的value类型相对更多,包括strin ...
随机推荐
- Dfs+Spfa【p1606】[USACO07FEB]荷叶塘Lilypad Pond
Description 为了让奶牛们娱乐和锻炼,农夫约翰建造了一个美丽的池塘.这个长方形的池子被分成了M行N列个方格(1≤M,N≤30).一些格子是坚固得令人惊讶的莲花,还有一些格子是岩石,其余的只是 ...
- js获取屏幕
js获取屏幕(设备)宽高 <script language="javascript"> var h = ""; h += " 网页可见区域 ...
- C# 事件和Unity3D
http://zijan.iteye.com/blog/871207 翻译自: http://www.everyday3d.com/blog/index.php/2010/10/04/c-events ...
- 集合框架(上):学生选课(collection)
利用集合存储课程信息: 1.Course类 package com.collection; public class Course { public String id; public String ...
- iOS AudioSession详解 Category选择 听筒扬声器切换
在你读这篇文章之前,如果你不嫌读英文太累,推荐阅读下苹果iOS Human Interface Guidelines中Sound这一章. 选择一个Category AVAudioSessionCa ...
- SQLServer To MySQL 解决方案
最近在忙一个项目,就不详写了.过两天不忙了把项目总结一下. 思路: Access作为桥梁 1.SQLServer To Access 2007 在access里直接导入 2.Use t ...
- !!!!Linux系统开发 系列 4 进程资源 环境 fork()子进程 wait() waitpid()僵尸 孤儿进程
http://990487026.blog.51cto.com/10133282/1834893
- 关于各浏览器的cookie上限
IE6~IE6以下,每个域名最多20个cookie IE7及以上,每个域名最多50个cookie Firefox,每个域名最多50个cookie Opera,每个域名最多30个cookie Safar ...
- PHP empty()函数说明---用了N遍了就是记不住
从表面上看,很容易误解empty()函数是判断字符串是否为空的函数,其实并不是,我也因此吃了很多亏. empty()函数是用来测试变量是否已经配置.若变量已存在.非空字符串或者非零,则返回 false ...
- 2016.6.30 tomcat开启时,显示端口被占用,如何修改端口
开启tomcat时,有时候会显示端口8080已占用,所以需要将端口改为其他值. 找到tomcat的server.xml文件,修改为8088,如图所示: