记得关闭防火墙,否则会提示启动失败(重要)
chkconfig iptables off 重启后生效
在zoo.cfg配置文件中
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/hadoop/package/zookeeper-3.4.5/data
# the port at which the clients will connect
clientPort=2181
server.1=192.168.0.146:2888:3888
server.2=192.168.0.142:2888:3888
server.3=192.168.0.145:2888:3888
需要修改的:
dataDir=/home/hadoop/package/zookeeper-3.4.5/data
里需要创建一个myid文件里面的值是配置文件中server.后的值
如:server.1=192.168.0.146:2888:3888 里面的值是1
Loading of "/solr/zookeeper?wt=json" failed (HTTP-Status 404)
"Zookeeper is not configured for this Solr Core. Please try connecting to an alternate zookeeper address."
将配置文件复制到其他服务器上:
java -classpath .:/home/hadoop/cloudsolr/tomcat-7.0.55/webapps/solr/WEB-INF/lib/* org.apache.solr.cloud.ZkCLI -cmd upconfig -zkhost 192.168.0.157:2181,1192.168.0.158:2181,192.168.0.159:2181 -confdir /home/hadoop/cloudsolr/solrhome/collection1/conf -confname myconf
同步到节点:
java -classpath .:/home/hadoop/cloudsolr/tomcat-7.0.55/webapps/solr/WEB-INF/lib/* org.apache.solr.cloud.ZkCLI -cmd linkconfig -collection collection1 -confname myconf -zkhost 192.168.0.157:2181,1192.168.0.158:2181,192.168.0.159:2181
错误提示:log4j:WARN No appenders could be found for logger (org.apache.zookeeper.ZooKeeper).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
错误提示
adoop@slave3 solrlib]$ java -classpath .:/home/hadoop/package/solrlib/* org.apache.solr.cloud.ZkCLI -cmd upconfig -zkhost 192.168.0.157:2181,192.168.0.158:2181,192.168.0.159:2181 -confdir .:/home/hadoop/package/solrconfig -confname myconf
Failed to instantiate SLF4J LoggerFactory
Reported exception:
java.lang.NoClassDefFoundError: org/apache/log4j/Level
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:129)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:302)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:276)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:288)
at org.apache.solr.common.cloud.SolrZkClient.<clinit>(SolrZkClient.java:72)
at org.apache.solr.cloud.ZkCLI.main(ZkCLI.java:175)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Level
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 7 more
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Level
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:129)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:302)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:276)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:288)
at org.apache.solr.common.cloud.SolrZkClient.<clinit>(SolrZkClient.java:72)
at org.apache.solr.cloud.ZkCLI.main(ZkCLI.java:175)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Level
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 7 more
Load collection config from:/collections/collection1
2465 [coreLoadExecutor-6-thread-1] ERROR org.apache.solr.common.cloud.ZkStateReader ?.Specified config does not exist in ZooKeeper:collection1
2469 [coreLoadExecutor-6-thread-1] ERROR org.apache.solr.core.CoreContainer ?.Error creating core [collection1]: Specified config does not exist in ZooKeeper:collection1
org.apache.solr.common.cloud.ZooKeeperException: Specified config does not exist in ZooKeeper:collection1
错误原因:
启动错误提示:
HTTP Status 500 - {msg=SolrCore 'collection1' is not available due to init failure: Could not load conf for core collection1:
Error loading solr config from solr/collection1/conf/solrconfig.xml,trace=org.apache.solr.common.SolrException: SolrCore 'collection1'
is not available due to init failure: Could not load conf for core collection1: Error loading solr config from solr/collection1/conf/solrconfig.xml at