Skip to content

Commit

Permalink
Merge pull request #63 from palantirnet/solr-fixes
Browse files Browse the repository at this point in the history
Fix Solr installation
  • Loading branch information
becw authored Apr 5, 2018
2 parents 5aae6be + bb3ae0b commit f89521f
Show file tree
Hide file tree
Showing 52 changed files with 148 additions and 6,097 deletions.
1 change: 1 addition & 0 deletions dev/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Vagrant.configure("2") do |config|

config.vm.provision "ansible", type: :ansible do |ansible|
ansible.playbook = "../#{box_name}/#{box_name}.yml"
ansible.galaxy_role_file = "../#{box_name}/requirements.yml"
ansible.groups = {
"#{box_name}" => "default",
}
Expand Down
6 changes: 4 additions & 2 deletions drupalbox/CHANGELOG-0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ This project adheres to [Semantic Versioning](http://semver.org/).

### Added

### Fixed
- Removed Jetty in favor of Solr's bundled HTTP server
- Switched to the `geerlingguy.java` and `geerlingguy.solr` Ansible roles
- Updated serverspec tests for Solr

- Fixed the Jetty9 service
### Fixed

## [1.1.0] - 2017-11-09

Expand Down
8 changes: 5 additions & 3 deletions drupalbox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@

### Mailhog

Mailhog's smtp service listens on port 1025, and its http service listens on port 8025; you can find the web UI at `http://yoursite.local:8025`
Mailhog's smtp service listens on port `1025`, and its http service listens on port `8025`; you can find the web UI at `http://yoursite.local:8025`

### Solr

Solr is installed to `/usr/share/solr/current` with two default cores, `drupal7` and `drupal8`. Solr runs on port 8983, and the web UI can be found at `http://yoursite.local:8983/solr`.
This box runs Solr v4.5.1, to match one of the versions available on [Acquia](https://docs.acquia.com/article/how-test-custom-solr-schema-file-locally).

In order to use it, you need to start Jetty, which can be managed with [palantirnet/the-vagrant](https://github.com/palantirnet/the-vagrant) in the `Vagrantfile`.
Solr is installed to `/opt/solr` with two default cores, `drupal7` and `drupal8`. Solr runs on port `8983`, and the web UI can be found at `http://yoursite.local:8983/solr`.

The Solr service runs by default; when you're using [palantirnet/the-vagrant](https://github.com/palantirnet/the-vagrant), this can be managed in the `Vagrantfile`.
1 change: 1 addition & 0 deletions drupalbox/drupalbox.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@
"type": "ansible-local",
"playbook_dir": "provisioning",
"playbook_file": "drupalbox/drupalbox.yml",
"galaxy_file": "drupalbox/requirements.yml",
"inventory_groups": "drupalbox,all"
},
{
Expand Down
23 changes: 17 additions & 6 deletions drupalbox/drupalbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
rvm1_install_path: /home/vagrant/.rvm
php_xdebug_enabled: true
php_ini_sendmail_path: "/usr/local/bin/mhsendmail"
jetty_server_enabled: false
jetty_server_java_options: "-Xmx256m -Djava.awt.headless=true -Dsolr.solr.home=/usr/share/solr/current"
solr_cores:
- name: drupal7
folder: search_api_solr-7x-1.11-4.x
module: search_api_solr-7.x-1.12
subdir: solr-conf/4.x
- name: drupal8
folder: search_api_solr-8x-1.0-alpha5-4.x
module: search_api_solr-8.x-1.2
subdir: solr-conf/4.x
vars_files:
- vars/default/common.yml
- vars/dev/mysql.yml
Expand All @@ -30,8 +30,19 @@
}
- { role: memcached }
- { role: mailhog }
- { role: jetty9 }
- { role: solr }
- {
role: geerlingguy.java,
become: yes
}
- {
role: geerlingguy.solr,
solr_version: "4.5.1",
become: yes
}
- {
role: solr-configuration,
become: yes
}
- { role: apache }
- { role: mysql-client }
- { role: mysql-server }
Expand Down
7 changes: 7 additions & 0 deletions drupalbox/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---

- src: geerlingguy.java
version: 1.7.7

- src: geerlingguy.solr
version: 4.0.2
18 changes: 0 additions & 18 deletions drupalbox/tests/jetty_spec.rb

This file was deleted.

21 changes: 16 additions & 5 deletions drupalbox/tests/solr_spec.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
require_relative 'spec_helper.rb'

describe file("/usr/share/solr") do
describe file("/opt/solr") do
it { should be_directory }
end

describe file("/usr/share/solr/current") do
it { should be_symlink }
describe file("/var/log/solr.log") do
it { should be_file }
it { should be_owned_by 'solr' }
it { should be_grouped_into 'adm' }
end

describe file("/var/lib/jetty9/webapps/solr") do
it { should be_symlink }
describe service('solr') do
it { should be_enabled }
it { should be_running }
end

describe port(8983) do
it { should be_listening }
end

describe command('curl http://127.0.0.1:8983/solr/admin/info/system?wt=json') do
its(:stdout) { should match /"solr-spec-version":"4\.5\.1"/ }
end
2 changes: 2 additions & 0 deletions provisioning/roles/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
geerlingguy.java
geerlingguy.solr
24 changes: 0 additions & 24 deletions provisioning/roles/jetty/defaults/main.yml

This file was deleted.

7 changes: 0 additions & 7 deletions provisioning/roles/jetty/handlers/main.yml

This file was deleted.

59 changes: 0 additions & 59 deletions provisioning/roles/jetty/tasks/main.yml

This file was deleted.

14 changes: 0 additions & 14 deletions provisioning/roles/jetty/templates/default_jetty.j2

This file was deleted.

108 changes: 0 additions & 108 deletions provisioning/roles/jetty/templates/jetty.xml.j2

This file was deleted.

26 changes: 0 additions & 26 deletions provisioning/roles/jetty9/defaults/main.yml

This file was deleted.

Loading

0 comments on commit f89521f

Please sign in to comment.