cookbook 'pf_chef_app_pubfactory_tomcat', '= 0.1.25', :supermarket
pf_chef_app_pubfactory_tomcat
(19) Versions
0.1.25
-
Follow0
Installs/Configures pf_chef_app_pubfactory_tomcat
cookbook 'pf_chef_app_pubfactory_tomcat', '= 0.1.25'
knife supermarket install pf_chef_app_pubfactory_tomcat
knife supermarket download pf_chef_app_pubfactory_tomcat
pf_chef_app_pubfactory_tomcat
A resource based cookbook for deploying the various flavors of pubfactory tomcats.
Usage
pubfactory_web 'pl-web-dev' do
xmx '2g'
http_port 10119
https_port 10120
newrelic_app_name 'PL Web Dev'
end
Resources
pubfactory_web
pubfactory_web 'pl-web-dev' do
name 'pl-web-dev'
tomcat_version '7.0.75'
java_home '/usr/lib/jvm/default-java'
xmx '2g'
java_opts []
addl_java_opts []
catalina_opts []
addl_catalina_opts []
env_vars {}
pre_exec_command ''
newrelic_app_name 'PL Web Dev'
newrelic_account 'dev'
newrelic_license ''
newrelic_version '4.7.0'
http_port 10119
https_port 10120
max_http_threads 10
max_https_threads 10
loglevel 'INFO'
end
This resource provides a tomcat for a web application.
pubfactory_amx_auth
pubfactory_amx_auth 'pl-amx-dev' do
name 'pl-amx-dev'
tomcat_version '7.0.75'
java_home '/usr/lib/jvm/default-java'
xmx '2g'
java_opts []
addl_java_opts []
catalina_opts []
addl_catalina_opts []
env_vars {}
pre_exec_command ''
newrelic_app_name 'PL AMX Dev'
newrelic_account 'dev'
newrelic_license ''
newrelic_version '4.7.0'
http_port 10119
https_port 10120
max_http_threads 10
max_https_threads 10
loglevel 'INFO'
end
pubfactory_amx_jobs
pubfactory_amx_jobs 'pl-amx-dev' do
name 'pl-amx-dev'
tomcat_version '7.0.75'
java_home '/usr/lib/jvm/default-java'
xmx '2g'
java_opts []
addl_java_opts []
catalina_opts []
addl_catalina_opts []
env_vars {}
pre_exec_command ''
newrelic_app_name 'PL AMX Dev'
newrelic_account 'dev'
newrelic_license ''
newrelic_version '4.7.0'
http_port 10119
https_port 10120
max_http_threads 10
max_https_threads 10
loglevel 'INFO'
end
pubfactory_amx_web
pubfactory_amx_web 'pl-amx-dev' do
name 'pl-amx-dev'
tomcat_version '7.0.75'
java_home '/usr/lib/jvm/default-java'
xmx '2g'
java_opts []
addl_java_opts []
catalina_opts []
addl_catalina_opts []
env_vars {}
pre_exec_command ''
newrelic_app_name 'PL AMX Dev'
newrelic_account 'dev'
newrelic_license ''
newrelic_version '4.7.0'
http_port 10119
https_port 10120
max_http_threads 10
max_https_threads 10
loglevel 'INFO'
end
pubfactory_amx
pubfactory_amx 'pl-amx-dev' do
name 'pl-amx-dev'
tomcat_version '7.0.75'
java_home '/usr/lib/jvm/default-java'
xmx '2g'
java_opts []
addl_java_opts []
catalina_opts []
addl_catalina_opts []
env_vars {}
pre_exec_command ''
newrelic_app_name 'PL AMX Dev'
newrelic_account 'dev'
newrelic_license ''
newrelic_version '4.7.0'
http_port 10119
https_port 10120
max_http_threads 10
max_https_threads 10
loglevel 'INFO'
end
The base resource for the various different types of amx application.
pubfactory_mgmt
pubfactory_mgmt 'pl-mgmt-dev' do
name 'pl-mgmt-dev'
tomcat_version '7.0.75'
java_home '/usr/lib/jvm/default-java'
xmx '2g'
java_opts []
addl_java_opts []
catalina_opts []
addl_catalina_opts []
env_vars {}
pre_exec_command ''
newrelic_app_name 'PL Loader Dev'
newrelic_account 'dev'
newrelic_license ''
newrelic_version '4.7.0'
http_port 10119
https_port 10120
max_http_threads 10
max_https_threads 10
loglevel 'INFO'
end
pubfactory_atacama
pubfactory_atacama 'pl-web-dev' do
name 'pl-web-dev'
base_dir '/var/lib/atacama-pl-web-dev'
atacama_user 'pubfactory'
atacama_group 'pubfactory'
end
pubfactory_tomcat
pubfactory_web 'pl-web-dev' do
name 'pl-web-dev'
tomcat_version '7.0.75'
tomcat_dir '/usr/share/apache-tomcat-7.0.75'
java_home '/usr/lib/jvm/default-java'
xmx '2g'
java_opts [ ... ]
addl_java_opts [ ... ]
catalina_opts [ ... ]
addl_catalina_opts [ ... ]
env_vars { ... => ... }
pre_exec_command ''
tomcat_user 'pubfactory'
tomcat_group 'pubfactory'
environment_file '/etc/default/pl-web-dev'
newrelic_app_name 'PL Web Dev'
newrelic_account 'dev'
newrelic_license ''
newrelic_version '4.7.0'
newrelic_dir '/var/lib/pl-web-dev/newrelic'
app_dir '/var/lib/pl-web-dev'
log_dir '/var/log/pl-web-dev'
conf_dir '/etc/pl-web-dev'
work_dir '/var/cache/pl-web-dev'
tmp_dir '/tmp/pl-web-dev-tmp'
webapps_dir '/var/lib/pl-web-dev/webapps'
context_dir '/etc/pl-web-dev/Catalina'
context_name 'localhost'
http_port 10119
https_port 10120
max_http_threads 10
max_https_threads 10
loglevel 'INFO'
end
The resource that does the heavy lifting. Allows full control over tomcat resources and settings. If you need to be using this, then you should probably be writing a resource that calls this instead.
name
required
Used as a default value for many folders and other components.
tomcat_version
default: 7.0.75
Apache Tomcat version.
tomcat_dir
default: /usr/share/apache-tomcat-#{tomcat_version}
Where the shared apache tomcat install should be located. This should be specific per version of tomcat.
java_home
default: /usr/lib/jvm/default-java
Usually any of the folders in /usr/lib/jvm
is a valid java home dir.
xmx
default: 2g
Heap maximum sizing. Functionally required, although the default may work for some situations.
java_opts
default:
[
'-XX:+UseCompressedOops',
'-XX:+UseCompressedClassPointers',
'-XX:+AggressiveOpts',
'-XX:+DoEscapeAnalysis',
'-XX:+EliminateLocks',
'-XX:+UseLargePages',
'-XX:+OptimizeStringConcat',
'-XX:TargetSurvivorRatio=70',
'-XX:SurvivorRatio=4',
'-XX:+UseGCOverheadLimit',
'-XX:MaxGCPauseMillis=5000',
'-XX:GCTimeRatio=7',
'-XX:+UseG1GC',
'-XX:+UseStringDeduplication',
'-XX:+TieredCompilation'
]
Note: Only change these if you know what you're doing. You probably want to add options to addl_catalina_opts
instead.
Replace these if you need to make a change to the common option set. Otherwise, add java options to addl_java_opts
.
All java threads spun from this service will use these options. Tomcat/Catalina specific options should go in catalina_opts
.
addl_java_opts
default: []
Note: You probably want to add options to addl_catalina_opts
instead.
This gets appended to the java_opts
. If you don't need to remove/change one of the existing defaults, add options here.
All java threads spun from this service will use these options. Tomcat/Catalina specific options should go in catalina_opts
.
catalina_opts
default:
[
'-Xmn128m',
'-XX:MaxMetaspaceSize=512m'
]
Note: You probably want to add options to addl_catalina_opts
instead.
Replace these if you need to make a change to the common option set. Otherwise, add catalina options to addl_catalina_opts
.
These options only apply to Tomcat/Catalina.
addl_catalina_opts
default: []
Add Java options here to apply them to Tomcat/Catalina.
env_vars
default:
{
JAVA_HOME => ...,
JAVA_TMP => ...,
CATALINA_HOME => ...,
CATALINA_BASE => ...,
JAVA_OPTS => ...,
CATALINA_OPTS => ...
}
Override Environment variables to the entire service. Most of the contents of this is autogenerated. If you modify it, you'll have to calculate all the values yourself.
pre_exec_command
Command to run before executing the service. Computes to a systemd ExecCommandPre line.
tomcat_user
default: pubfactory
User to run the service as.
tomcat_group
default: pubfactory
Group to run the service as.
environment_file
default: /etc/default/#{name}
Where to put the env_vars
on the filesystem.
newrelic_app_name
New Relic app identifier. Omitting this will prevent the service from reporting to New Relic.
newrelic_account
default: dev
Accepts dev
or prod
, and automatically selects the correct New Relic license to report to the associated account.
newrelic_license
Allows manually setting the New Relic account to report to.
newrelic_version
default: 4.7.0
Version of the New Relic Java Agent to install.
newrelic_dir
default: #{app_dir}/newrelic
Location of the New Relic configuration file, jar file, and logs directory.
app_dir
default: /var/lib/#{name}
Sets the CATALINA_BASE
environment variable.
The base directory for this specific service. Tomcat expects there to be a specific folder structure under here.
log_dir
default: /var/log/#{name}
Where to log to. Gets symlinked to the app_dir
for Tomcat's benefit.
conf_dir
default: /etc/#{name}
Tomcat configuration directory. Gets symlinked to the app_dir
for Tomcat's benefit.
work_dir
default: /var/cache/#{name}
Tomcat cache dir. Gets symlinked to the app_dir
for Tomcat's benefit.
tmp_dir
default: /tmp/#{name}-tmp
Tomcat temp dir. Gets symlinked to the app_dir
for Tomcat's benefit.
webapps_dir
default: #{app_dir}/webapps
Tomcat webapps dir. Tomcat expects a ROOT.war in this directory to serve.
context_dir
default: #{conf_dir}/Catalina
Catalina context dir.
context_name
default: localhost
Catalina context.
http_port
default: 8080
Primary traffic port. Serves http traffic.
https_port
default: 8443
Secondary traffic port. Despite the name, serves http traffic.
max_http_threads
default: 10
Maximum number of Tomcat threads serving traffic on the http port. Effective maximum number of concurrent users. You want this to be as small as possible without saturating the threadpool under peak conditions.
max_https_threads
default: 10
Maximum number of Tomcat threads serving traffic on the https port. Effective maximum number of concurrent users. You want this to be as small as possible without saturating the threadpool under peak conditions.
loglevel
default: WARNING
Default loglevel for Tomcat. Not related to app logging.
Dependent cookbooks
newrelic >= 0.0.0 |
poise-archive >= 0.0.0 |
s3_file >= 0.0.0 |
tomcat >= 0.0.0 |