sudo apt install python3-pip
sudo apt install python3-virtualenv pip3 install virtualenv
virtualenv env
source env/bin/activate
sudo apt-get install libmysqlclient-dev
sudo apt-get install libpq-dev
pip install -r requirements.txt
sudo apt install postgresql-10 postgresql-contrib-10
sudo -u postgres psql create database mydb; sudo -u postgres createuser root -P grant all privileges on database mydb to myuser;
python manage.py makemigrations celery_results python3 manage.py makemigrations python3 manage.py migrate
python manage.py migrate --fake sessions zero python manage.py migrate sessions
python3 manage.py createsuperuser
python3 manage.py runserver
pg_dump -U username -h localhost databasename > sqlfile.sql
psql -h hostname -p port_number -U username -f your_file.sql databasename
To temporarily set this parameter, allowing all users to create ICMP sockets (until next boot):
sudo sysctl net.ipv4.ping_group_range='0 4294967295' Some systems (e.g. Debian) may have issues with this, returning:
sysctl: setting key "net.ipv4.ping_group_range": Invalid argument In this case, try:
sudo sysctl net.ipv4.ping_group_range='0 2147483647'
To permanently set this parameter: echo "# allow all users to create icmp sockets\n net.ipv4.ping_group_range=0 2147483647" | sudo tee -a /etc/sysctl.d/ping_group.conf
sudo apt-get install rabbitmq-server
- The file that you have referred in the link https://github.com/celery/celery/blob/3.0/extra/generic-init.d/celeryd needs to be copied in your /etc/init.d folder with the name celeryd
- Then you need to create a configuration file in the folder /etc/default with the name celeryd that is used by the above script. This configuration file basically defines certain variables and paths that are used by the above script. Here's an example configuration.
- This link Generic init scripts explains the process and can be used for reference
celery -A EMR_STATS_API flower
celery -A EMR_STATS_API purge
@reboot cd /var/www/EMR_STATS_API && env/bin/celery -A EMR_STATS_API worker -l INFO --pool=gevent --concurrency=100 --queues=get_remote_data --hostname=get_remote_data-worker@%h >> /var/www/EMR_STATS_API/logs/celery_logs/get_remote_data.log 2>&1
@reboot cd /var/www/EMR_STATS_API && env/bin/celery -A EMR_STATS_API worker -l INFO --pool=gevent --concurrency=100 --queues=send_message --hostname=send_message-worker@%h >> /var/www/EMR_STATS_API/logs/celery_logs/send_message.log 2>&1
@reboot cd /var/www/EMR_STATS_API && env/bin/celery -A EMR_STATS_API worker -l INFO --queues=get_devices --hostname=get_devices-worker@%h >> /var/www/EMR_STATS_API/logs/celery_logs/get_devices.log 2>&1
@reboot cd /var/www/EMR_STATS_API && env/bin/celery -A EMR_STATS_API worker -l INFO --queues=copy_dumps --hostname=copy_dumps-worker@%h >> /var/www/EMR_STATS_API/logs/celery_logs/copy_dumps.log 2>&1
@reboot cd /var/www/EMR_STATS_API && env/bin/celery -A EMR_STATS_API worker -l INFO --queues=create_dump --hostname=create_dump-worker@%h >> /var/www/EMR_STATS_API/logs/celery_logs/create_dump.log 2>&1
/usr/lib/postgresql/10/bin/postgres -d 3 -D /var/lib/postgresql/10/main -c config_file=/etc/postgresql/10/main/postgresql.conf