安装redis:

http://www.redis.cn/download.html

安装的前提条件:

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

wget http://download.redis.io/releases/redis-3.2.8.tar.gz
tar -zxvf redis-3.2..tar.gz
cd redis-3.2.8
#进行编译 make
make
#创建redis目录 /usr/local/redis
mkdir redis
#进入解压目录
cd /usr/local/redis-3.2.9
#安装目录
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..tar.gz
cd zookeeper-3.3./conf
拷贝zoo_samle.cfg为zoo.cfg
cp zoo_samle.cfg zoo.cfg
vi zoo.cfg
# The number of milliseconds of each tick
tickTime=
# The number of ticks that the initial
# synchronization phase can take
initLimit=
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=
# the directory where the snapshot is stored.
dataDir=/mnt/disk/word/children/zookeeper-3.3./data
dataLogDir=/mnt/disk/word/children/zookeeper-3.3./logs
# the port at which the clients will connect
clientPort=
dataDir=/mnt/disk/word/children/zookeeper-3.3.6/data
dataLogDir=/mnt/disk/word/children/zookeeper-3.3.6/logs

  注意:这里的data和logs是没有的,要自己创建 mkdir data ,mkdir logs

设置环境变量

vi /etc/profile

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

使环境变量生效

source /etc/profile

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

[root@iZ28mgdqcyxZ conf]# zkServer.sh start

设置redis & zookeeper 开机启动

vi /etc/rc.d/rc.local

#加载java环境变量 否则不能启动
export JAVA_HOME=/var/lib/jvm/jdk1..0_80
#启动zk
/mnt/disk/word/children/zookeeper-3.3./bin/zkServer.sh start #启动redis
/mnt/disk/word/children/redis/bin/redis-server /mnt/disk/word/children/redis/bin/redis.conf #在centos7中,/etc/rc.d/rc.local的权限被降低了,所以需要执行如下命令赋予其可执行权限
chmod +x /etc/rc.d/rc.local

centos 7防火墙:

0、开启防火墙:sudo systemctl start firewalld,service

1、关闭防火墙:sudo systemctl stop firewalld.service

2、关闭开机启动:sudo systemctl disable firewalld.service

3、开启开机启动:sudo systemctl enable firewalld.service

centos 6防火墙:

1、关闭防火墙:service iptables stop

2、开启防火墙:service iptables start

3、防火墙状态:service iptables status

完成

linux 安装redis zookeeper的更多相关文章

  1. Linux安装redis服务器

    Linux安装redis服务器 初次接触,这里简单的说下我遇到的情况以及安装方法,当然也是参考了诸位大神的. 确定虚拟机的主机IP. 1)首先需要一个linux虚拟机,确定虚拟机的ip ,输入命令:# ...

  2. Linux 安装Redis<准备>(使用Mac远程访问)

    阅读本文需要一定的Linux基础 一 Redis简介 redis是用c语言编写的一款开源的高性能键值对(key-value)数据库 它通过提供多种键值数据类型来适应不同场景下的存储需求 二 Redis ...

  3. 1.Linux安装redis

    Linux安装redis 操作系统是Centos7 1.下载压缩包 2.解压 3.编译 4.启动redis 5.设置redis.conf和防火墙端口开放,外网可以访问 1.下载压缩包 下载地址:htt ...

  4. Linux安装redis服务器和部署

    Linux安装redis和部署 第一步:下载安装包 wget http://download.redis.io/releases/redis-5.0.5.tar.gz 访问https://redis. ...

  5. Linux安装Redis,在测试阶段即make test出现“You need tcl 8.5 or newer in order to run the Redis test”问题解决方案

    Linux安装Redis,在测试阶段即make test出现"You need tcl 8.5 or newer in order to run the Redis test"问题 ...

  6. Linux安装Redis 6.0.5 ./install_server.sh报错

    Linux安装Redis 6.0.5 ./install_server.sh报错 linux 安装Redis6.0.5时 进行到./install_server.sh时报错, This systems ...

  7. Linux安装Redis步骤和make遇到的坑

    Linux安装Redis服务步骤 1.获取redis资源 ​​​​​​​cd /usr/local wget https://mirrors.huaweicloud.com/redis/redis-6 ...

  8. linux安装redis(转)

    一.Redis介绍 Redis是当前比较热门的NOSQL系统之一,它是一个key-value存储系统.和Memcache类似,但很大程度补偿了Memcache的不足,它支持存储的value类型相对更多 ...

  9. linux安装redis操作

    redis官网地址:http://www.redis.io/ 最新版本:2.8.3 在Linux下安装Redis非常简单,具体步骤如下(官网有说明): 1.下载源码,解压缩后编译源码. $ wget ...

随机推荐

  1. 运行Tomcat闪退问题,报的错误:Unsupported major.minor version 51.0

    在MyEclipse中运行tomcat,tomcat闪退并且报以下错误. java.lang.UnsupportedClassVersionError: org/apache/catalina/sta ...

  2. 百度map API

    1.做demo用的 http://developer.baidu.com/map/jsdemo.htm demo代码(外部使用的话需要提供密钥): <!DOCTYPE html> < ...

  3. vue首次进入微信没有标题问题

    首先实在路由改变的时候可以有标题的    首次进入路由不显示标题,查到很多,最有解决可以自定义标签, 后者引入一个包vue-wechat-title,我就是用的后者,前面的没有式过 上地址  http ...

  4. 应用四:Vue之VUEX状态管理

    (注:本文适用于有一定Vue基础或开发经验的读者,文章就知识点的讲解不一定全面,但却是开发过程中很实用的) 概念:Vuex 是一个专为 Vue.js 应用程序开发的状态管理模式.它采用集中式存储管理应 ...

  5. php进程控制

    1 POSIX扩展    posix_access($file,$mode)  查看文件的访问权限,可以由is_readable等几个函数代替    posix_errno()  返回posix函数执 ...

  6. 判断list数组里的json对象有无重复,有则去重留1个

    查找有无重复的 var personLength = [{ certType: '2015-10-12', certCode:'Apple'}, { certType: '2015-10-12', c ...

  7. mysql进阶练习

    一 .  MySQL进阶练习 /*==========================创建班级表=============================*/ CREATE TABLE class ( ...

  8. C语言基础 (6) 类型转换,数组与随机数

    复习 1.隐式转换 Double a Int b = 1 A = b //编译器自动转换把b转换为double类型后 再给a赋值(隐式转换) 2.强制类型转换 (变量)类型名 Int a = 1 // ...

  9. 《黑白团团队》第七次作业:团队项目设计完善&编码

    项目 内容 作业课程地址 任课教师首页链接 作业要求 团队项目 填写团队名称 黑白团团队 填写具体目标 认真负责,完成项目 任务1:团队软件项目设计完善 Github仓库上传<软件设计方案说明书 ...

  10. Java基础学习总结(65)——Java中的String,StringBuilder和StringBuffer比较

    字符串,就是一系列字符的集合. Java里面提供了String,StringBuffer和StringBuilder三个类来封装字符串,其中StringBuilder类是到jdk 1.5才新增的.字符 ...