Instancedir and Datadir Need to Exist Before You Can Create the Core
At some point you may want to set up upwards a Solr cadre for the search feature on your site. Now you tin can ask us to practise that, which volition be done on your support time, or you can follow this uncomplicated guide to create your own Solr cores. To determine which version of Solr your server is running, y'all'll need to log in to your Solr Webapp. To practise that, go to: http:// yoursolrdomain .codeenigma.com:9090/manager/html. If you're unsure of the domain, port number (9090 in this case) or username/password combination (you lot should exist prompted for a username and password to access the webapp), please raise a ticket in Redmine requesting these details. Click on thesolr/ link, in the Applications tabular array. If you are presented with a GUI like the one below, the version of Solr on the server is iv.ten: If you are presented with a very basic screen with a listing of cores, then the version of Solr being used is three.ten. Click here for the guide for Solr 4.x Solr cores are unremarkably located in one of the post-obit locations:/var/lib/tomcat6/solr or/usr/share/tomcat6/solr. Y'all can see where the surroundings home is by looking at the solr.xml file in/etc/tomcat6/Catalina/localhost/. The line to look for is something like this: To begin setting up a new solr cadre, you volition first need to copy one of the existing cores in your Solr environment and rename information technology. In this example, you tin can run into there are two cores: To copy one of the cores to a new core, run this command: You will exist prompted for your sudo countersign, which is your LDAP password. You'll need to brand certain the ownership of the new core (both the parent directory and all sub-directories and files) istomcat6:tomcat6: Adjacent, you lot demand to delete anything inside the data directory of your new cadre past showtime moving to it: And and then running the following command: Next, yous will need to replace the files in theconf directory (/var/lib/tomcat6/solr/nameofcore/conf/) with the files required by your search module, be it Search API Solr or another module . So, for example, if you lot are using theSearch API Solr module, you would need to copy the files from sites/all/modules/contrib/search_api_solr/solr-conf/3.x/ to /var/lib/tomcat6/solr/nameofcore/conf/ and ensure the ownership of those files are tomcat6:tomcat6 . The adjacent step is to edit the solr.xml file back in the Solr home environment (/var/lib/tomcat6/solr), by running: At the lesser of that file, y'all should encounter something similar to this (probably with a unlike number of cores and unlike names): Add together another value to the end of that list for your new core: Finally, y'all need to restart the tomcat6 service so your new cadre tin exist utilised: This service takes a footling while to come back fully after beingness restarted, so deport that in mind if you lot see an mistake after refreshing the Solr Director Webapp. Afterwards the service has fully restarted, y'all will see the new cadre has appeared in your Webapp: If you are unsure equally to how to access your webapp, it can commonly be accessed via a URL similar to: yourdomain-solr1.codeenigma.com:9090/managing director/html. The port, 9090 in this example, may be different for you. If you lot are unsure of the port your solr instance is served on please create a ticket in Redmine and a sysadmin will become back to you. When you become to the Webapp, you will be presented with a screen very similar to this: Click the/solr link and you will be presented with a screen much similar the previous image. Over again, the location of the Solr cores could be in/var/lib/tomcat6/solr or/usr/share/tomcat6/solr. To create a new cadre, just copy one of the existing cores and rename it. In the example below, you lot can see there is one core, core0. To copy the unabridged contents of that directory to another, run this command: Be sure the owner of this new directory istomcat6. You lot tin can run this control to recursively modify the ownership of the directory: Side by side, you volition need to delete anything inside the data directory inside your new core. You tin run a command like this: This will delete everything in the current working directory. Next, yous will need to replace the files in the conf directory (/usr/share/tomcat6/solr/testcore/conf/) with the files required by your search module, be it Search API Solr or some other module . So, for instance, if y'all are using the Search API Solr module, you would need to copy the files from sites/all/modules/contrib/search_api_solr/solr-conf/four.x/ to /usr/share/tomcat6/solr/testcore/conf/ and ensure the ownership of those files are tomcat6:root . Next, go to your Solr director web interface, ordinarily something like this: yourdomain-solr.codeenigma.com:9090/director/html. Acquit in mind that the port your Solr example is running on may be dissimilar. If in doubt, heighten a ticket in Redmine and a sysadmin volition check for you. You may be prompted for a username and password to view this page. These would have been set upon installation of Solr, and so if you do not know them, please raise a ticket in Redmine requesting the details. You volition exist presented with a screen very similar to this: Click/solr to take you to the cadre admin page.Solr four.x and later offers a helpful GUI, which provides the ability to add together cores without the need to restart tomcat6. SelectCore Admin from the card on the left, so printingAdd Core. Fill up in theproper name andinstanceDir fields with the same proper name as the directory you created earlier when copying an existing core. Once y'all press Add Core, your new cadre will exist added to the list of cores. Even so, information technology would appear that if the tomcat6 serviceisrestarted later, the cadre that was added via the admin interface 'disappears'. To prevent this from happening if the service is restarted, yous will need to edit the thesolr.xml file in/usr/share/tomcat6/solr to include this line: inside the <cores> cake at the bottom of the file: In this example, that block looks similar this: Note that the <cores adminPath... line is on i line, not ii.Solr 3.x
<Surroundings name="solr/home" type="java.lang.String" value="/var/lib/tomcat6/solr" override="true" />
sudo cp -r core0 nameofcore
sudo chown -R tomcat6:tomcat6 nameofcore
cd nameofcore/data
sudo rm -rf *
sudo nano solr.xml
<cores adminPath="/admin/cores"> <core name="prod" instanceDir="prod" /> <core name="core0" instanceDir="core0" /> </cores>
<cadre name="nameofcore" instanceDir="nameofcore" />
sudo service tomcat6 restart
Solr 4.x
sudo cp -r core0 nameofcore
sudo chown -R tomcat6 nameofcore/
sudo rm -rf *
<core name="testcore" instanceDir="testcore" />
<cores adminPath="/admin/cores" host="${host:}" hostPort="${jetty.port:8983}" hostContext="${hostContext:solr}">
<cores adminPath="/admin/cores" host="${host:}" hostPort="${jetty.port:8983}" hostContext="${hostContext:solr}"> <core name="core0" instanceDir="core0" /> <core name="testcore" instanceDir="testcore" /> </cores>
Source: https://www.codeenigma.com/devops-hosting/faq/how-do-i-create-solr-core-my-server
0 Response to "Instancedir and Datadir Need to Exist Before You Can Create the Core"
Post a Comment