默认网页只有一个 索引库collection1,自己手动创建一个索引库collection2:
[root@baozi solr]# pwd
/usr/local/solr/example/solr
[root@baozi solr]#
[root@baozi solr]# ll
总用量 20
drwxr-xr-x. 2 root root 4096 9月 8 2014 bin
drwxr-xr-x. 4 root root 4096 5月 10 21:32 collection1
-rw-r--r--. 1 root root 2473 9月 8 2014 README.txt
-rw-r--r--. 1 root root 1715 9月 8 2014 solr.xml
-rw-r--r--. 1 root root 501 9月 8 2014 zoo.cfg
[root@baozi solr]# cp -r collection1/ collection2/
[root@baozi solr]#
[root@baozi solr]# pwd
/usr/local/solr/example/solr
[root@baozi solr]# cd collection2/
[root@baozi collection2]# ll
总用量 16
drwxr-xr-x. 6 root root 4096 5月 12 21:48 conf
-rw-r--r--. 1 root root 16 5月 12 21:48 core.properties
drwxr-xr-x. 4 root root 4096 5月 12 21:48 data
-rw-r--r--. 1 root root 2146 5月 12 21:48 README.txt
[root@baozi collection2]# vim core.properties
[root@baozi collection2]# more core.properties
name=collection2
[root@baozi collection2]#
//core.properties修改为2或删除
//重启solr:
[root@baozi solr]# bin/solr restart
Sending stop command to Solr running on port 8983 ... waiting 5 seconds to allow Jetty process 2628 to stop gracefully.
Waiting to see Solr listening on port 8983 [-]
Started Solr server on port 8983 (pid=3503). Happy searching!
[root@baozi solr]#
在网页里就可以看到了;
创建成功!
-----------------------------------------------------------------------------
多core:
solr start -s multicore/
[root@baozi multicore]# pwd
/usr/local/solr/example/multicore
[root@baozi multicore]# ll
总用量 24
drwxr-xr-x. 3 root root 4096 9月 8 2014 core0
drwxr-xr-x. 3 root root 4096 9月 8 2014 core1
drwxr-xr-x. 2 root root 4096 5月 10 21:23 exampledocs
-rw-r--r--. 1 root root 267 9月 8 2014 README.txt
-rw-r--r--. 1 root root 1588 9月 8 2014 solr.xml
-rw-r--r--. 1 root root 501 9月 8 2014 zoo.cfg
[root@baozi multicore]# ll -R core0
core0:
总用量 4
drwxr-xr-x. 2 root root 4096 5月 10 21:23 conf
core0/conf:
总用量 8
-rw-r--r--. 1 root root 1879 9月 8 2014 schema.xml
-rw-r--r--. 1 root root 4026 2月 28 02:09 solrconfig.xml
[root@baozi multicore]#