码迷,mamicode.com
首页 > 系统相关 > 详细

linux 安装redis zookeeper

时间:2017-12-26 19:57:59      阅读:243      评论:0      收藏:0      [点我收藏+]

标签:port   rect   number   UI   client   getting   oca   word   director   

 

安装redis:

安装的前提条件:

需要安装gcc:yum install gcc-c++

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
#安装目录
make install PREFIX=/usr/local/redis

如提示make无效需要安装gcc

安装完成

 复制配置文件redis.conf 到安装目录

技术分享图片

 

技术分享图片

修改配置文件 

daemonize yes 后台启动

技术分享图片

 

requirepass redis 设置密码为redis

技术分享图片

 

启动

[root@iZ28mgdqcyxZ bin]# ./redis-server redis.conf

 

安装zookeeper

安装之前要安装jdk 略

 wget http://mirror.bit.edu.cn/apache/zookeeper/zookeeper-3.3.6/zookeeper-3.3.6.tar.gz
#解压
 tar -zxvf zookeeper-3.3.6.tar.gz   
cd zookeeper-3.3.6/conf  
拷贝zoo_samle.cfg为zoo.cfg
cp  zoo_samle.cfg zoo.cfg
vi zoo.cfg
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial 
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between 
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
dataDir=/mnt/disk/word/children/zookeeper-3.3.6/data
dataLogDir=/mnt/disk/word/children/zookeeper-3.3.6/logs
# the port at which the clients will connect
clientPort=2181

 

设置环境变量

vi /etc/profile

 

#zookeeper
export ZOOKEEPER_HOME=/mnt/disk/word/children/zookeeper-3.3.6
export PATH=$PATH:$ZOOKEEPER_HOME/bin

使环境变量生效 

source /etc/profile

 

启动,任何地方都可以启动

[root@iZ28mgdqcyxZ conf]# zkServer.sh start

完成

linux 安装redis zookeeper

标签:port   rect   number   UI   client   getting   oca   word   director   

原文地址:https://www.cnblogs.com/chuanwazi/p/8119563.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!