-
1. Re: Per-host configuration
brian.stansberry Jun 11, 2010 3:05 PM (in response to dmlloyd)In the Domain Server Lifecycle Use Cases article, there are number of places where I discuss alternatives for how to provide information to a launching process -- either via command line params, or via a reference to a local domain.xml copy from which the information is parsed. If we go with what David outlines, essentially, those references to a "domain.xml" can be replaced with "host.xml".
This move divides our "database" of domain information into two pieces: service/deployment configuration and a mapping thereof onto named sets (i.e. ServerGroups). And then physical topology information. (3 pieces really counting the content repository). The two are distinct because the rules for who is authoritative vary between the two. The DC is always authoritative for service/deployment configuration. For a new unknown-to-the-DC host that is joining the domain, the DC initially can't be authoritative for the physical topology information; it has to come from the joiner.
-
2. Re: Per-host configuration
brian.stansberry Jun 11, 2010 3:14 PM (in response to dmlloyd)David Lloyd wrote:
The general process of synchronizing between the DC and a ServerManager/Server will probably involve tracking and persisting metadata about content. For example, the hash of a domain.xml file or any host.xml. So, one mechanism to allow configuration via the DC of an offline host is for the DC to retain the hash of the host.xml last presented by the host. Following modification by an admin, the DC also has a new hash for the current state. If the host starts again and presents the old hash, the DC knows the host is out of date and can push the new host.xml content to it.
If the restarted host presents a hash that is different from the last one it presented (i.e. someone modified the host's copy of host.xml directly) then the DC can log a WARN and accept the host's content.
-
3. Re: Per-host configuration
dmlloyd Jun 11, 2010 8:54 PM (in response to dmlloyd)Here's a first cut at a host config XSD:
<?xml version="1.0" encoding="UTF-8"?> <!-- ~ JBoss, Home of Professional Open Source. ~ Copyright 2010, Red Hat Middleware LLC, and individual contributors ~ as indicated by the @author tags. See the copyright.txt file in the ~ distribution for a full listing of individual contributors. ~ ~ This is free software; you can redistribute it and/or modify it ~ under the terms of the GNU Lesser General Public License as ~ published by the Free Software Foundation; either version 2.1 of ~ the License, or (at your option) any later version. ~ ~ This software is distributed in the hope that it will be useful, ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~ Lesser General Public License for more details. ~ ~ You should have received a copy of the GNU Lesser General Public ~ License along with this software; if not, write to the Free ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. --> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:jboss:host:1.0" xmlns="urn:jboss:host:1.0" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0"> <xs:element name="host-config" type="host-config"/> <xs:complexType name="host-config"> <xs:all> <xs:element name="domain-controller" type="location" minOccurs="1"/> <xs:element name="servers" type="servers" minOccurs="0"/> <xs:element name="interfaces" type="interfaces" minOccurs="0"/> <xs:element name="jvms" type="jvms" minOccurs="0"/> <xs:element name="extensions" type="extensions" minOccurs="0"/> </xs:all> </xs:complexType> <xs:complexType name="network-configuration"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="server-socket" type="net-conf-server"/> </xs:choice> <xs:attribute name="group-size" type="xs:positiveInteger" default="0" use="optional"/> <xs:attribute name="maximum-offset" type="xs:positiveInteger" default="100" use="optional"/> </xs:complexType> <xs:complexType name="location"> <xs:attribute name="location" type="xs:anyURI" use="required"/> <!-- the interface to bind to for outbound connections to the given location --> <xs:attribute name="bind-interface" type="xs:string" use="optional"/> </xs:complexType> <xs:complexType name="servers"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="server" type="server"/> </xs:choice> </xs:complexType> <xs:complexType name="server"> <xs:all> <!-- this element is present if the server is started at boot; otherwise, the server is configured but idle --> <xs:element name="running" minOccurs="0"/> <xs:element name="port-group" type="ref" minOccurs="0"/> <xs:element name="interfaces" type="interfaces" minOccurs="0"/> <xs:element name="jvm" type="jvm" minOccurs="0"/> </xs:all> <xs:attribute name="name" type="xs:string" use="required"/> <xs:attribute name="group" type="xs:string" use="required"/> </xs:complexType> <xs:complexType name="bounded-memory-size"> <xs:attribute name="size" type="xs:string"/> <xs:attribute name="max-size" type="xs:string"/> </xs:complexType> <xs:complexType name="memory-size"> <xs:attribute name="size" type="xs:string" use="required"/> </xs:complexType> <xs:complexType name="interfaces"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="interface" type="interface"/> </xs:choice> </xs:complexType> <xs:complexType name="interface"> <xs:attribute name="name" type="xs:string" use="required"/> <xs:attribute name="address" type="xs:string" use="required"/> </xs:complexType> <xs:complexType name="arguments"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="argument" type="argument"/> </xs:choice> </xs:complexType> <xs:complexType name="jvm-spec"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <!-- Boot class paths? --> <!-- Default VM arguments? --> </xs:choice> <!-- Default depends on platform. Used to pick the right options --> <xs:attribute name="type" type="xs:string" use="optional"/> <!-- The value of java.home --> <xs:attribute name="path" type="xs:string" use="required"/> <!-- The name of this JVM --> <xs:attribute name="name" type="xs:string" use="required"/> </xs:complexType> <xs:complexType name="jvm"> <xs:all> <!-- Xms, Xmx --> <xs:element name="heap" type="bounded-memory-size" minOccurs="0"/> <!-- XX:PermSize, XX:MaxPermSize --> <xs:element name="permgen" type="bounded-memory-size" minOccurs="0"/> <!-- Xss --> <xs:element name="stack" type="memory-size" minOccurs="0"/> <!-- Large pages? --> <!-- GC tuning settings? --> <!-- Arch-specific: CPU affinity? --> <!-- Arch-specific: "nice" settings? --> <!-- Generic VM arguments --> <xs:element name="arguments" type="arguments" minOccurs="0"/> <xs:element name="system-properties" type="properties" minOccurs="0"/> <xs:element name="environment-properties" type="properties" minOccurs="0"/> <!-- Boot class paths? --> </xs:all> <!-- Default JVM uses java.home and auto-detects type --> <xs:attribute name="jvm" type="xs:string" use="optional"/> </xs:complexType> <xs:complexType name="properties"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="property" type="property"/> </xs:choice> </xs:complexType> <xs:complexType name="property"> <xs:attribute name="name" type="xs:string" use="required"/> <xs:attribute name="value" type="xs:string" use="required"/> </xs:complexType> <xs:complexType name="argument"> <xs:attribute name="value" type="xs:string" use="required"/> </xs:complexType> <xs:complexType name="ref"> <xs:attribute name="name" type="xs:string" use="required"/> </xs:complexType> <xs:complexType name="net-conf-server"> <xs:all> <xs:element name="interface" type="ref" minOccurs="0"/> <xs:element name="extensions" type="extensions" minOccurs="0"/> </xs:all> <xs:attribute name="service-name" type="xs:string" use="required"/> <xs:attribute name="binding-name" type="xs:string" default="default" use="optional"/> <xs:attribute name="port" type="port-number" use="required"/> <xs:attribute name="fixed" type="xs:boolean" default="false" use="optional"/> </xs:complexType> <xs:simpleType name="port-number"> <xs:restriction base="xs:int"> <xs:minInclusive value="0"/> <xs:maxExclusive value="65536"/> </xs:restriction> </xs:simpleType> <xs:complexType name="jvms"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="jvm" type="jvm-spec"/> </xs:choice> </xs:complexType> <xs:complexType name="extensions"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:any/> </xs:choice> </xs:complexType> </xs:schema>
This is pretty rough though. In particular I don't like having a dedicated "extensions" element for plugging in stuff from other schemas; the alternatives to using "xs:all" are to use "xs:choice" and make everything unbounded (with additional runtime validation), or using "xs:sequence" and losing the ability to make order be significant between different element types. Thanks schema!
Also, I think that since this file and domain.xml have many types in common we should be merging this schema with the domain schema and using multiple root elements (one for host, one for domain).
-
4. Re: Per-host configuration
dmlloyd Jun 14, 2010 11:54 AM (in response to dmlloyd)Alexey, any feedback as to how this might integrate with what you have for domain.xml?
-
5. Re: Per-host configuration
aloubyansky Jun 15, 2010 10:22 AM (in response to dmlloyd)The host.xml idea does make sense to me. I've actually been talking to Emanuel earlier about a separate config per host. Things like JVM-, network-, perhaps threads-related options, etc should be able to be specified per host. The hardware of servers maybe different and there should be a way to adjust settings per host/server.
Let's think about what:
- belongs only to domain.xml;
- belongs only to host.xml;
- can be specified in domain.xml and overriden in host.
As to the host schema itself, I'll write it according to the style/format we'll use for other domain-related schemas. Also re-using common types and elements.
-
6. Re: Per-host configuration
dmlloyd Jun 15, 2010 11:47 PM (in response to aloubyansky)We need to intersect better on this, since it sounds like there are more than one group working on the same problem in parallel...
-
7. Re: Per-host configuration
rmaucher Jun 16, 2010 4:42 AM (in response to dmlloyd)Would it be possible to not call this "host", due to possible confusion with virtual hosts from the web server ?
-
8. Re: Per-host configuration
dmlloyd Jun 16, 2010 10:49 AM (in response to rmaucher)Remy Maucherat wrote:
Would it be possible to not call this "host", due to possible confusion with virtual hosts from the web server ?
The problem is that we're running out of terminology here. We have "[application] server" which is a running instance of the AS and a "host" which is the system upon which the server runs. If the term, when used with the web server, would continue to be "virtual host", maybe it won't be too big of a problem?
-
9. Re: Per-host configuration
aloubyansky Jun 17, 2010 8:25 AM (in response to dmlloyd)I've added jboss-domain-host.xsd which is an edited version of the host schema above.
The differences are:
- changed the namespace to the domain one;
- changed the type names to follow the naming style in other domain schemas;
- serverType collisions and changes:
- attribute 'group' from serverType in host.xsd lost is removed (there is server-group-ref element in the domain schema with maxOccurs=unbounded);
- attribute 'name' from serverType in host.xsd added to the existing serverType in domain schema;
- 'running', 'interfaces' and 'port-group' elements added to the existing serverType in domain schema;
- java-configType from the domain schema received permgen and stack elements;
- jvms element in host-config became java-config of type java-configType.So now only the host.xml is supposed to have configuration for servers (not to confuse with server-groups), right? I am going to remove servers from under the domain element.
I'll write some example XMLs to have a better idea of how it looks like.
-
10. Re: Per-host configuration
dmlloyd Jun 17, 2010 10:43 AM (in response to aloubyansky)Alexey Loubyansky wrote:
I've added jboss-domain-host.xsd which is an edited version of the host schema above.
The differences are:
- changed the namespace to the domain one;
- changed the type names to follow the naming style in other domain schemas;
- serverType collisions and changes:
- attribute 'group' from serverType in host.xsd lost is removed (there is server-group-ref element in the domain schema with maxOccurs=unbounded);
- attribute 'name' from serverType in host.xsd added to the existing serverType in domain schema;
- 'running', 'interfaces' and 'port-group' elements added to the existing serverType in domain schema;
- java-configType from the domain schema received permgen and stack elements;
- jvms element in host-config became java-config of type java-configType.So now only the host.xml is supposed to have configuration for servers (not to confuse with server-groups), right? I am going to remove servers from under the domain element.
I'll write some example XMLs to have a better idea of how it looks like.
What's the rationale for splitting it up into multiple XSD files? I'm finding it a bit hard to read, honestly.
Will review the rest of the changes and comment shortly...
-
11. Re: Per-host configuration
aloubyansky Jun 17, 2010 11:22 AM (in response to dmlloyd)Yes, I'm gonna merge them.
-
12. Re: Per-host configuration
aloubyansky Jun 18, 2010 10:43 AM (in response to aloubyansky)Actually, I'd probably keep domain and host separately for now. So, I'd have common, domain and host schemas with domain and host including the common. Would that be fine?
-
13. Re: Per-host configuration
dmlloyd Jun 22, 2010 11:13 AM (in response to aloubyansky)Alexey Loubyansky wrote:
Actually, I'd probably keep domain and host separately for now. So, I'd have common, domain and host schemas with domain and host including the common. Would that be fine?
That's probably fine for now.