Scripts to install Solr 4.10.3 using puppet. Two ways to install are implemented:
- in a Linux VM (Fedora 20)
- on a Linux machine (tested on Fedora 20)
Solr is installed with Solr home, log-directory and index-directory outside of the Solr-distribution to make it easy to change to another release of Solr. Script for start on boot is provided.
Before installing in a VM you must have installed:
- Ruby
- Vagrant
- VirtualBox
To install on a Linux machine you must have installed:
- Ruby
- Puppet
Then clone the repository:
git clone https://github.com/bjornhjelle/solr-puppet.git
To install Solr in a VM
cd solr-puppet
vagrant up
Log in to the VM and start Solr
vagrant ssh
solr start
This uses the script that comes with the Solr distribution to start/stop Solr. Read more here.
The Solr admin interface can now be reached using URL: http://localhost:8983/solr
On the host machine:
cd sampledocs
./post.sh solr.xml
And verify that the document was indexed: http://localhost:8983/solr/collection1/select?q=*%3A*&wt=json&indent=true
Or use the full set of example docs available in the VM:
vagrant ssh
cd solr/example/exampledocs
./post.sh hd.xml
- Indexes will be stored in
/home/vagrant/indexes
- Log files will be stored in
/home/vagrant/logs
- Solr home is the directory
/home/vagrant/solr_home
(based on the example home i the distribution:example/solr
)
To install, first add the linux user to run solr, set a password, and log in as solr
:
useradd solr
passwd solr
su - solr
Then clone and apply puppet manifest:
git clone https://github.com/bjornhjelle/solr-puppet.git config
sudo puppet apply --modulepath config/provisioning/modules config/provisioning/manifests/server.pp
Solr should now have been started with Solr home set to config/solr_home where the collection1 core is configured.
Logged in as solr
, Solr can be started and stopped with the solr
script as described here. But Solr has now been configured to start on boot and can be stopped/restarted/started as a service:
sudo service solr stop|start|restart
TODO: fix this so systemd also works:
Solr can be stopped/restarted/started with systemctl
:
sudo systemctl stop|start|restart solr
Jetty port numbers for stopping and starting are set in the startup scripts that are provisioned by puppet to /etc/init.d/solr.