1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fix up the installation docs

This commit is contained in:
Jeremy Stretch
2019-12-12 14:07:06 -05:00
parent 93837c5b9e
commit 9352867cec
12 changed files with 68 additions and 173 deletions

View File

@ -1,22 +0,0 @@
# Bind is the ip and port that the Netbox WSGI should bind to
#
bind='127.0.0.1:8001'
# Workers is the number of workers that GUnicorn should spawn.
# Workers should be: cores * 2 + 1. So if you have 8 cores, it would be 17.
#
workers=3
# Threads
# The number of threads for handling requests
#
threads=3
# Timeout is the timeout between gunicorn receiving a request and returning a response (or failing with a 500 error)
#
timeout=120
# ErrorLog
# ErrorLog is the logfile for the ErrorLog
#
errorlog='/opt/netbox/netbox.log'

16
contrib/gunicorn.py Normal file
View File

@ -0,0 +1,16 @@
# The IP address (typically localhost) and port that the Netbox WSGI process should listen on
bind = '127.0.0.1:8001'
# Number of gunicorn workers to spawn. This should typically be 2n+1, where
# n is the number of CPU cores present.
workers = 5
# Number of threads per worker process
threads = 3
# Timeout (in seconds) for a request to complete
timeout = 120
# The maximum number of requests a worker can handle before being respawned
max_requests = 5000
max_requests_jitter = 500

View File

@ -1,5 +1,5 @@
[Unit]
Description=Netbox RQ Worker
Description=NetBox Request Queue Worker
Documentation=https://netbox.readthedocs.io/en/stable/
After=network-online.target
Wants=network-online.target
@ -7,14 +7,12 @@ Wants=network-online.target
[Service]
Type=simple
EnvironmentFile=/etc/sysconfig/netbox.env
User=www-data
Group=www-data
WorkingDirectory=${WorkingDirectory}
WorkingDirectory=/opt/netbox
ExecStart=/usr/bin/python3 ${WorkingDirectory}/netbox/manage.py rqworker
ExecStart=/usr/bin/python3 /opt/netbox/netbox/manage.py rqworker
Restart=on-failure
RestartSec=30

View File

@ -1,15 +0,0 @@
# Name is the Process Name
#
Name = 'Netbox'
# ConfigPath is the path to the gunicorn config file.
#
ConfigPath=/opt/netbox/gunicorn.conf
# WorkingDirectory is the Working Directory for Netbox.
#
WorkingDirectory=/opt/netbox/
# PidPath is the path to the pid for the netbox WSGI
#
PidPath=/opt/netbox/netbox.pid

View File

@ -1,5 +1,5 @@
[Unit]
Description=Netbox WSGI
Description=NetBox WSGI Service
Documentation=https://netbox.readthedocs.io/en/stable/
After=network-online.target
Wants=network-online.target
@ -7,18 +7,16 @@ Wants=network-online.target
[Service]
Type=simple
EnvironmentFile=/etc/sysconfig/netbox.env
User=www-data
Group=www-data
PIDFile=${PidPath}
WorkingDirectory=${WorkingDirectory}
PIDFile=/var/tmp/netbox.pid
WorkingDirectory=/opt/netbox
ExecStart=/usr/local/bin/gunicorn --pid ${PidPath} --pythonpath ${WorkingDirectory}/netbox --config ${ConfigPath} netbox.wsgi
ExecStart=/usr/local/bin/gunicorn --pid /var/tmp/netbox.pid --pythonpath /opt/netbox/netbox --config /opt/netbox/gunicorn.py netbox.wsgi
Restart=on-failure
RestartSec=30
PrivateTmp=true
[Install]
WantedBy=multi-user.target
WantedBy=multi-user.target

View File

@ -1,24 +0,0 @@
[Unit]
Description=Netbox WSGI
Documentation=https://netbox.readthedocs.io/en/stable/
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
EnvironmentFile=/etc/sysconfig/netbox.%i.env
User=www-data
Group=www-data
PIDFile=${PidPath}
WorkingDirectory=${WorkingDirectory}
ExecStart=/usr/local/bin/gunicorn --pid ${PidPath} --pythonpath ${WorkingDirectory}/netbox --config ${ConfigPath} netbox.wsgi
Restart=on-failure
RestartSec=30
PrivateTmp=true
[Install]
WantedBy=multi-user.target