Ubuntu 14.04下适应Docker搭建solrCloud集群(2)

Ubuntu 14.04下适应Docker搭建solrCloud集群

六、在容器server1中安装jdk1.8并配置java环境变量

1.解压缩文件

tar -zxvf jdk1.8.0_141.tar.gz -C /usr/local/java/

2.向/etc/profile文件中追加下面内容:

export JAVA_HOME=/usr/local/java/jdk1.8.0_141

export JRE_HOME=${JAVA_HOME}/jre

export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib

export PATH=$PATH:${JAVA_HOME}/bin

3.让文件生效

source /etc/profile

4.验证java成功安装

java -version

Ubuntu 14.04下适应Docker搭建solrCloud集群

七、在容器server1中安装配置zookeeper-3.4.10

1.解压zookeeper 安装包到/usr/local目录中

tar -zxvf zookeeper-3.4.10.tar.gz -C /usr/local/

2.创建zookeeper的data和logs目录,确保拥有读写权限

mkdir /home/tank/zookeeper/data

mkdir /home/tank/zookeeper/log

3.将zookeeper安装目录下conf文件夹中的zoo_sample.cfg重命名为zoo.cfg

Ubuntu 14.04下适应Docker搭建solrCloud集群

4.修改zoo.cfg内容,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.

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

# example sakes.

dataDir=/home/tank/zookeeper/data

dataLogDir=/home/tank/zookeeper/log

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

#

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

server.1=172.18.0.11:2888:3888

server.2=172.18.0.12:2888:3888

server.3=172.18.0.13:2888:3888

5.进入/home/tank/zookeeper/data中,新建myid文件,写入1

Ubuntu 14.04下适应Docker搭建solrCloud集群

注:其他两个节点的myid内容应分别是2和3

八、在容器server1中安装配置solr-6.6.0

1.解压solr-6.6.0.tgz到/usr/local目录下

tar -zxvf solr-6.6.0.tgz -C /usr/local/

Ubuntu 14.04下适应Docker搭建solrCloud集群

2.创建solrCloud根目录solr_cloud_home文件夹

mkdir /usr/local/solrCloud/solr_cloud_home

3.复制/usr/local/solr-6.6.0/server/solr/目录下的文件到solr_cloud_home中

cp /usr/local/solr-6.6.0/server/solr/* /usr/local/solrCloud/solr_cloud_home/

查看solr_cloud_home目录,如图所示:

ls

Ubuntu 14.04下适应Docker搭建solrCloud集群

Ubuntu 14.04下适应Docker搭建solrCloud集群

4.创建配置存放目录solr_cloud_collection文件夹

mkdir /usr/local/solrCloud/solr_cloud_collection

5.复制/usr/local/solr-6.6.0/example/example-DIH/solr/solr/目录下的文件到solr_cloud_collection/cloud_core中

mkdir /usr/local/solr_cloud_collection/cloud_core

cp /usr/local/solr-6.6.0/example/example-DIH/solr/solr/* /usr/local/solr_cloud_collection/cloud_core/

ls

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/71fef0be45b9d78864060d1b398bbfed.html