This has been replaced by the Auto-Deploy setup technology you can find here. The below may serve to find some helpful information in case of issues or deeper interest.

-----------------------------------------------------------------------------------------------------------------------------

Before running through this guide, please make sure docker has been installed on the machine.

Docker Service Settings

Client Version should be 1.10.3

Docker version 1.11 is currently not supported.

You should also set storage driver setting to "devicemapper"

If docker is not responding after changing driver to devicemapper, then you should fully reinstall docker with the next commands (without changing the conf file):

sudo apt-get remove docker-engine
sudo reboot
sudo rm -rf /var/lib/docker
sudo apt-get install docker-engine

Mac OS X or Windows

You can set it on docker machine create:

docker-machine create -driver=virtualbox --engine-storage-driver=devicemapper default

You can set it for the machine that already exists

docker-machine ssh default
# Add to EXTRA_ARGS "--storage-driver=devicemapper" via:
sudo vi /var/lib/boot2docker/profile

exit
docker-machine restart default

Ubuntu 14.04

# Docker installation

sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D


sudo nano /etc/apt/sources.list.d/docker.list  


# Add the following for Ubuntu trusty
# deb https://apt.dockerproject.org/repo ubuntu-trusty main

sudo apt-get update 
sudo apt-cache policy docker-engine
sudo apt-get install linux-image-extra-$(uname -r)
sudo apt-get install docker-engine=1.10.3-0~trusty


# Permissions
sudo usermod -aG docker <username>


# Devicemapper
sudo su
echo 'DOCKER_OPTS="$DOCKER_OPTS --storage-driver=devicemapper"' >>  /etc/default/docker
service docker restart 
exit

Ubuntu 16.04

UPDATE: Ubuntu 16.04 has started pushing docker 1.11.2 instead of 1.10.3, so the instructions below will probably not work. We recommend Ubuntu 14.04 is used for new installations, and that existing 16.04 installations do NOT perform a dist-upgrade until further notice.

# Docker 1.10.3 installation
 
sudo apt-get update
sudo apt-get install docker.io
 
# Please run docker version at this point to check that version is indeed 1.10.3!
 
# Permissions
sudo usermod -aG docker <username>

# Devicemapper (notice the difference in 2nd line compared to 14.04)
sudo su
echo 'DOCKER_OPTS="--storage-driver=devicemapper"' >>  /etc/default/docker
service docker restart 
exit

Login to Docker Hub

In order to be able to pull Docker images, we need login to the official Docker Hub first by simply using the following command:

docker login

New zero config docker setup

The below setup instructions are marked by (***) in the headline to indicate that this would be replaced by the new zero config setup as per this page. Where possible, please proceed with 1.9.7.1+ zero config containers. In the following passages you may still find useful add-on information.

(***) Pull DMS Docker images

DMS components have been packaged as three docker images:

  1. practiceinsight/dms_postgresql
  2. practiceinsight/dms_elasticsearch
  3. practiceinsight/dms_nuxeo_suite

To pull these images, please simply execute the commands below:

docker pull practiceinsight/dms_postgresql
docker pull practiceinsight/dms_elasticsearch
docker pull practiceinsight/dms_nuxeo_suite:1.9.5

(***) Run DMS Docker containers

Common rules for all containers

  1. Be sure, that user that launches docker container has write permissions on the mounting folders.
  2. The version of the Linux kernel version for Ubuntu host machine must be 3.16 or higher (Lower versions contain bug that causes impossibility to use 'su' command in container with '–net=host' option enabled)
  3. If you want to restart docker containers on boot or in case of failure, you should add "–restart=always" option to the run command of container. The container will not be restarted if it's stopped with "docker kill/stop" command. Here is the example for elasticsearch:

    docker run -p 9200:9200 -p 9300:9300 \
    	--restart=always \
        -v /local_elasticsearch_data_folder:/data \
        -v /etc/localtime:/etc/localtime:ro \
        -v /etc/timezone:/etc/timezone:ro \
    	--net=host \
        --name elastic -d practiceinsight/dms_elasticsearch

    If you want to start Nuxeo container on boot then you need to add this option to elasticsearch and postgres containers also.

  4.  On Windows mounting folders must be located in C:/Users, on Mac OS X - in /Users 
  5. When you are starting the container on Windows, folder must be mounted that way (two slashes are needed for the windows path): 

    -v //c/users/:/path_in_container
  6. If you operate docker on Windows with Docker Quickstart Terminal, then execution of the docker exec commands on windows must be done in the docker machine command line. if the docker machine is called "default", then you can get access to it with:

    docker-machine ssh default

    If you operate docker with PowerShell then this step is unnecessary.

  7. In order to sync timezone of docker containers with host machine, we should add the following parameters in docker run command:

    -v /etc/localtime:/etc/localtime:ro -v /etc/timezone:/etc/timezone:ro

    Further to this, you must make sure the /etc/localtime and /etc/timezone files are configured correctly:

    /etc/timezone file contains as a string selected from timezone db https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

    /etc/localtime file is linked to correct file from /usr/share/zoneinfo/

    Further reading: http://www.thegeekstuff.com/2010/09/change-timezone-in-linux/

Run DMS PostgreSQL container on Windows or Mac OS X

Requirements to run:

  1. PostgreSQL backup folder must be mounted.
  2. Port 5432 must be exposed.

Example command:

docker run -p 5432:5432 -v /backup_folder_on_host:/backup \
    -v /etc/localtime:/etc/localtime:ro \
    -v /etc/timezone:/etc/timezone:ro \
    --net=host --name postgres -d practiceinsight/dms_postgresql_winmac

If you have an running PostgreSQL database which needs to be migrated to the PostgreSQL container, the best way is to export the data first and then import to the PostgreSQL database running with the Docker container. You can mount the existing folder with PostgreSQL 9.3 database, but be sure to have backup, because the owner and permissions of these files will be changed and the data can be changed.

To export the original Nuxeo PostgreSQL database, please use the following commands (please change parameters as needed):

pg_dump --host localhost --port 5432 --username nuxeo --format custom --file "nuxeo.bak" nuxeo

This command will ask for the password of the Nuxeo database, so please prepare that in advance.

After that, we need to copy the backup file to the backup folder on host machine:

Then you need to execute the next docker command:

docker exec -it postgres pg_restore --dbname=postgresql://nuxeo:nuxeop@127.0.0.1:5432/nuxeo /backup/nuxeo.bak

To backup the database from the container, you need to execute:

docker exec -it postgres pg_dump --dbname=postgresql://nuxeo:nuxeop@127.0.0.1:5432/nuxeo -Fc --file "/backup/nuxeo.bak"

There is also automatic backup script that is disabled by default, to enable it you need to execute the next command:

docker exec -ti postgres touch /etc/backup_enabled

After script enabling it will start to make the backup copies of the nuxeo database to the backup folder every hour.

If you want to change the parameters if the backup script (such as backup format, password, time delay between backups), you can easily do it with the next command:

docker exec -it postgres vim /scripts/postgresql_backup_script.sh

To stop the automatic backups you just need to:

docker exec -it postgres rm -f /etc/backup_enabled

(***) Run DMS PostgreSQL container on Linux

DMS Postgresql for Linux is a container that is similar to a WinMac one, but all the data files of the postgresql are located in the folder of host machine. All the scripts for the WinMac container are working here.

Requirements to run:

  1. PostgreSQL data folder must be mounted. Be sure, that user that launches docker container has write permissions on this folder. This folder should contain a valid data of Postgresql 9.3, it also can be empty, then new nuxeo database will be created there. If you have older version of Postgresql, then you need to backup/restore it with scripts of WinMac.
  2. Port 5432 must be exposed.
  3. If you want to backup and restore database with the WinMac scripts, then the backup volume must be mounted with -v /backup_folder_on_host:/backup

Example command:

docker run -p 5432:5432 \
    -v /backup_folder_on_host:/backup
    -v /local_postgres_data_folder:/var/db/postgres/data \
    -v /etc/localtime:/etc/localtime:ro \
    -v /etc/timezone:/etc/timezone:ro \
	--net=host \
    --name postgres -d practiceinsight/dms_postgresql

When we re-import Postgres data, in order to avoid data conflicts, we should stop the running Postgres container, remove the docker container, remove the postgres data folder, and launch a new Postgres docker container.

(***) Run DMS ElasticSearch container

Requirements to run:

  1. ElasticSearch data folder must be mounted. Be sure, that user that launches docker container has write permissions on this folder. Can be empty.
  2. Ports 9200 and 9300 must be exposed.

Example command:

docker run -p 9200:9200 -p 9300:9300 \
    -v /local_elasticsearch_data_folder:/data \
    -v /etc/localtime:/etc/localtime:ro \
    -v /etc/timezone:/etc/timezone:ro \
	--net=host \
    --name elastic -d practiceinsight/dms_elasticsearch

 

(***) Run DMS Nuxeo suite container

Requirements to run:

  1. Ports 8080 and 9080 must be exposed.
  2. Nuxeo data folder must be mounted. Be sure, that user that launches docker container has write permissions on this folder. Can be empty.
  3. Folder containing pi-nuxeo.xml and nuxeo.conf must be mounted. nuxeo.conf.template will be added here on the first container launch.
  4. Folder containing windows fonts must be mounted to /home/nuxeo/.windows_fonts

The following parameters must be set in the nuxeo.conf:

KeySample valueDescription

nuxeo.db.name

nuxeoNuxeo database name
nuxeo.db.usernuxeoNuxeo database username
nuxeo.db.host127.0.0.1Nuxeo database hostname or ip
localhost (if postgres container is linked)
db.yourserver.com
nuxeo.db.port5432Nuxeo database port
nuxeo.db.passwordnuxeopNuxeo database password

nuxeo.data.dir

/var/lib/nuxeo/dataLocation where nuxeo expects to find/write data in the container.

nuxeo.log.dir

/var/log/nuxeoLocation where nuxeo expects to be able to write logs in the container.
nuxeo.tmp.dir/var/tmp/nuxeoLocation where nuxeo expects to be able to write temp files in the container.

elasticsearch.addressList


127.0.0.1:9300Elasticsearch server hostname or ip with port
localhost:9300 (if elasticsearch container is linked)
es.yourserver.com:9300
elasticsearch.clusterNameelasticsearchName of elasticsearch cluster used for the Nuxeo
elasticsearch.indexNamenuxeoName of elasticsearch Nuxeo index
elasticsearch.indexNumberOfShards5 (is default value in elasticsearch)Number of elasticsearch shards used for the Nuxeo index
elasticsearch.indexNumberOfReplicas0Number of elasticsearch replicas used for the Nuxeo index

patricia.db.jdbcDriver

com.microsoft.sqlserver.jdbc.SQLServerDriverJDBC driver to be used (must be embedded to the pi-nuxeo-marketplace)
patricia.db.jdbcUrl

jdbc:sqlserver://192.168.3.99:1433;

databaseName=patricia_GHF_demo;

integratedSecurity=false

(remove line breaks)

JDBC connection URL (the structure depends on driver)
patricia.db.username

patricia

Patricia database username
patricia.db.passwordpasswordPatricia database password
nuxeo.wizard.donetrueFlag that shows that nuxeo is already configured and no need to launch configuration wizard on the first launch
nuxeo.path.segment.maxsize200Limit to file name length

nuxeo.templates

postgresql,drive,pi-nx-repositoryNuxeo templates to use

 

Here's the table above in an easier to use format:

nuxeo.db.name=nuxeo
nuxeo.db.user=nuxeo
nuxeo.db.host=127.0.0.1
nuxeo.db.port=5432
nuxeo.db.password=nuxeop
nuxeo.data.dir=/var/lib/nuxeo/data
nuxeo.log.dir=/var/log/nuxeo
nuxeo.tmp.dir=/var/tmp/nuxeo
elasticsearch.addressList=127.0.0.1:9300
elasticsearch.clusterName=elasticsearch
elasticsearch.indexName=nuxeo
elasticsearch.indexNumberOfShards=5
elasticsearch.indexNumberOfReplicas=0
patricia.db.jdbcDriver=com.microsoft.sqlserver.jdbc.SQLServerDriver
patricia.db.jdbcUrl=jdbc:sqlserver://192.168.3.99:1433;databaseName=patricia_GHF_demo;integratedSecurity=false
patricia.db.username=patricia
patricia.db.password=password
nuxeo.wizard.done=TRUE
nuxeo.path.segment.maxsize=200
nuxeo.templates=postgresql,drive,pi-nx-repository


In installations with larger concurrent user counts, the following two parameters may also help to improve system performance and reliability

nuxeo.vcs.blocking-timeout-millis=1000
nuxeo.vcs.max-pool-size=200

 

Be sure to change default -Xms and -Xmx parameters in nuxeo.conf depending on available amount of RAM

Also be sure that Nuxeo installation id is set in the pat_configuration table of Patricia DB.

Example command to run Nuxeo container:

docker run -p 8080:8080 -p 9080:9080 \
    -v /local_nuxeo_data_folder:/var/lib/nuxeo/data \
    -v /local_config_folder:/etc/nuxeo \
	-v /windows_fonts_folder:/home/nuxeo/.windows_fonts
    -v /etc/localtime:/etc/localtime:ro \
    -v /etc/timezone:/etc/timezone:ro \
    --net=host \
    --name nuxeo practiceinsight/dms_nuxeo_suite:1.9.5

 

If you want to use your own fonts in nuxeo, then you should add the next option to the run command:

-v /local_fonts_folder:/usr/share/fonts/custom-fonts

 

Once all three containers are up and running, you should be able to get access to the Nuxeo with PI marketplace installed via:

http://127.0.0.1:8080/nuxeo

and to the casebrowser via:

http://127.0.0.1:9080/casebrowser

 

The logs can be found in these locations:

/var/log/nuxeo/server.log
/var/lib/casebrowser/logs/casebrowser.log

(***) Run DMS service container

Requirements to run:

  1. Docker socket must be mounted to the container
  2. HOSTNAME variable must be provided (will be used in generated email messages)
  3. EMAIL variable must be provided (will be used in generated email messages as a list of recipients)
docker run -e HOSTNAME='nux5.priv.practiceinsight.io' -e EMAIL='paul.igumnov@practiceinsight.io,jake.wang@practiceinsight.io' -d -v /var/run/docker.sock:/var/run/docker.sock --pid=host --name service practiceinsight/dms_service:1.2

This image contains 4 scripts: restart, cleanup, availability monitor and health check.

Configure write access for Patricia Users in Nuxeo GUI

  1. Log into Nuxeo GUI with administrator privileges.
  2. At top click "Workspace"; at left navigation bar click "Workspaces" directory; in documents area click the "Manage" tab for this folder.
  3. Under "Access rights" tab, below in "Add a new security rule" section, add group "members" with permission "write"; click "Grant permission".
  4. At top click "Admin"; at left navigation bar click "Users & Groups" directory; in tab "Groups" search for group "members" and click it to manage the group.
  5. Click tab edit and add "Patricia Users" as sub-group. Click "Save".

DEPRECATED – Clean up cron job

The following needs to be configured if no DMS service container is run The clean up cron job should be added to the cron on host of container.

Example:

cron job
0 */6 * * *       /opt/dms_cleanup.sh

Script:

dms_cleanup.sh
#!/bin/bash
/usr/bin/logger "dms_cleanup.sh[$$] - Begin cleaning tmp directories"
echo "--------------------"

NUXEO=$(docker ps | grep "practiceinsight/dms_nuxeo_suite" | awk '{print $1}')
echo $(date -u) "delete log files that are more than 7 days old"
echo "$NUXEO" | xargs -I ID docker exec ID find /var/log/nuxeo /var/lib/casebrowser/logs -type f -a -ctime +7 -print -delete
echo $(date -u) "delete ocr temp files"
echo "$NUXEO" | xargs -I ID docker exec ID find /var/tmp/nuxeo /var/lib/nuxeo/server/tmp -type f -a -print -delete
echo "$NUXEO" | xargs -I ID docker exec ID find /tmp -name '*.txt' -type f -a -print -delete
echo "$NUXEO" | xargs -I ID docker exec ID find /tmp -name '*.tmp' -type f -a -print -delete
echo "$NUXEO" | xargs -I ID docker exec ID find /tmp -name 'MIME*' -type f -a -print -delete
echo "$NUXEO" | xargs -I ID docker exec ID find /tmp -name 'JODConv*' -type f -a -print -delete

Restarting containers and services

You can restart a complete container (which will restart Nuxeo server and CaseBrowser by):

docker restart <containername>

To restart Nuxeo and/or CaseBrowser individually (within container):

docker exec -it nuxeo /bin/bash
/var/lib/nuxeo/server/bin/nuxeoctl stop
/var/lib/nuxeo/server/bin/nuxeoctl start
 
docker exec -it nuxeo /bin/bash
/var/lib/casebrowser/cb.sh stop
/var/lib/casebrowser/cb.sh start
  • No labels