苦逼的solr+resin

2024-05-01 08:38
文章标签 resin solr

本文主要是介绍苦逼的solr+resin,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

按照网上介绍的安装方法配置,resin3.1.9&&solr1.4.1,官网可以下载

安装resin:

tar xzvf resin-version.tar.gz
cd resin-version
./configure --prefix=/opt/resin \
--enable-lfs \
--with-java-home=/path/to/your/jdk
make 
make install
配置solr:

cp apache-solr-1.4.1/example/webapps/solr.war /data/www/
cp -r apache-solr-1.4.1/example/solr/ /data/www/

另附resin的配置文件(大概改动的就是最后面十几行,具体含义还需仔细读读文档,太苦逼了):

<!--- Resin 3.1 configuration file.-->
<resin xmlns="http://caucho.com/ns/resin"xmlns:resin="http://caucho.com/ns/resin/core"><!-- adds all .jar files under the resin/lib directory --><class-loader><tree-loader path="${resin.home}/ext-lib"/><tree-loader path="${resin.root}/ext-lib"/><tree-loader path="${resin.home}/lib"/><tree-loader path="${resin.root}/lib"/></class-loader><!--- Management configuration-- Remote management requires at least one enabled admin user.--><management path="${resin.root}/admin"><user name="admin" password="password" disable="true"/></management><!--- Logging configuration for the JDK logging API.--><log name="" level="info" path="stdout:"timestamp="[%H:%M:%S.%s] {%{thread}} "/><!--- 'info' for production- 'fine' or 'finer' for development and troubleshooting--><logger name="com.caucho" level="info"/><logger name="com.caucho.java" level="config"/><logger name="com.caucho.loader" level="config"/><!--- For production sites, change dependency-check-interval to something- like 600s, so it only checks for updates every 10 minutes.--><dependency-check-interval>2s</dependency-check-interval><!--- Sets the default character encoding to utf-8---><character-encoding>utf-8</character-encoding><!--- You can change the compiler to "javac", "eclipse" or "internal".--><javac compiler="internal" args="-source 1.5"/><!-- Security providers.- <security-provider>-    com.sun.net.ssl.internal.ssl.Provider- </security-provider>--><!-- Uncomment to use Resin's XML implementations-- <system-property javax.xml.parsers.DocumentBuilderFactory-                 ="com.caucho.xml.parsers.XmlDocumentBuilderFactory"/>- <system-property javax.xml.parsers.SAXParserFactory-                 ="com.caucho.xml.parsers.XmlSAXParserFactory"/>--><cluster id="app-tier"><!-- sets the content root for the cluster, relative to server.root --><root-directory>.</root-directory><server-default><!-- The http port --><http address="10.0.1.50" port="8080"/><!--- The JVM arguments--><jvm-arg>-Xmx256m</jvm-arg><jvm-arg>-Xss1m</jvm-arg><jvm-arg>-Xdebug</jvm-arg><!--- Uncomment to enable admin heap dumps- <jvm-arg>-agentlib:resin</jvm-arg>--><!--- Configures the minimum free memory allowed before Resin- will force a restart.--><memory-free-min>1M</memory-free-min><!-- Maximum number of threads. --><thread-max>256</thread-max><!-- Configures the socket timeout --><socket-timeout>65s</socket-timeout><!-- Configures the keepalive --><keepalive-max>500</keepalive-max><keepalive-timeout>15s</keepalive-timeout><!--- If starting bin/resin as root on Unix, specify the user name- and group name for the web server user.-- <user-name>resin</user-name>- <group-name>resin</group-name>--></server-default><!-- define the servers in the cluster --><server id="" address="127.0.0.1" port="6800"/><!--- Defaults applied to each web-app.--><web-app-default><prologue><!--- Extension library for common jar files.  The ext is safe- even for non-classloader aware jars.  The loaded classes- will be loaded separately for each web-app, i.e. the class- itself will be distinct.--><class-loader><tree-loader path="${resin.root}/ext-webapp-lib"/></class-loader><!--- Enable EL expressions in Servlet and Filter init-param--><allow-servlet-el/></prologue><!--- Sets timeout values for cacheable pages, e.g. static pages.--><cache-mapping url-pattern="/" expires="5s"/><cache-mapping url-pattern="*.gif" expires="60s"/><cache-mapping url-pattern="*.jpg" expires="60s"/><cache-mapping url-pattern="*.png" expires="60s"/><!--- for security, disable session URLs by default.--><session-config><enable-url-rewriting>false</enable-url-rewriting></session-config><!--- For security, set the HttpOnly flag in cookies.- <cookie-http-only/>--><!--- Some JSP packages have incorrect .tld files.  It's possible to- set validate-taglib-schema to false to work around these packages.--><jsp><validate-taglib-schema>true</validate-taglib-schema><fast-jstl>true</fast-jstl></jsp></web-app-default><!-- includes the app-default for default web-app behavior --><resin:import path="${resin.home}/conf/app-default.xml"/><!--- Default host configuration applied to all virtual hosts.--><host-default><!--- With another web server, like Apache, this can be commented out- because the web server will log this information.--><access-log path="logs/access.log" format='%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"'rollover-period="1W"/><!-- creates the deploy directory for .ear expansion --><ear-deploy path="deploy"><ear-default><ejb-server><config-directory>WEB-INF</config-directory></ejb-server></ear-default></ear-deploy><!-- creates the deploy directory for .rar expansion --><resource-deploy path="deploy"/></host-default><!-- configures a deployment directory for virtual hosts --><host-deploy path="hosts"><host-default><resin:import path="host.xml" optional="true"/></host-default></host-deploy><!-- configures the default host, matching any host name --><host id="访问地址,自己设置" root-directory="/data/www/"><web-app id="/solr"root-directory="webapps/"archive-path="/data/www/solr.war"character-encoding="utf-8"><env-entry><env-entry-name>solr/home</env-entry-name><env-entry-type>java.lang.String</env-entry-type><env-entry-value>/data/www/solr</env-entry-value></env-entry></web-app></host></cluster>
</resin>


竟然resin启动不了,提示错误

/opt/resin/bin/httpd.sh: line 40: exec: -j: invalid option
exec: usage: exec [-cl] [-a name] file [redirection ...]

后来和JXG得对比了一下httpd.sh,发现稍有不同(看来还要学习学习shell啊):

原版为:

#! /bin/sh
#
# See contrib/init.resin for /etc/rc.d/init.d startup script
#
# resin.sh can be called like apachectl
#
# resin.sh         -- execs resin in the foreground
# resin.sh start   -- starts resin in the background
# resin.sh stop    -- stops resin
# resin.sh restart -- restarts resin
#
# resin.sh will return a status code if the wrapper detects an error, but
# some errors, like bind exceptions or Java errors, are not detected.
#
# To install, you'll need to configure JAVA_HOME and RESIN_HOME and
# copy contrib/init.resin to /etc/rc.d/init.d/resin.  Then
# use "unix# /sbin/chkconfig resin on"if test -n "${JAVA_HOME}"; thenif test -z "${JAVA_EXE}"; thenJAVA_EXE=$JAVA_HOME/bin/javafi
fi#
# trace script and simlinks to find the wrapper
#
if test -z "${RESIN_HOME}"; thenscript=`/bin/ls -l $0 | awk '{ print $NF; }'`while test -h "$script"doscript=`/bin/ls -l $script | awk '{ print $NF; }'`donebin=`dirname $script`RESIN_HOME="$bin/.."
fiexec $JAVA_EXE -jar ${RESIN_HOME}/lib/resin.jar $*

JXG得为:
#! /bin/sh
#
# See contrib/init.resin for /etc/rc.d/init.d startup script
#
# resin.sh can be called like apachectl
#
# resin.sh         -- execs resin in the foreground
# resin.sh start   -- starts resin in the background
# resin.sh stop    -- stops resin
# resin.sh restart -- restarts resin
#
# resin.sh will return a status code if the wrapper detects an error, but
# some errors, like bind exceptions or Java errors, are not detected.
#
# To install, you'll need to configure JAVA_HOME and RESIN_HOME and
# copy contrib/init.resin to /etc/rc.d/init.d/resin.  Then
# use "unix# /sbin/chkconfig resin on"if test -n "${JAVA_HOME}"; thenif test -z "${JAVA_EXE}"; thenJAVA_EXE=$JAVA_HOME/bin/javafi
fiif test -z "${JAVA_EXE}"; thenJAVA_EXE=java
fi#
# trace script and simlinks to find the wrapper
#
if test -z "${RESIN_HOME}"; thenscript=`/bin/ls -l $0 | awk '{ print $NF; }'`while test -h "$script"doscript=`/bin/ls -l $script | awk '{ print $NF; }'`donebin=`dirname $script`RESIN_HOME="$bin/.."
fiexec $JAVA_EXE -jar ${RESIN_HOME}/lib/resin.jar $*

这篇关于苦逼的solr+resin的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/951221

相关文章

Solr 使用Facet分组过程中与分词的矛盾解决办法

对于一般查询而言  ,  分词和存储都是必要的  .  比如  CPU  类型  ”Intel  酷睿  2  双核  P7570”,  拆分成  ”Intel”,”  酷睿  ”,”P7570”  这样一些关键字并分别索引  ,  可能提供更好的搜索体验  .  但是如果将  CPU  作为 Facet  字段  ,  最好不进行分词  .  这样就造成了矛盾  ,  解决方法

Solr部署如何启动

Solr部署如何启动 Posted on 一月 10, 2013 in:  Solr入门 | 评论关闭 我刚接触solr,我要怎么启动,这是群里的朋友问得比较多的问题, solr最新版本下载地址: http://www.apache.org/dyn/closer.cgi/lucene/solr/ 1、准备环境 建立一个solr目录,把solr压缩包example目录下的内容复制

大型分布式redis+solr+Linux+nginx+springmvc+mybatis电商项目

http://edu.csdn.net/course/detail/2798?locationNum=13&fps=1

Solr使用:3.Solr添加文档到索引

1.首先在创建好的CORE中添加自己需要的Field.打开 E:\Solr2016-05-03\SolrHome\solr\MySolr\conf\schema.xml 2.用JAVA程序进行添加 2.1 需要引入的Jar包 2.2 程序代码 package com.wiimedia.mryl.connection.solr; import java.io.IOExcep

Solr使用:2.Solr核的创建

1.将 E:\Solr2016-05-03\solr-5.3.1\dist文件夹中 : (1)solr-dataimporthandler-5.3.1jar (2)solr-dataimporthandler-extras-5.3.1.jar 两个jar包复制到 E:\Solr2016-05-03\apache-tomcat-7.0.68\webapps\solr\WEB-INF\li

Solr高亮及搜索逻辑探寻

Solr高亮及搜索逻辑探寻 原文:http://leoluo.top/2017/11/21/Solr%E6%95%B0%E5%AD%97%E9%AB%98%E4%BA%AE%E5%BC%82%E5%B8%B8/ Blog:Why So Serious Github: LeoLuo22 CSDN: 我的CSDN 0x00 前言 马上就要发版本了,这次版本要新上对产品和功能

solr环境搭建(三)

前一篇链接 http://blog.csdn.net/u013252072/article/details/50070213 前一篇已经介绍介绍如何添加collection,本篇接上篇介绍如何添加IKAnalyzer分词器 下载IKAnalyzer所需要的jar包和文件 1、解压IKAnalyzer.zip 2、将IKAnalyzer2012FF_u1.jar放在t

solr环境搭建(二)

前一篇链接 http://blog.csdn.net/u013252072/article/details/50069861 前一篇已经介绍solr环境是如何搭建,本篇接上篇介绍如何添加collection 1、在E:\solr\solrhome目录下,新建一个coretest文件夹。 2、在解压的solr-4.10.0\example\multicore\core0目录中,复

solr环境搭建(一)

1、到apache下载solr,地址: http://mirrors.hust.edu.cn/apache/lucene/solr/ 2、解压出solr-4.10.0 3、复制solr-4.10.0\example\webapps中的solr.war文件到tomcat安装目录中的webapps文件夹下 4、运行tomcat。(忽略怎么运行tomcat),tomcat会自动解

转发 Elastic Search 和 Solr 你用哪个?

1、搜索引擎选择: Elasticsearch与Solr 链接 2、ElasticSearch(ES)和solr的关系和区别 链接 3、[译]ElasticSearch vs. Solr 链接 4、全文搜索引擎 Elasticsearch 入门教程 链接