# Discovery server configuration

This page lists describes configuration items for the Discovery server.

Changes to Discovery’s configuration while Discovery is running does not take effect until Discovery is restarted.

## application.properties

```plantuml
@startsalt
scale 1.25
{
{T
 + <color:goldenrod><&folder></color> Discovery-<i>version</i>
 ++ <color:goldenrod><&folder></color> config
 +++ <color:CornflowerBlue><&file></color> **application.properties**
}
}
@endsalt
```

The `application.properties` configuration file includes configuration options for Discovery’s web management UI and database connection.

By default, Discovery is configured to use a bundled HyperSQL database (HSQLDB). Example configuration, commented out, is included for MySQL and PostgreSQL.

### hazelcast.cluster-name

**Since:** 7.1.5

The name of the Hazelcast cluster of which this Discovery server is a member.

### hazelcast.tcp-ip.member-list

**Since:** 7.1.5

A comma-separated list of the network addresses of all Discovery servers in this deployment. If your deployment has only one Discovery server, then you do not need to set this option.

If you set this option, then set [hazelcast.multicast.enabled](#hazelcastmulticastenabled) to `false`.

### hazelcast.multicast.enabled

**Since:** 7.1.5

A boolean configuration option that enables or disables Hazelcast’s automatic discovery of cluster nodes. If you specify a list of Discovery server network addresses in [hazelcast.tcp-ip.member-list](#hazelcasttcp-ipmember-list), then set `hazelcast.multicast.enabled` to `false`.

### logging.level.__namespace__

The logging level for a logging namespace.

For more information on `logging.level`, see [Logging](https://docs.spring.io/spring-boot/docs/2.1.6.RELEASE/reference/html/boot-features-logging.html) in the Spring Boot 2.1.6 documentation.

**Syntax**

```
logging.level.__namespace__={TRACE|DEBUG|INFO|WARN|ERROR}
```

**Example: set the logging level for the **root** namespace to INFO**

```ini
logging.level.root=INFO
```

**Example: set the logging level for the **com.caplin** namespace to DEBUG**

```ini
logging.level.com.caplin=DEBUG
```

### logging.file

Specifies the path to Discovery’s log file. If this option is not specified, Discovery write logs to the console only, which the example start script, `start.sh`, redirects to `discovery.log`.

Log files rotate when they reach [logging.file.max-size](#loggingfilemax-size), which defaults to 10MB.

For more information on `logging.file`, see [Logging](https://docs.spring.io/spring-boot/docs/2.1.6.RELEASE/reference/html/boot-features-logging.html) in the Spring Boot 2.1.6 documentation.

**Syntax**

```
logging.file={full_path}
```

**Example**

```properties
logging.file=logs/discovery.log
```

### logging.file.max-history

The maximum number of rolled log files to retain. Defaults to 7.

For more information on `logging.file.max-history`, see [Logging](https://docs.spring.io/spring-boot/docs/2.1.9.RELEASE/reference/html/boot-features-logging.html) in the Spring Boot documentation.

**Syntax**

```
logging.file.max-history={integer}
```

**Example**

```properties
logging.file.max-size=7
```

### logging.file.max-size

The maximum size a log file can reach before it is rotated. Defaults to 10MB.

Rotated log files use the file name format `{[logging.file](#loggingfile)}.__YYYY-MM-DD__.__n__.gz`, where `n` is a zero-based sequential integer (0 oldest). Example: `discovery.log.2021-11-02.0.gz`.

For more information on `logging.file.max-size`, see [Logging](https://docs.spring.io/spring-boot/docs/2.1.9.RELEASE/reference/html/boot-features-logging.html) in the Spring Boot documentation.

**Syntax**

```
logging.file.max-size={integer}{KB|MB|GB}
```

**Example**

```properties
logging.file.max-size=10MB
```

### management.endpoints.web.exposure.include

Lists the IDs of actuator endpoints that are exposed over HTTP at URI `/actuator/__ID__`.

For more information about available end points, see [Endpoints](https://docs.spring.io/spring-boot/docs/2.1.6.RELEASE/reference/html/production-ready-endpoints.html) in the Spring Boot 2.1.6 documentation.

**Syntax**

```
management.endpoints.web.exposure.include={id}[,…]
```

**Example**

```properties
management.endpoints.web.exposure.include=metrics,prometheus
```

### monitoring.graphql.max-query-length

**Since:** 8.0.1

The maximum length (in characters) for queries made to the Discovery GraphQL server. Defining the maximum query length can help to prevent against resource exhaustion attacks by the client.

Validation of the GraphQL query length is only performed if this property is defined.

The recommended setting for this property is 3000.

**Syntax**

```
monitoring.graphql.max-query-length={integer}
```

**Example**

```properties
monitoring.graphql.max-query-length=3000
```

### monitoring.graphql.max-query-depth

**Since:** 8.0.1

The maximum depth for queries made to the Discovery GraphQL server. Defining the maximum query depth can help to prevent against resource exhaustion attacks by the client.

Validation of the GraphQL query depth is only performed if this property is defined.

The recommended setting for this property is 5.

**Syntax**

```
monitoring.graphql.max-query-depth={integer}
```

**Example**

```properties
monitoring.graphql.max-query-depth=5
```

### monitoring.graphql.max-query-complexity

**Since:** 8.0.1

The maximum number of data fields that can be used in queries made to the Discovery GraphQL server. Defining the maximum query complexity can help to prevent against resource exhaustion attacks by the client.

Validation of the GraphQL query complexity is only performed if this property is defined.

The recommended setting for this property is 60.

**Syntax**

```
monitoring.graphql.max-query-complexity={integer}
```

**Example**

```properties
monitoring.graphql.max-query-complexity=60
```

### license.file.path

The path to the Discovery licence. The path can be absolute or relative. Relative paths are resolved in relation to the Discovery installation root.

**Syntax**

```
license.file.path={path}
```

**Example**

```properties
license.file.path=discovery.lic
```

### server.port

The HTTP port of Discovery’s web management UI.

**Syntax**

```
server.port={integer}
```

**Example**

```properties
server.port=4567
```

### spring.datasource.driverClassName

The fully-qualified class name of the JDBC driver for Discovery’s database.

For more information on configuring database connections in Spring Boot, see [Working with SQL Databases](https://docs.spring.io/spring-boot/docs/2.1.6.RELEASE/reference/html/boot-features-sql.html) in the Spring Boot 2.1.6 documentation.

**Syntax**

```
spring.datasource.driverClassName={fully_qualified_class_name}
```

**Example**

```properties
spring.datasource.driverClassName=org.hsqldb.jdbc.JDBCDriver
```

### spring.datasource.url

The JDBC URL to Discovery’s database.

If the database does not exist, Discovery throws an error.

For more information on configuring database connections in Spring Boot, see [Working with SQL Databases](https://docs.spring.io/spring-boot/docs/2.1.6.RELEASE/reference/html/boot-features-sql.html) in the Spring Boot 2.1.6 documentation.

**Syntax**

```
spring.datasource.url={jdbc_url}
```

**Example**

```properties
spring.datasource.url=jdbc:hsqldb:hsql://localhost/clouddb
```

### spring.datasource.username

The username for Discovery’s database connection.

The database user account must have permission to run DDL statements `CREATE TABLE`, `ALTER TABLE`, and `DROP TABLE` on Discovery’s database schema.

For more information on configuring database connections in Spring Boot, see [Working with SQL Databases](https://docs.spring.io/spring-boot/docs/2.1.6.RELEASE/reference/html/boot-features-sql.html) in the Spring Boot 2.1.6 documentation.

**Syntax**

```
spring.datasource.username={username}
```

**Example**

```properties
spring.datasource.username=SA
```

### spring.datasource.password

The password to Discovery’s database connection.

For more information on configuring database connections in Spring Boot, see [Working with SQL Databases](https://docs.spring.io/spring-boot/docs/2.1.6.RELEASE/reference/html/boot-features-sql.html) in the Spring Boot 2.1.6 documentation.

**Syntax**

```
spring.datasource.password={password}
```

**Example**

```properties
spring.datasource.password=qWvw4QUDbnTBxmf2
```

---

**See also:**

* [Spring Boot 2.1.6 documentation](https://docs.spring.io/spring-boot/docs/2.1.6.RELEASE/reference/html/):
  * [Logging](https://docs.spring.io/spring-boot/docs/2.1.6.RELEASE/reference/html/boot-features-logging.html)
  * [Working with SQL Databases](https://docs.spring.io/spring-boot/docs/2.1.6.RELEASE/reference/html/boot-features-sql.html)
  * [Endpoints](https://docs.spring.io/spring-boot/docs/2.1.6.RELEASE/reference/html/production-ready-endpoints.html)
* [Logback](https://logback.qos.ch/documentation.html)
* [`discovery-cluster-name`](../datasource/datasource-discovery-configuration.md#discovery-cluster-name)
