linux 安装redis zookeeper

Posted chuanwazi

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了linux 安装redis zookeeper相关的知识,希望对你有一定的参考价值。

 

安装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

技术分享图片

 

启动

[[email protected] 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

 

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

[[email protected] conf]# zkServer.sh start

完成

以上是关于linux 安装redis zookeeper的主要内容,如果未能解决你的问题,请参考以下文章

Linux下安装zookeeper和redis,了解一下?

[Linux] linux下安装配置 zookeeper/redis/solr/tomcat/IK分词器 详细实例.

精简总结redis/rabbitmq/zookeeper在linux centos7上的安装

linux下安装zookeeper(单机版)

disconf环境搭建linux

[Linux]Linux下redis的安装及配置.