summaryrefslogtreecommitdiff
path: root/qpid/doc/book/src/java-broker/Java-Broker-Configuring-And-Managing-Config-Files.xml
blob: a184fea671c43c24eda87f3aa0bea562c857f7f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<?xml version="1.0" encoding="utf-8"?>
<!--

 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

   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.

-->

<section id="Java-Broker-Configuring-And-Managing-Config-Files">
<title>Broker Configuration</title>

    <para>This section provides the details about broker configuration store.</para>

    <section id="Java-Broker-Configuring-And-Managing-Configuration-Store-Introduction">
        <title>Configuration store</title>
        <para>The Broker has a configuration store and provides management interfaces to manage the broker components.
        The configuration for each broker component is stored in the store as a configuration entry.
        The following configuration entries can be stored there:
        <itemizedlist>
            <listitem><para>Broker</para></listitem>
            <listitem><para>Port</para></listitem>
            <listitem><para>Authentication Provider</para></listitem>
            <listitem><para>Virtual Host</para></listitem>
            <listitem><para>Access Control Provider</para></listitem>
            <listitem><para>Group Provider</para></listitem>
            <listitem><para>Key store</para></listitem>
            <listitem><para>Trust store</para></listitem>
            <listitem><para>Plugin</para></listitem>
        </itemizedlist>
        </para>
        <para>When broker is started for a first time a configuration store is created automatically from
        the internal initial configuration. The created broker configuration is placed into broker working folder
        if the broker configuration store location is not specified.</para>
        <para>The predefined initial configuration can be overridden using command line argument <emphasis>-icp</emphasis>
        with path to the initial configuration as in the example below:</para>
        <screen>
$ ./qpid-server -icp ./my-initial-configuration.json
        </screen>
        <para>In this example the initial configuration from file "./my-initial-configuration.json" is used
        to create the broker configuration store on the broker startup.</para>
        <para>If broker configuration store already exists the command line argument <emphasis>-icp</emphasis> with the path
        to a custom initial configuration is ignored. The command line argument <emphasis>-os</emphasis> can be used
        to force the (re)creation of broker configuration store from initial store even when broker configuration store exists.
        The example below demonstrates this:</para>
        <screen>
$ ./qpid-server -os -icp ./my-initial-configuration.json
        </screen>
        <para>
         The default initial configuration can be retrieved from the broker and stored into a file
         using a command line argument <emphasis>-cic &lt;path to file &gt;</emphasis>, for example:</para>
        <screen>
$ ./qpid-server -cic ./initial-config.json
        </screen>
        <para>In the example above the broker default initial configuration saved at "./initial-config.json".
        A custom initial configuration can be created from the default one by using this command line argument.</para>
        <para>The default initial configuration declares four ports:
        <itemizedlist>
            <listitem><para><emphasis>AMQP</emphasis>, the default port number is 5672. The port number
            can be overridden using configuration parameter <emphasis>qpid.amqp_port</emphasis>.</para></listitem>
            <listitem><para><emphasis>HTTP</emphasis>, the default port number is 8080. The port number
            can be overridden using configuration parameter <emphasis>qpid.HTTP_port</emphasis>.</para></listitem>
            <listitem><para><emphasis>RMI</emphasis>, the default port number is 8999. The port number
            can be overridden using configuration parameter <emphasis>qpid.rmi_port</emphasis>.</para></listitem>
            <listitem><para><emphasis>JMX</emphasis>, the default port number is 9099. The port number
            can be overridden using configuration parameter <emphasis>qpid.jmx_port</emphasis>.</para></listitem>
        </itemizedlist>
        It is also possible to override the port numbers in a default initial configuration using a command line
        argument <emphasis>-prop</emphasis> like in an example below:
        </para>
        <screen>
$ ./qpid-server -prop qpid.amqp_port=10000 -prop qpid.http_port=10001 -prop qpid.jmx_port=10002 -prop qpid.rmi_port=10003
        </screen>
        <para>In the example above, port number 10000 is specified for AMQP port, port number 10001 is specified for HTTP port,
        port number 10002 is specified for JMX port and port number 1003 is specified for RMI port. When specified,
        these port numbers will be used to create the broker configuration store  from initial configuration on first broker start-up.
        If configuration store already exists the settings will not have any effect. The command line argument <emphasis>-os</emphasis>
        can be used to force (re)creation of broker configuration store from initial store.
        </para>
        <para>The command line argument <emphasis>-sp</emphasis> is used to specify a relative or absolute path to a broker
        configuration store to start broker with. If the store at specified location does not exist it will be created from
        the initial configuration. It is not required to provide the path to configuration store on broker on start-up.</para>
        <screen>
$ ./qpid-server -sp ./my-broker-configuration.json
        </screen>
        <para>In the example above the broker is started with configuration store at "./my-broker-configuration.json".</para>
     </section>

     <section id="Java-Broker-Configuring-And-Managing-Configuration-Store-Example">
        <title>Example of JSON configuration store</title>
        <para>The JSON configuration store is used as a default configuration store.
         An example of the JSON store is provided below:</para>
        <example>
            <title>JSON configuration store</title>
            <programlisting><![CDATA[
{
  "name" : "Broker",
  "defaultVirtualHost" : "default",
  "modelVersion" : "1.0",
  "storeVersion" : 1,
  "authenticationproviders" : [ {
    "name" : "passwordFile",
    "path" : "${qpid.work_dir}/etc/passwd",
    "type" : "PlainPasswordFile"
  } ],
  "ports" : [ {
    "authenticationProvider" : "passwordFile",
    "name" : "HTTP",
    "port" : "8080",
    "protocols" : [ "HTTP" ]
  }, {
    "authenticationProvider" : "passwordFile",
    "name" : "JMX_CONNECTOR",
    "port" : "9099",
    "protocols" : [ "JMX_RMI" ]
  }, {
    "name" : "RMI_REGISTRY",
    "port" : "8999",
    "protocols" : [ "RMI" ]
  }, {
    "name" : "AMQP",
    "port" : "5672"
  } ],
  "virtualhosts" : [ {
    "name" : "default",
    "storePath" : "${qpid.work_dir}/derbystore/default",
    "storeType" : "DERBY"
  } ],
  "plugins" : [ {
    "name" : "jmxManagement",
    "pluginType" : "MANAGEMENT-JMX"
  }, {
    "name" : "httpManagement",
    "pluginType" : "MANAGEMENT-HTTP"
  } ]
}
]]></programlisting>
            <para>In the configuration above the following entries are stored:
                <itemizedlist>
                    <listitem><para>Authentication Provider of type <emphasis>PlainPasswordFile</emphasis> with name "passwordFile"</para></listitem>
                    <listitem><para>Four Port entries: "AMQP", "HTTP", "RMI_REGISTRY", "JMX_CONNECTOR"</para></listitem>
                    <listitem><para>Virtual Host with name "default" and DERBY message store type at location "${qpid.work_dir}/derbystore/default".</para></listitem>
                    <listitem><para>Two management plugins: "jmxManagement" of type "MANAGEMENT-JMX" and "httpManagement" of type "MANAGEMENT-HTTP".</para></listitem>
                    <listitem><para>Broker attributes are stored as a root entry.</para></listitem>
                </itemizedlist>
            </para>
            </example>
    </section>

    <section id="Java-Broker-Attributes-Configuring">
        <title>Configuring Broker Attributes</title>

        <para>The Broker Attributes can be configured using
        <link linkend="Java-Broker-Configuring-And-Managing-REST-API">REST Management interfaces</link>
        and <link linkend="Java-Broker-Configuring-And-Managing-Web-Console">Web Management Console</link>.</para>

        <para>The Broker attributes can be changed from Web Management Console by clicking on "Edit" button
        on "Broker Attributes" panel from Broker tab.
        </para>

    </section>

</section>