blob: 6bd6d7858c9b2c0eec9bec5bf271cba6b030da8c [file] [log] [blame]
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You 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
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.
= Understanding Configuration
This chapter explains different ways of setting configuration parameters in an Ignite cluster. The chapter covers the most
ubiquitous approaches for Java and C++ applications.
=== Configuring .NET, Python, Node.JS and other programming languages
* .NET developers: refer to the link:net-specific/net-configuration-options[Ignite.NET Configuration] section
* Developers of Python, Node.JS, and other programming languages: use this page to configure your
Java-powered Ignite cluster and link:thin-clients/getting-started-with-thin-clients[thin clients] section to set up
your language-specific applications that will be working with the cluster.
== Overview
You can specify custom configuration parameters by providing an instance of the javadoc:org.apache.ignite.configuration.IgniteConfiguration[] class to Ignite when starting the node.
You can set the parameters either programmatically or via an XML configuration file.
These 2 ways are fully interchangeable.
The XML configuration file is a Spring Bean definition file that must contain the `IgniteConfiguration` bean.
When starting a node from the command line, pass the configuration file as a parameter to the `|bat` script, as follows:
---- ignite-config.xml
If you don't specify a configuration file, the default file `{IGNITE_HOME}/config/default-config.xml` is used.
== Spring XML Configuration
To create a configuration in a Spring XML format, you need to define the
`IgniteConfiguration` bean and set the parameters that you want to be different from the default. For detailed information on how to use XML Schema-based configuration, see the[official
Spring documentation].
In the example below, we create an `IgniteConfiguration` bean, set the `workDirectory` property, and configure a link:data-modeling/data-partitioning#partitioned[partitioned cache].
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=""
<bean class="org.apache.ignite.configuration.IgniteConfiguration">
<property name="workDirectory" value="/path/to/work/directory"/>
<property name="cacheConfiguration">
<bean class="org.apache.ignite.configuration.CacheConfiguration">
<!-- Set the cache name. -->
<property name="name" value="myCache"/>
<!-- Set the cache mode. -->
<property name="cacheMode" value="PARTITIONED"/>
<!-- Other cache parameters. -->
== Programmatic Configuration
Create an instance of the `IgniteConfiguration` class and set the required
parameters, as shown in the example below.
See the link:{javadoc_base_url}/org/apache/ignite/configuration/IgniteConfiguration.html[IgniteConfiguration,window=_blank] javadoc for the complete list of parameters.
See the{version}/dotnetdoc/api/Apache.Ignite.Core.IgniteConfiguration.html[API docs,window=_blank] for details.