Installs/configures Oculus.
- CentOS 6
- Fedora 17, 18, 19
- Red Hat Enterprise Linux 6
- Ubuntu 12.04, 12.10, 13.04
Third-Party Cookbooks
These attributes are under the node['oculus'] namespace.
| Attribute | Description | Type | Default |
|---|---|---|---|
| group | oculus group | String | node['oculus']['user'] |
| install_dir | Directory to install Oculus | String | /opt/oculus |
| install_ruby | Install Ruby packages | Boolean | true |
| install_ruby_gems | Install Ruby Gems | Boolean | true |
| log_path | Path for log files | String | /var/log/oculus |
| pid_path | Path for PID files | String | /var/run/oculus |
| results_explain | Explain results flag | Boolean | false |
| user | oculus user | String | oculus |
These attributes are under the node['oculus']['elasticsearch'] namespace.
| Attribute | Description | Type | Default |
|---|---|---|---|
| index | Metrics index name | String | metrics |
| install_dir | Directory where Elasticsearch is installed | String | /usr/local/elasticsearch |
| phrase_slop | Phrase slop | Fixnum | 20 |
| scorers | Array of Elasticsearch scorers | Array of Strings | [ "dtw", "euclidian" ] |
| servers | Array of Elasticsearch servers (A and B) | Array of Strings | [ "http://#{node['oculus']['elasticsearch']['server']['a']['host']}:#{node['oculus']['elasticsearch']['server']['a']['port']}", "http://#{node['oculus']['elasticsearch']['server']['b']['host']}:#{node['oculus']['elasticsearch']['server']['b']['port']}" ] |
| timeout | Timeout seconds | Fixnum | 30 |
These attributes are under the node['oculus']['elasticsearch']['scorer']['dtw'] namespace.
| Attribute | Description | Type | Default |
|---|---|---|---|
| radius | Radius for scorer | Fixnum | 5 |
| scale_points | Scale points for scorer | Fixnum | 25 |
| script | Script name for scorer | String | com.etsy.oculus.tsscorers.DTWScriptFactory |
These attributes are under the node['oculus']['elasticsearch']['scorer']['euclidian'] namespace.
| Attribute | Description | Type | Default |
|---|---|---|---|
| scale_points | Scale points for scorer | Fixnum | 25 |
| script | Script name for scorer | String | com.etsy.oculus.tsscorers.EuclidianScriptFactory |
These attributes are under the node['oculus']['elasticsearch']['server']['a'] and node['oculus']['elasticsearch']['server']['b'] namespaces.
| Attribute | Description | Type | Default |
|---|---|---|---|
| cluster | Elasticsearch cluster name | String | "Oculus Elasticsearch A" or "Oculus Elasticsearch B" |
| host | Elasticsearch hostname | String | node['fqdn'] |
| port | Elasticsearch port | Fixnum | 9200 |
These attributes are under the node['oculus']['importer'] namespace.
| Attribute | Description | Type | Default |
|---|---|---|---|
| minute | Crontab minute field | String | */2 |
These attributes are under the node['oculus']['redis'] namespace.
| Attribute | Description | Type | Default |
|---|---|---|---|
| host | Redis master hostname | String | node['fqdn'] |
| port | Redis master port | Fixnum | 6379 |
These attributes are under the node['oculus']['skyline'] namespace.
| Attribute | Description | Type | Default |
|---|---|---|---|
| host | Hostname | String | skyline.example.com |
| listener_port | Listener port | Fixnum | 2015 |
| metric_prefix | Prefix for mini metrics | String | mini |
| port | Redis port | Fixnum | 6379 |
These attributes are under the node['oculus']['source'] namespace.
| Attribute | Description | Type | Default |
|---|---|---|---|
| repo | Source repository | String | git://github.com/etsy/oculus.git |
| reference | Source reference | String | master |
These attributes are under the node['oculus']['webapp'] namespace.
| Attribute | Description | Type | Default |
|---|---|---|---|
| webapp_ip | IP to run webapp | String | 127.0.0.1 |
| webapp_port | Port to run webapp | Fixnum | 3000 |
recipe[oculus]default installation/configuration of almost self-contained Oculus server (still requires Elasticsearch servers)recipe[oculus::elasticsearch]installs/configures default Elasticsearch functionalityrecipe[oculus::elasticsearch-a]installs/configures default Elasticsearch cluster Arecipe[oculus::elasticsearch-b]installs/configures default Elasticsearch cluster Brecipe[oculus::elasticsearch-plugin]installs Elasticsearch pluginrecipe[oculus::importer]installs/starts Skyline importerrecipe[oculus::init]installs init scriptsrecipe[oculus::redis]installs/configures Redisrecipe[oculus::ruby]installs Ruby and RubyGems packagesrecipe[oculus::ruby_gems]installs RubyGems viabundle installrecipe[oculus::source]installs/configures Oculus via sourcerecipe[oculus::worker]installs/configures common worker functionalityrecipe[oculus::worker-master]installs/configures worker masterrecipe[oculus::worker-slave]installs/configures worker slaverecipe[oculus::webapp]installs/starts webapp
There are quite a few components necessary to run Oculus, including:
- Two separate Elasticsearch clusters (referred to as A and B in this cookbook)
- Resque/Redis Worker Master
- Skyline Importer
- Webapp
Optionally:
- Resque Worker Slaves
This handles installing/configuring all on the same box:
- Resque/Redis Worker Master
recipe[worker-master] - Skyline Importer
recipe[importer] - Webapp
recipe[webapp]
Setup:
- Build 2 Elasticsearch clusters (see elasticsearch-a and elasticsearch-b recipes)
- Set
node['oculus']['elasticsearch']['servers']ornode['oculus']['elasticsearch']['server']attributes appropriately - Set
node['oculus']['skyline']attributes appropriately - Add
recipe[oculus]to your node's run list.
Recipes are available to get Elasticsearch clusters running with the Oculus plugins.
- To install default A cluster: Add
recipe[oculus::elasticsearch-a]to your node's run list - To install default B cluster: Add
recipe[oculus::elasticsearch-b]to your node's run list - To just install Elasticsearch plugin: Add
recipe[oculus::elasticsearch-plugin]to your node's run list
Here's how you can quickly get testing or developing against the cookbook thanks to Vagrant and Berkshelf.
vagrant plugin install vagrant-berkshelf
vagrant plugin install vagrant-cachier
vagrant plugin install vagrant-omnibus
git clone git://github.com/bflad/chef-oculus.git
cd chef-oculus
vagrant up BOX # BOX being centos5, centos6, debian7, fedora18, fedora19, fedora20, freebsd9, ubuntu1204, ubuntu1210, ubuntu1304, or ubuntu1310
You can then SSH into the running VM using the vagrant ssh command.
The VM can easily be stopped and deleted with the vagrant destroy
command. Please see the official Vagrant documentation
for a more in depth explanation of available commands.
Please use standard Github issues/pull requests and if possible, in combination with testing on the Vagrant boxes.
See LICENSE file for more information.
- Author:: Brian Flad ([email protected])
- Copyright:: 2013 Brian Flad
