redis编译安装
2.解压redis压缩包,并重命名为redis,移动到/usr/local/下
#tar -xzvf redis-2.8.3.tar.gz
#cp -r redis-2.8.3 /usr/local/
#mv redis-2.8.3 redis
3.切换工作目录到redis下,打开README文件,按照文件中的步骤安装redis
#cd /usr/local/redis/
#vim README
4.编译redis源码
#make ##当前系统的位数,64位机器会便以为64位程序
或者#make 32bit #编译为32位程序
或者#make CFLAGS="-m32 -march=native" LDFLAGS="-m32" #编译为32位程序
没报错就代表编译成功了。
5.启动redis的服务,并使用redis-cli客户端测试使用(当前目录为/usr/local/redis/)
#cd src
##启动redis服务,使用默认配置
#./redis-server &
##启动redis服务,使用自定义的redis配置(例:redis.conf)
#./redis-server /path/to/redis.conf
#可以通过添加正确的参数修改 redis配置文件的内容,临时修改
# ./redis-server --port 9999 --slaveof 127.0.0.1 6379
# ./redis-server /etc/redis/6379.conf --loglevel debug
6.运行redis客户端
[root@hadoop1 redis]# ./src/redis-cli
127.0.0.1:6379> ping
PONG
127.0.0.1:6379> set foo bar
OK
127.0.0.1:6379> get foo
"bar"
127.0.0.1:6379> incr mycounter
(integer) 1
127.0.0.1:6379> incr mycounter
(integer) 2
127.0.0.1:6379> incr mycounter
(integer) 3
127.0.0.1:6379> incr mycounter
(integer) 4
127.0.0.1:6379>
7.在ubuntu和Debian生产环境中安装redis二进制。
[root@hadoop1 redis]# make install
安装redis到系统上,也不会配置初始化的脚本和配置文件,如果只是玩一玩redis,
这一步不是必须的,但是如果安装在一个生产中的环境中,那么可以使用以下脚本安装
[root@hadoop1 redis]#cd utils
#./install_server
该脚本会提问少量的问题,并且会做好redis随系统作为daemon进程启动的每件事。
[root@hadoop1 utils]# ./install_server.sh
Welcome to the redis service installer
This script will help you easily set up a running redis server
Please select the redis port for this instance: [6379]
Selecting default: 6379
Please select the redis config file name [/etc/redis/6379.conf]
Selected default - /etc/redis/6379.conf
Please select the redis log file name [/var/log/redis_6379.log]
Selected default - /var/log/redis_6379.log
Please select the data directory for this instance [/var/lib/redis/6379]
Selected default - /var/lib/redis/6379
Please select the redis executable path [/usr/local/bin/redis-server]
s#^port [0-9]{4}$#port 6379#;s#^logfile .+$#logfile /var/log/redis_6379.log#;s#^dir .+$#dir /var/lib/redis/6379#;s#^pidfile .+$#pidfile /var/run/redis_6379.pid#;s#^daemonize no$#daemonize yes#;
Copied /tmp/6379.conf => /etc/init.d/redis_6379
Installing service...
./install_server.sh: line 178: update-rc.d: command not found
exists, process is already running or crashed
Installation successful!
可以通过/etc/init.d/redis_<portnumber> start/stop来启动和关闭redis服务
低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。
持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。
- 上一篇
Hadoop学习之HBase基础知识、操作和原理
Hadoop学习之HBase基础知识、操作和原理 1. HBase 简介 HBase(hadoop DataBase)是一个高可靠,高性能面向列,可伸缩的分布式存储系统,利用HBase技术可在廉价PC server 上搭建大规模结构化存储集群。HBase 利用HDFS作为其文件系统,利用Hadoop MapReduce来处理HBase中的海量数据 2. HBase Shell 操作 HBase 可执行参数 hbase shell a)创建表的帮助语法(create) b)获取行或单元的值(get) c)列出hbase 上的所有表(list) d)删除表(drop) 删除表之前必须先让表失效:disable ‘t1’ e)向hbase指定的hbase表单元添加值(put) f)获取指定表的相关信息(scan) g)使表失效(disable) h)使表生效(enable) 实例: 3. HBase 配置 <configuration> <property> <name>hbase.rootdir</name> <value>h...
- 下一篇
启动Hadoop集群和HBase集群脚本
#!/bin/sh #echo "waring" #read NAME #等待用户输入并把输入的值付给NAME NAME=$1 #将脚本第一个参数赋给NAME #引用变量时加上"{}",是个好习惯,利于shell辨别变量边界 if [ -z ${NAME} ] ;then #默认如果为空,hadoop start echo "1.start hadoop on ${HOSTNAME}" start-all.sh elif [ "${NAME}" = "hadoop" ];then #如果NAME中的值为"hadoop",则继续执行if echo "2.start hadoop on ${HOSTNAME}" start-all.sh elif [ "${NAME}" = "hbase" ] ;then #否则就执行else if start-all.sh #for loop in 1 2 3 NUM=1 <pre name="code" class="plain">#测试的zookeeper服务器集群是三个节点 while [ ${NUM} -lt 4 ] do echo ...
相关文章
文章评论
共有0条评论来说两句吧...
文章二维码
点击排行
推荐阅读
最新文章
- Docker安装Oracle12C,快速搭建Oracle学习环境
- Springboot2将连接池hikari替换为druid,体验最强大的数据库连接池
- CentOS6,CentOS7官方镜像安装Oracle11G
- Jdk安装(Linux,MacOS,Windows),包含三大操作系统的最全安装
- CentOS关闭SELinux安全模块
- CentOS7编译安装Gcc9.2.0,解决mysql等软件编译问题
- Windows10,CentOS7,CentOS8安装MongoDB4.0.16
- Hadoop3单机部署,实现最简伪集群
- SpringBoot2编写第一个Controller,响应你的http请求并返回结果
- Eclipse初始化配置,告别卡顿、闪退、编译时间过长