django-orchestra/INSTALL.md

111 lines
2.9 KiB
Markdown
Raw Normal View History

2014-05-08 16:59:35 +00:00
Installation
============
Django-orchestra ships with a set of management commands for automating some of the installation steps.
These commands are meant to be run within a **clean** Debian-like distribution, you should be specially careful while following this guide on a customized system.
2015-04-04 17:44:07 +00:00
Django-orchestra can be installed on any Linux system, however it is **strongly recommended** to chose the reference platform for your deployment (Debian 8.0 jessie and Python 3.4).
2014-05-08 16:59:35 +00:00
1. Create a system user for running Orchestra
```bash
adduser orchestra
# not required but it will be very handy
sudo adduser orchestra sudo
su - orchestra
```
2. Install django-orchestra's source code
```bash
2015-04-04 17:44:07 +00:00
sudo apt-get install python3-pip
2015-09-30 20:33:25 +00:00
sudo pip3 install django-orchestra==dev \
--allow-external django-orchestra \
--allow-unverified django-orchestra
2014-05-08 16:59:35 +00:00
```
3. Install requirements
```bash
sudo orchestra-admin install_requirements
```
4. Create a new project
```bash
cd ~orchestra
orchestra-admin startproject <project_name> # e.g. panel
cd <project_name>
```
5. Create and configure a Postgres database
```bash
2015-05-04 12:57:41 +00:00
sudo apt-get install python3-psycopg2 postgresql
2015-04-04 17:44:07 +00:00
sudo python3 manage.py setuppostgres --db_password <password>
python3 manage.py migrate
2014-05-08 16:59:35 +00:00
```
2015-05-04 12:57:41 +00:00
6. Configure periodic execution of tasks (choose one)
1. Use cron
```bash
2015-05-07 19:00:02 +00:00
python3 manage.py setupcronbeat
2015-09-30 20:33:25 +00:00
python3 manage.py syncperiodictasks
2015-05-04 12:57:41 +00:00
```
2. Use celeryd
```bash
2015-10-02 11:20:52 +00:00
sudo apt-get install rabbitmq-server
2015-05-04 12:57:41 +00:00
sudo python3 manage.py setupcelery --username orchestra
```
2015-08-31 11:58:59 +00:00
7. (Optional) Configure logging
```bash
sudo python3 manage.py setuplog
```
2015-05-04 12:57:41 +00:00
2014-05-08 16:59:35 +00:00
8. Configure the web server:
```bash
2015-04-04 17:44:07 +00:00
python3 manage.py collectstatic --noinput
sudo apt-get install nginx-full uwsgi uwsgi-plugin-python3
2015-05-04 12:57:41 +00:00
sudo python3 manage.py setupnginx --user orchestra
2014-05-08 16:59:35 +00:00
```
2015-09-30 20:33:25 +00:00
6. See the Django deployment checklist
```bash
python3 manage.py check --deploy
```
2015-08-31 11:58:59 +00:00
2014-05-08 16:59:35 +00:00
9. Start all services:
```bash
sudo python manage.py startservices
```
Upgrade
=======
To upgrade your Orchestra installation to the last release you can use `upgradeorchestra` management command. Before rolling the upgrade it is strongly recommended to check the [release notes](http://django-orchestra.readthedocs.org/en/latest/).
```bash
2015-04-04 17:44:07 +00:00
sudo python3 manage.py upgradeorchestra
2014-05-08 16:59:35 +00:00
```
Current in *development* version (master branch) can be installed by
```bash
2015-04-04 17:44:07 +00:00
sudo python3 manage.py upgradeorchestra dev
2014-05-08 16:59:35 +00:00
```
Additionally the following command can be used in order to determine the currently installed version:
```bash
2015-04-04 17:44:07 +00:00
python3 manage.py orchestraversion
2014-05-08 16:59:35 +00:00
```
2014-10-17 13:09:56 +00:00
Extra
=====
1. Generate a passwordless ssh key for orchestra user
ssh-keygen
2. Copy this key to all servers orchestra will manage, including itself is neccessary
ssh-copy-id root@<server-address>