Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion bin/bindings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ rocksdb:site.ycsb.db.rocksdb.RocksDBClient
s3:site.ycsb.db.S3Client
scylla:site.ycsb.db.scylla.ScyllaCQLClient
solr7:site.ycsb.db.solr7.SolrClient
solr9:site.ycsb.db.solr9.SolrClient
tarantool:site.ycsb.db.TarantoolClient
tablestore:site.ycsb.db.tablestore.TableStoreClient
voltdb:site.ycsb.db.voltdb.VoltClient4
zookeeper:site.ycsb.db.zookeeper.ZKClient
zookeeper:site.ycsb.db.zookeeper.ZKClient
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ LICENSE file.
<module>seaweedfs</module>
<module>scylla</module>
<module>solr7</module>
<module>solr9</module>
<module>tarantool</module>
<module>tablestore</module>
<module>voltdb</module>
Expand Down
118 changes: 118 additions & 0 deletions solr9/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
<!--
Copyright (c) 2023 YCSB contributors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you
may not use this file except in compliance with the License. You
may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied. See the License for the specific language governing
permissions and limitations under the License. See accompanying
LICENSE file.
-->

## Quick Start

This section describes how to run YCSB on Solr running locally.

### 1. Set Up YCSB

Clone the YCSB git repository and compile:

git clone git://github.com/brianfrankcooper/YCSB.git
cd YCSB
mvn -pl site.ycsb:solr9-binding -am clean package

### 2. Set Up Solr

There must be a running Solr instance with a core/collection pre-defined and configured.
- See this [API](https://solr.apache.org/guide/solr/9_2/configuration-guide/coreadmin-api.html#coreadmin-create) reference on how to create a core.
- See this [API](https://solr.apache.org/guide/solr/9_2/deployment-guide/collection-management.html#create) reference on how to create a collection in SolrCloud mode.

The `conf/schema.xml` configuration file present in the core/collection just created must be configured to handle the expected field names during benchmarking.
Below illustrates a sample from a schema config file that matches the default field names used by the YCSB client:

<field name="id" type="string" indexed="true" stored="true" required="true" multiValued="false"/>
<field name="field0" type="text_general" indexed="true" stored="true"/>
<field name="field1" type="text_general" indexed="true" stored="true"/>
<field name="field2" type="text_general" indexed="true" stored="true"/>
<field name="field3" type="text_general" indexed="true" stored="true"/>
<field name="field4" type="text_general" indexed="true" stored="true"/>
<field name="field5" type="text_general" indexed="true" stored="true"/>
<field name="field6" type="text_general" indexed="true" stored="true"/>
<field name="field7" type="text_general" indexed="true" stored="true"/>
<field name="field8" type="text_general" indexed="true" stored="true"/>
<field name="field9" type="text_general" indexed="true" stored="true"/>

If running in [SolrCloud](https://solr.apache.org/guide/solr/9_2/deployment-guide/cluster-types.html#solrcloud-mode) mode ensure there is an external Zookeeper cluster running.
- See [here](https://solr.apache.org/guide/solr/9_2/deployment-guide/zookeeper-ensemble.html) for details on how to set up an external Zookeeper cluster.
- See [here](https://solr.apache.org/guide/solr/9_2/deployment-guide/zookeeper-file-management.html) for instructions on how to use Zookeeper to manage your core/collection configuration files.

### 3. Run YCSB

Now you are ready to run! First, load the data:

./bin/ycsb load solr9 -s -P workloads/workloada -p table=<core/collection name>

Then, run the workload:

./bin/ycsb run solr9 -s -P workloads/workloada -p table=<core/collection name>

For further configuration see below:

### Default Configuration Parameters
The default settings for the Solr node that is created is as follows:

- `solr.cloud`
- A Boolean value indicating if Solr is running in SolrCloud mode. If so there must be an external Zookeeper cluster running also.
- Default value is `true` and therefore expects Solr to be running in cloud mode.

- `solr.base.url`
- The base URL in which to interface with a running Solr instance in stand-alone mode
- Default value is `http://localhost:8983/solr

- `solr.commit.within.time`
- The max time in ms to wait for a commit when in batch mode, ignored otherwise
- Default value is `1000ms`

- `solr.batch.mode`
- Indicates if inserts/updates/deletes should be committed in batches (frequency controlled by the `solr.commit.within.time` parameter) or commit 1 document at a time.
- Default value is `false`

- `solr.zookeeper.hosts`
- A list of comma separated host:port pairs of Zookeeper nodes used to manage SolrCloud configurations.
- Must be passed when in [SolrCloud](https://solr.apache.org/guide/solr/9_2/deployment-guide/cluster-types.html#solrcloud-mode) mode.
- Default value is `localhost:2181`

- `solr.basicAuth`
- Enables [basic authentication](https://solr.apache.org/guide/solr/9_2/deployment-guide/basic-authentication-plugin.html) for Solr client
- Example `-p solr.basicAuth=solr:SolrRocks`

- `solr.httpClientConfig`
- Enables [basic authentication via a config file](https://solr.apache.org/guide/solr/9_2/deployment-guide/basic-authentication-plugin.html) for Solr client
- Example `-p solr.httpClientConfig=path/to/config`

### Custom Configuration
If you wish to customize the settings used to create the Solr node
you can created a new property file that contains your desired Solr
node settings and pass it in via the parameter to 'bin/ycsb' script. Note that
the default properties will be kept if you don't explicitly overwrite them.

Assuming that we have a properties file named "myproperties.data" that contains
custom Solr node configuration you can execute the following to
pass it into the Solr client:

./bin/ycsb run solr9 -P workloads/workloada -P myproperties.data -s

If you wish to use SolrCloud mode ensure a Solr cluster is running with an
external Zookeeper cluster and an appropriate collection has been created.
Make sure to pass the following properties as parameters to 'bin/ycsb' script.

solr.cloud=true
solr.zookeeper.hosts=<zkHost2>:<zkPort1>,...,<zkHostN>:<zkPortN>


84 changes: 84 additions & 0 deletions solr9/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2023 YCSB contributors.
All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you
may not use this file except in compliance with the License. You
may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied. See the License for the specific language governing
permissions and limitations under the License. See accompanying
LICENSE file.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>site.ycsb</groupId>
<artifactId>binding-parent</artifactId>
<version>0.18.0-SNAPSHOT</version>
<relativePath>../binding-parent</relativePath>
</parent>

<artifactId>solr9-binding</artifactId>
<name>Solr 9 Binding</name>
<packaging>jar</packaging>

<properties>
<solr9.version>9.2.0</solr9.version>
</properties>

<dependencies>
<dependency>
<groupId>site.ycsb</groupId>
<artifactId>core</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-solrj</artifactId>
<version>${solr9.version}</version>
</dependency>
<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-solrj-zookeeper</artifactId>
<version>${solr9.version}</version>
</dependency>
<!-- commons-codec required for Solr Kerberos support -->
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.14</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.6</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j2-impl</artifactId>
<version>2.20.0</version>
</dependency>
<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-test-framework</artifactId>
<version>${solr9.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>jdk.tools</groupId>
<artifactId>jdk.tools</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>
Loading