Linux系统搭建Solr和Redis集群详细步骤

搭建Solr集群(SolrCloud

1.1 Zookeeper介绍

ZooKeeper是一个分布式的,开放源码的分布式应用程序协调服务,是GoogleChubby一个开源的实现,是HadoopHbase的重要组件。它是一个为分布式应用提供一致性服务的软件,提供的功能包括:配置维护、域名服务、分布式同步、组服务node管理等。

Zookeeper实现了高性能,高可靠性,和有序的访问。高性能保证了zookeeper能应用在大型的分布式系统上。高可靠性保证它不会由于单一节点的故障而造成任何问题

你运行一个zookeeper也是可以的,但是在生产环境中,你最好部署357个节点。部署的越多,可靠性就越高,当然最好是部署奇数个,偶数个不是不可以的,但是zookeeper集群是以宕机个数过半才会让整个集群宕机的选举机制,所以奇数个集群更佳。

1.2 介绍搭建环境

资料\solr资料

1.3  搭建zookeeper集群

1.3.1 软件上传

1.3.2 创建zookeeper-cluster目录

在/usr/local/src/下创建zookeeper-cluster目录

 

1.3.3 解压zookeeper该目录下

 

1.3.4 修改zookeeper名称

修改解压后的目录名称zookeeper-3.4.6zookeeper01

 

1.3.5 在zookeeper01下创建data、logs目录

zookeeper01下创建

1、 data目录(存放配置的服务或者节点等)

2、 logs目录(存放日志)

 

1.3.6 修改conf目录下的文件名称

进入conf目录下,将zoo_sample.cfg文件修改为zoo.cfg文件。

 

1.3.7 修改zoo.cfg文件

1、 指定data目录

2、 指定logs目录

3、 指定zookeeper节点编号

 

说明:2888端口用于zookeeper集群间数据同步传输,3888端口用于zookeeper的选举机制

# 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.

# do not use /tmp for storage, /tmp here is just

# example sakes.

# dataDir=/tmp/zookeeper

# the port at which the clients will connect

clientPort=2181

# the maximum number of client connections.

# increase this if you need to handle more clients

#maxClientCnxns=60

#

# Be sure to read the maintenance section of the

# administrator guide before turning on autopurge.

#

# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance

#

# The number of snapshots to retain in dataDir

#autopurge.snapRetainCount=3

# Purge task interval in hours

# Set to "0" to disable auto purge feature

#autopurge.purgeInterval=1

dataDir=/usr/local/src/zookeeper/zookeeper01/data

dataLogDir=/usr/local/src/zookeeper/zookeeper01/logs

server.1=192.168.200.128:2888:3888

server.2=192.168.200.128:4888:5888

server.3=192.168.200.128:6888:7888

1.3.8 data目录下创建myid文件

 

1.3.9 修改myid

指定该zookeeper是第几个节点

echo 1 > myid

查看文件中的值命令:

more myid

 

1.3.10 copy zookeeper02

 

修改:

1、 修改zoo.cfg文件

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值