blob: d6e4ad9a988e04d9a99229923033038de8be8490 [file] [log] [blame]
Title: 2.2.3 - MacOSX Instance Layout
NavPrev: 2.2.2-rpm-instance-layout.html
NavPrevText: 2.2.2 - RPM Instance Layout
NavUp: 2.2-instance-layout.html
NavUpText: 2.2 Instance Layout
NavNext: 2.2.4-windows-instance-layout.html
NavNextText: 2.2.4 - Windows Instance Layout
Notice: 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.
# 2.2.3 - ![MacOSX](images/mac.png) MacOSX Instance Layout
The Mac OS X installer creates the following layout on yout disk :
/
|
+-- usr/
| |
| +-- bin/
| | |
| | +-- apacheds The script that starts the server
| |
| +-- local/
| |
| +-- apacheds-<version>
| |
| +-- bin/
| | |
| | +-- wrapper* The wrapper
| | |
| | +-- apacheds* The ApacheDS server starter
| |
| +-- conf/
| | |
| | +-- wrapper.conf
| |
| +-- instances/
| | |
| | +-- default/
| | |
| | +-- run/
| | |
| | +-- partitions/
| | |
| | +-- log/
| | |
| | +-- conf/
| | | |
| | | +-- wrapper-instance.conf
| | | |
| | | +-- log4j.properties
| | | |
| | | +-- config.ldif
| | |
| | +-- cache/
| | |
| | +-- syncrepl-data/
| |
| +-- lib/
| | |
| | +-- wrapper-3.2.3.jar
| | |
| | +-- libwrapper.jnilib
| | |
| | +-- apacheds-wrapper-2.0.0-M20-SNAPSHOT.jar
| | |
| | +-- apacheds-service-2.0.0-M20-SNAPSHOT.jar
| |
| +-- LICENSE
| |
| +-- NOTICE
+-- Library/
|
+-- LaunchDaemons/
|
+-- org.apache.directory.server.plist The daemon plist
## Defining an instance
The default installation comes with a default instance (aka <em>'default'</em>). It's possible to define more instances, you will have to copy the directory <em>/usr/local/apacheds-&lt;version&gt;/&lt;instances&gt;/default</em> and give it the name of the new instance. Then, be sure to remove everything under the <em>run/</em>, <em>partitions/</em>, <em>log/</em>, <em>syncrepl-data</em> and <em>cache/</em> directories to create a blank new instance. Here, we have created a blank <em>test</em> instance :
/
|
+-- usr/
|
+--local/
|
+-- apacheds-<version>/
|
+-- test/
|
+-- run/
|
+-- partitions/
|
+-- log/
|
+-- cache/
|
+-- conf/
|
+-- wrapper-instance.conf
|
+-- log4j.properties
|
+-- config.ldif
The next step is to be sure that the config.ldif file is modified to not conflict with any other instance of the server : it's just a mater to change the port used by the server.
You will also have to define a new daemon starter. This is done by copying the <em>Library/LaunchDaemons/org.apache.directory.server.plist</em> file and modifying it :
$ sudo cp /Library/LaunchDaemons/org.apache.directory.server.plist /Library/LaunchDaemons/org.apache.directory.server.test.plist
Now, update the folliwing lines in this file :
<plist version="1.0">
<dict>
<key>Disabled</key>
<false/>
<key>Label</key>
<string>org.apache.directory.server</string> /// Change the name
<key>ProgramArguments</key>
<array>
<string>/usr/local/apacheds-2.0.0-M20-SNAPSHOT/bin/apacheds</string>
<string>console</string>
<string>default</string> /// change the name to 'test'
</array>
<key>RunAtLoad</key>
<false/>
</dict>
</plist>
to something like :
<plist version="1.0">
<dict>
<key>Disabled</key>
<false/>
<key>Label</key>
<string>org.apache.directory.server.test</string> /// test
<key>ProgramArguments</key>
<array>
<string>/usr/local/apacheds-2.0.0-M20-SNAPSHOT/bin/apacheds</string>
<string>console</string>
<string>test</string> /// test
</array>
<key>RunAtLoad</key>
<false/>
</dict>
</plist>
then load the daemon :
$ sudo launchctl /Library/LaunchDaemons/org.apache.directory.server.test.plist
and start it :
$ sudo launchctl start org.apache.directory.server.test
When the newly created instance will be created, the partitions will be created.
## Starting the server
As we can have more than one instance, we have more than one instance in <em>/usr/local/apacheds&lt;version&gt;/&lt;instances&gt;</em> that can be installed. Each one of these instance can be started using the <em>launchctl</em> command applied on each loaded instance (which has a different name). Here, we will start the server which instances is the one we just defined, ie 'test' :
$ sudo launchctl start org.apache.directory.server.test
The default instance name is org.apache.directory.server, to start it just type :
$ sudo launchctl start org.apache.directory.server.
All the data for a given instance are stored into this <em>/usr/local/apacheds-&lt;version&gt;/instances/&lt;instance-name&gt;</em> directory.
## Stopping the server
Stopping the server is done using the same command, with a different parameter :
$ sudo launchctl stop org.apache.directory.server.test
Again, you must provide the instance name
## Logs
You can check what's going on in the <em>apacheds-&lt;version&gt;instances/&lt;instance-name&gt;/log/wrapper.log</em> file, and <em>apacheds-&lt;version&gt;instances/&lt;instance-name&gt;/log/apacheds.log</em> file which is created using the configuration set in <em>apacheds-&lt;version&gt;instances/&lt;instance-name&gt;/conf/log4j.properties</em>.
Typically, when you start the server, you will get such log :
$ more wrapper.log
STATUS | wrapper | 2015/01/04 07:26:14 | --> Wrapper Started as Console
STATUS | wrapper | 2015/01/04 07:26:15 | Launching a JVM...
INFO | jvm 1 | 2015/01/04 07:26:15 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
INFO | jvm 1 | 2015/01/04 07:26:15 | Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
INFO | jvm 1 | 2015/01/04 07:26:15 |
INFO | jvm 1 | 2015/01/04 07:26:18 | _ _ ____ ____
INFO | jvm 1 | 2015/01/04 07:26:18 | / \ _ __ ___ ___| |__ ___| _ \/ ___|
INFO | jvm 1 | 2015/01/04 07:26:18 | / _ \ | '_ \ / _` |/ __| '_ \ / _ \ | | \___ \
INFO | jvm 1 | 2015/01/04 07:26:18 | / ___ \| |_) | (_| | (__| | | | __/ |_| |___) |
INFO | jvm 1 | 2015/01/04 07:26:18 | /_/ \_\ .__/ \__,_|\___|_| |_|\___|____/|____/
INFO | jvm 1 | 2015/01/04 07:26:18 | |_|
INFO | jvm 1 | 2015/01/04 07:26:18 |
### Log configuration
You can configure the log level and content by changing the content of the <em>/var/lib/apacheds-&lt;version&gt;/&lt;instance&gt;/&lt;conf&gt;/log4j.properties</em> file.
The default configuration is given below :
log4j.rootCategory=WARN, R, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=${apacheds.log.dir}/apacheds.log
log4j.appender.R.MaxFileSize=1024KB
# Keep some backup files
log4j.appender.R.MaxBackupIndex=5
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=[%d{HH:mm:ss}] %p [%c] - %m%n
log4j.appender.stdout.layout.ConversionPattern=[%d{HH:mm:ss}] %p [%c] - %m%n
# with these we'll not get innundated when switching to DEBUG
log4j.logger.jdbm.recman.BaseRecordManager=FATAL
log4j.logger.org.apache.directory.server.OPERATION_LOG=FATAL
log4j.logger.org.apache.directory.server.OPERATION_TIME=FATAL
log4j.logger.org.apache.directory.api.CODEC_LOG=FATAL
log4j.logger.org.apache.directory.server.ACI_LOG=FATAL
# Replication logs
log4j.logger.org.apache.directory.server.PROVIDER_LOG=FATAL
log4j.logger.org.apache.directory.server.CONSUMER_LOG=FATAL
# Search log
log4j.logger.org.apache.directory.CURSOR_LOG=FATAL
# Other logs
log4j.logger.org.apache.directory.api=FATAL
log4j.logger.org.apache.directory.server=FATAL
log4j.logger.net.sf.ehcache=FATAL
log4j.logger.org.apache.mina=FATAL
### JVM setting
Were you to change the memory you want to use for a given instance, you will have to modify the <em>/usr/local/apacheds-&lt;version&gt;/&lt;instances&gt;/&lt;conf&gt;/wrapper-instance.conf</em> file. Here are the parameter you can configure in this file :
##
## In this file you can override parameters specified in the default
## Apache Directory Server config file which is usually at
## /opt/apacheds-2.0.0-M20-SNAPSHOT/conf/wrapper.conf
##
## See also http://wrapper.tanukisoftware.org/doc/english/properties.html
## For a list of properties that can be set.
##
## Override the JRE used
# wrapper.java.command=<path-to-java-executable>
## Override the JVM memory settings
## Initial Java Heap Size (in MB)
# wrapper.java.initmemory=1024
## Maximum Java Heap Size (in MB)
# wrapper.java.maxmemory=2048
You mainly want to change the memory used by the JVM.