六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 1024|回复: 0

solr4.4+hadoop2.1.0beta整合

[复制链接]
 楼主| 发表于 2015-6-19 18:08:52 | 显示全部楼层 |阅读模式
solr4.4+hadoop2.1.0beta整合
solr4.4支持索引存储到hdfs中下载
hadoop2.1.0-beta下载
解压solr4.4,hadoop2.1.0-beta
我的solr是运行在tomcat web容器中
solr4.4用的是hadoop2.0.5alpha版本,如果不改成hadoop2.1.0-beta会报很多奇怪的错误。
删除solr webapp/WEB-INF/lib中的jar包,用我已经整合好的lib替换
整合好的tomcat下载
注意修改的地方
solrconfig.xml
<directoryFactory name="DirectoryFactory" class="solr.HdfsDirectoryFactory">  <str name="solr.hdfs.home">hdfs://192.168.1.100:9000/solr</str>  <bool name="solr.hdfs.blockcache.enabled">true</bool>  <int name="solr.hdfs.blockcache.slab.count">1</int>  <bool name="solr.hdfs.blockcache.direct.memory.allocation">true</bool>  <int name="solr.hdfs.blockcache.blocksperbank">16384</int>  <bool name="solr.hdfs.blockcache.read.enabled">true</bool>  <bool name="solr.hdfs.blockcache.write.enabled">true</bool>  <bool name="solr.hdfs.nrtcachingdirectory.enable">true</bool>  <int name="solr.hdfs.nrtcachingdirectory.maxmergesizemb">16</int>  <int name="solr.hdfs.nrtcachingdirectory.maxcachedmb">192</int></directoryFactory><lockType>${solr.lock.type:hdfs}</lockType> 我是在tomcat的catalina.sh指定solr.solr.home=$CATALINA_HOME/solr的
hadoop集群配置可以参考hadoop官方伪分布式
要修改yarn.resourcemanager.hostname,由于我RM,NM,SecondaryNameNode都是在一台机器,所以就直接指定这个为一台机器的主机名
启动hadoop后查看http://192.168.1.100:8088/cluster/nodes
如果所有节点都可以看到说明正常
这时启动solr会出现不能创建文件夹错误Problem creating directory:
所以把权限限制关闭掉并且支持webhdfs,修改hdfs-site.xml
<property>        <name>dfs.webhdfs.enabled</name>        <value>true</value>        <description>                Enable WebHDFS (REST API) in Namenodes and Datanodes.        </description> </property><property>        <name>dfs.permissions.enabled</name>        <value>false</value>        <description>If "true", enable permission checking in HDFS. If "false", permission checking is turned off, but all other behavior is unchanged. Switching from one parametervalue to the other does not change the mode, owner or group of files or directories.        </description></property> hadoop2的新特性是出现了yarn
关于yarn的介绍请详见http://hadoop.apache.org/docs/current/hadoop-yarn/hadoop-yarn-site/YARN.html


solr4.4+hadoop2.1.0beta整合

该会员没有填写今日想说内容.
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表