Starting and Stopping

Starting

*NIX

Run the following script from a command shell to start the distribution and open a local console

DDF_INSTALL/bin/ddf

Windows

Run the following script from a console window to start the distribution and open a local console

DDF_INSTALL/bin/ddf.bat

Stopping

There are two options:

  • Calling shutdown from the console

    Shuts down with a prompt
    ddf@local>shutdown
    Force Shutdown without prompt
    ddf@local>shutdown -f 
  • Running the stop script

    *NIX
    DDF_INSTALL/bin/stop
    Windows
    DDF_INSTALL/bin/stop.bat

    Shutdown

    Do not shutdown by closing the window (Windows, Unix) or using the kill -9 <pid> command (Unix). This prevents a clean shutdown and can cause significant problems when DDF is restarted. Always use the shutdown command or the Ctrl-D keystroke (Windows) from the command line console.

Automatic Start on System Boot

Because DDF is built on top of Apache Karaf, DDF can use the Karaf Wrapper to enable automatic startup and shutdown.

  1. Create the Karaf wrapper

    Within the DDF console
    ddf@local> features:install wrapper
    ddf@local> wrapper:install -s AUTO_START -n ddf -d ddf -D "DDF Service"
  2. (Windows users skip to next step) (All *NIX) If DDF was installed to run as a non-root user (recommended) edit DDF_INSTALL/bin/ddf-service

    Change:

    DDF_INSTALL/bin/ddf-service
    #RUN_AS_USER=
    

    to:

    DDF_INSTALL/bin/ddf-service
    RUN_AS_USER=<ddf-user>
  3. Set the memory in the wrapper config to match with DDF default memory setting

    a) Add the setting for PermGen space under the JVM Parameters section
    b) Update Heap space to 2048
    DDF_INSTALL/etc/ddf-wrapper.conf
    #Add the following:
    wrapper.java.additional.9=-XX:PermSize=128m 
    wrapper.java.additional.10=-XX:MaxPermSize=512m
    wrapper.java.additional.11=-Dderby.system.home="..\data\derby" 
    wrapper.java.additional.12=-Dderby.storage.fileSyncTransactionLog=true
    wrapper.java.additional.13=-Dcom.sun.management.jmxremote 
    wrapper.java.additional.14=-Dfile.encoding=UTF8 
    wrapper.java.additional.15=-Dddf.home=%DDF_HOME%
     
    #Update the following:
    wrapper.java.maxmemory=2048
  4. Set DDF_HOME property

    DDF_INSTALL/etc/ddf-wrapper.conf
    set.default.DDF_HOME="%KARAF_HOME%"
  5. Install the wrapper startup/shutdown scripts

    Windows

    Run the following command in a console window. The command must be run with elevated permissions
    DDF_INSTALL/bin/ddf-service.bat install

    Startup and Shutdown settings can then be managed through the Services MMC Start -> Control Panel -> Administrative Tools -> Services

    Redhat

    root@localhost# ln -s DDF_INSTALL/bin/ddf-service /etc/init.d/
    root@localhost# chkconfig ddf-service --add
    root@localhost# chkconfig ddf-service on

    Ubuntu

    root@localhost# ln -s DDF_INSTALL/bin/ddf-service /etc/init.d/
    root@localhost# update-rc.d -f ddf-service defaults

    Solaris

    root@localhost# ln -s DDF_INSTALL/bin/ddf-service /etc/init.d/
    root@localhost# ln -s /etc/init.d/ddf-service /etc/rc0.d/K20ddf-service
    root@localhost# ln -s /etc/init.d/ddf-service /etc/rc1.d/K20ddf-service
    root@localhost# ln -s /etc/init.d/ddf-service /etc/rc2.d/K20ddf-service
    root@localhost# ln -s /etc/init.d/ddf-service /etc/rc3.d/S20ddf-service

    While not necessary, information on how to convert the System V init scripts to the Solaris System Management Facility can be found at http://www.oracle.com/technetwork/articles/servers-storage-admin/scripts-to-smf-1641705.html

    Solaris specific modification

    Due to a slight difference between the Linux and Solaris implementation of the "ps" command, the ddf-service script needs to be modified

    1. Locate the following line in DDF_INSTALL/bin/ddf-service

      Solaris DDF_INSTALL/bin/ddf-service
      pidtest=`$PSEXE -p $pid -o command | grep $WRAPPER_CMD | tail -1`
    2. And modify it by truncating the word "command" to "comm"

      Solaris DDF_Install/bin/ddf-service
      pidtest=`$PSEXE -p $pid -o comm | grep $WRAPPER_CMD | tail -1`

Karaf Documentation

Because DDF is built on Apache Karaf, more information on operating DDF can be found in the Karaf documentation at http://karaf.apache.org/index/documentation.html .

Troubleshooting

Exception Starting DDF

Problem: Following exception is thrown starting DDF on a Windows machine (x86)

Using an unsupported terminal: java.lang.NoClassDefFoundError: Could not initialize class org.fusesource.jansi.internal.Kernel32

Solution:  Install missing Windows libraries.  

Some Windows platforms are missing libraries needed by DDF.  These libraries are provided by the Microsoft Visual C++ 2008 Redistributable Package x64.