*** [WARN] *** Your open file limit is currently 1024. It should be set to 65000 to avoid operational disruption. If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh WARNING: Starting Solr as the root user is a security risk and not considered best practice. Exiting. Please consult the Reference Guide. To override this check, start with argument ‘-force‘
这里会涉及到liunx服务器中文件限制数、进程限制数,这两个值
* hard nofile 65000 * soft nofile 65000
修改为: * soft nproc 65535 * hard nproc 65535 root soft nproc unlimited
还有一个managed-schema文件 ,主要是solr字段的一下映射配置,基本上照着原来的,修改一下就ok啦
都配置完成之后,在控制台手动dataimport一下,就能够通过关键字进行查询啦
springboot项目集成
pom中引入
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-solr</artifactId> </dependency>
如有Caused by: org.apache.logging.log4j.LoggingException: log4j-slf4j-impl cannot be present with log4j-to-slf4j 异常 , 则需要排除loggerjar包
<exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-logging</artifactId> </exclusion> </exclusions>
springboot application.properties配置文件
spring.data.solr.host=http://localhost:8983/solr/cms_core #需要指定具体的库
原文:https://www.cnblogs.com/melodyf/p/12694062.html