This playbook is based on a great tutorial written by 2bits.
http://2bits.com/articles/configuring-apache-solr-4x-drupal-password-authentication.html
Thanks guys!
Even if the script does some security related configuration I don't guarantee that your Solr instance or your server will be secure. You have ensure this yourself. Read the license!
- Ansible playbook for running the role
- Closest mirror fetching for Solr
- Editable settings including
- Solr version (default: 4.7.2)
- System level user name
- Installation path
- Configuring core names and types (default/drupal)
- Support for Drupal's Solr modules (apachesolr/search_api_solr)
- Solr version 4.x only
- Config files are fetched from search_api_solr/solr-conf/4.x
- Vagrantfile for testing and development
- Ansible hosts file that points to the Vagrant box
- Ansible (tested on 1.6)
- Ubuntu (tested on 12.04 LTS)
- Vagrant (optional, tested on 1.5.1)
- Clone the repository
- Cd to the cloned folder and run:
$ vagrant up
- Run
$ ansible-playbook -i hosts play.yml --private-key=~/.vagrant.d/insecure_private_key
- After the script is run wait for a while for Apache Solr to start
- Navigate to http://192.168.56.107:8983/solr with your browser
- Clone the repository
- Cd to the cloned folder
- Edit the hosts inventory file to point to your server
- Change the remote_user in the play.yml file
- Run
$ ansible-playbook -i hosts play.yml ...
- You'll probably need to add -K to the end for prompting the sudo password
- If you don't use SSH keys for logging in you may need to add other parameters also. Try -c paramiko and -k. See all the available options with ansible-playbook -h.
Start/stop/restart Solr
Login to the server using ssh. Then...
$ sudo service solr start/stop/restart
Default settings are stored in roles/jiv_e.solr/default/main.yml and you can find plenty of documentation there also.
You can change the settings by editing a default settings file but it's better to override them. See below list for some places you can do that.
- At the command line after ansible-playbook -e parameter
- In the hosts file
- In files host_vars/hostname or group_vars/groupname
- You have to create these yourself and use host names or groups in your hosts file
- See http://docs.ansible.com/playbooks_best_practices.html#directory-layout
- See also the previous link to understand how to name hosts and form host groups