|
| 1 | +<!-- |
| 2 | +Copyright (c) 2016 YCSB contributors. All rights reserved. |
| 3 | +
|
| 4 | +Licensed under the Apache License, Version 2.0 (the "License"); you |
| 5 | +may not use this file except in compliance with the License. You |
| 6 | +may obtain a copy of the License at |
| 7 | +
|
| 8 | +http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +
|
| 10 | +Unless required by applicable law or agreed to in writing, software |
| 11 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
| 13 | +implied. See the License for the specific language governing |
| 14 | +permissions and limitations under the License. See accompanying |
| 15 | +LICENSE file. |
| 16 | +--> |
| 17 | + |
| 18 | +## Quick Start |
| 19 | + |
| 20 | +This section describes how to run YCSB on Solr running locally. |
| 21 | + |
| 22 | +### 1. Set Up YCSB |
| 23 | + |
| 24 | +Clone the YCSB git repository and compile: |
| 25 | + |
| 26 | + git clone git://github.com/brianfrankcooper/YCSB.git |
| 27 | + cd YCSB |
| 28 | + mvn -pl com.yahoo.ycsb:solr6-binding -am clean package |
| 29 | + |
| 30 | +### 2. Set Up Solr |
| 31 | + |
| 32 | +There must be a running Solr instance with a core/collection pre-defined and configured. |
| 33 | +- See this [API](https://cwiki.apache.org/confluence/display/solr/CoreAdmin+API#CoreAdminAPI-CREATE) reference on how to create a core. |
| 34 | +- See this [API](https://cwiki.apache.org/confluence/display/solr/Collections+API#CollectionsAPI-api1) reference on how to create a collection in SolrCloud mode. |
| 35 | + |
| 36 | +The `conf/schema.xml` configuration file present in the core/collection just created must be configured to handle the expected field names during benchmarking. |
| 37 | +Below illustrates a sample from a schema config file that matches the default field names used by the ycsb client: |
| 38 | + |
| 39 | + <field name="id" type="string" indexed="true" stored="true" required="true" multiValued="false"/> |
| 40 | + <field name="field0" type="text_general" indexed="true" stored="true"/> |
| 41 | + <field name="field1" type="text_general" indexed="true" stored="true"/> |
| 42 | + <field name="field2" type="text_general" indexed="true" stored="true"/> |
| 43 | + <field name="field3" type="text_general" indexed="true" stored="true"/> |
| 44 | + <field name="field4" type="text_general" indexed="true" stored="true"/> |
| 45 | + <field name="field5" type="text_general" indexed="true" stored="true"/> |
| 46 | + <field name="field6" type="text_general" indexed="true" stored="true"/> |
| 47 | + <field name="field7" type="text_general" indexed="true" stored="true"/> |
| 48 | + <field name="field8" type="text_general" indexed="true" stored="true"/> |
| 49 | + <field name="field9" type="text_general" indexed="true" stored="true"/> |
| 50 | + |
| 51 | +If running in SolrCloud mode ensure there is an external Zookeeper cluster running. |
| 52 | +- See [here](https://cwiki.apache.org/confluence/display/solr/Setting+Up+an+External+ZooKeeper+Ensemble) for details on how to set up an external Zookeeper cluster. |
| 53 | +- See [here](https://cwiki.apache.org/confluence/display/solr/Using+ZooKeeper+to+Manage+Configuration+Files) for instructions on how to use Zookeeper to manage your core/collection configuration files. |
| 54 | + |
| 55 | +### 3. Run YCSB |
| 56 | + |
| 57 | +Now you are ready to run! First, load the data: |
| 58 | + |
| 59 | + ./bin/ycsb load solr6 -s -P workloads/workloada -p table=<core/collection name> |
| 60 | + |
| 61 | +Then, run the workload: |
| 62 | + |
| 63 | + ./bin/ycsb run solr6 -s -P workloads/workloada -p table=<core/collection name> |
| 64 | + |
| 65 | +For further configuration see below: |
| 66 | + |
| 67 | +### Default Configuration Parameters |
| 68 | +The default settings for the Solr node that is created is as follows: |
| 69 | + |
| 70 | +- `solr.cloud` |
| 71 | + - A Boolean value indicating if Solr is running in SolrCloud mode. If so there must be an external Zookeeper cluster running also. |
| 72 | + - Default value is `false` and therefore expects solr to be running in stand-alone mode. |
| 73 | + |
| 74 | +- `solr.base.url` |
| 75 | + - The base URL in which to interface with a running Solr instance in stand-alone mode |
| 76 | + - Default value is `http://localhost:8983/solr |
| 77 | + |
| 78 | +- `solr.commit.within.time` |
| 79 | + - The max time in ms to wait for a commit when in batch mode, ignored otherwise |
| 80 | + - Default value is `1000ms` |
| 81 | + |
| 82 | +- `solr.batch.mode` |
| 83 | + - Indicates if inserts/updates/deletes should be commited in batches (frequency controlled by the `solr.commit.within.time` parameter) or commit 1 document at a time. |
| 84 | + - Default value is `false` |
| 85 | + |
| 86 | +- `solr.zookeeper.hosts` |
| 87 | + - A list of comma seperated host:port pairs of Zookeeper nodes used to manage SolrCloud configurations. |
| 88 | + - Must be passed when in [SolrCloud](https://cwiki.apache.org/confluence/display/solr/SolrCloud) mode. |
| 89 | + - Default value is `localhost:2181` |
| 90 | + |
| 91 | +### Custom Configuration |
| 92 | +If you wish to customize the settings used to create the Solr node |
| 93 | +you can created a new property file that contains your desired Solr |
| 94 | +node settings and pass it in via the parameter to 'bin/ycsb' script. Note that |
| 95 | +the default properties will be kept if you don't explicitly overwrite them. |
| 96 | + |
| 97 | +Assuming that we have a properties file named "myproperties.data" that contains |
| 98 | +custom Solr node configuration you can execute the following to |
| 99 | +pass it into the Solr client: |
| 100 | + |
| 101 | + ./bin/ycsb run solr6 -P workloads/workloada -P myproperties.data -s |
| 102 | + |
| 103 | +If you wish to use SolrCloud mode ensure a Solr cluster is running with an |
| 104 | +external zookeeper cluster and an appropriate collection has been created. |
| 105 | +Make sure to pass the following properties as parameters to 'bin/ycsb' script. |
| 106 | + |
| 107 | + solr.cloud=true |
| 108 | + solr.zookeeper.hosts=<zkHost2>:<zkPort1>,...,<zkHostN>:<zkPortN> |
| 109 | + |
| 110 | + |
0 commit comments