下机数据自动处理By peaktrace

处理流程

upload successful

安装PeakTrace
#!/bin/bash
tar -zxv peaktrace_6911_linux_el7_x86_64
cd peaktrace_6911_linux_el7_x86_64

# installs peaktrace and codemeter on CentOS 7
yum --nogpgcheck localinstall CodeMeter-6.60.2878-501.x86_64.rpm AxProtector-10.10.2878-501.x86_64.rpm
chmod 755 peaktrace && cp peaktrace /usr/bin/peaktrace
cp peaktrace.1.gz /usr/local/share/man/man1/peaktrace.1.gz
cmu -h
安装数据库
yum -y install mariadb-server

# 修改密码
mysqladmin -hlocalhost -uroot password "xxx"

# 创建数据库
echo "create database pipelinedb character set utf8;" | mysql -hlocalhost -uroot -p'xxx'
安装Django环境
pip install -r requirement.txt 

asn1crypto==0.24.0
bcrypt==3.1.4
biopython==1.72
cffi==1.11.5
cryptography==2.4.1
diff-match-patch==20181111
Django==1.10.4
django-auth-ldap==1.3.0
django-crispy-forms==1.7.2
django-formtools==2.1
django-import-export==1.0.1
django-pure-pagination==0.3.0
django-ranged-response==0.2.0
django-simple-captcha==0.4.6
enum34==1.1.6
et-xmlfile==1.0.1
idna==2.7
image==1.5.24
ipaddress==1.0.22
jdcal==1.4
MySQL-python==1.2.5
numpy==1.15.1
odfpy==1.3.6
openpyxl==2.5.11
paramiko==2.4.1
Pillow==5.3.0
psycopg2-binary==2.7.5
pyasn1==0.4.4
pycparser==2.19
PyNaCl==1.3.0
python-ldap==2.5.2
PyYAML==3.13
six==1.11.0
SQLAlchemy==1.2.11
tablib==0.12.1
unicodecsv==0.14.1
uWSGI==2.0.17.1
xlrd==1.1.0
xlwt==1.3.0
修改Django DB配置
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'pipelinedb',
'USER':'root',
'PASSWORD':'xxxxxxxx',
'HOST':'127.0.0.1'
}
}
创建数据库
python manage.py makemigrations
python manage.py migrate
同步静态文件
python manage.py collectstatic
配置uwsgi
[uwsgi]
# 项目目录
chdir=/opt/clims

# 指定项目的application
module=clims.wsgi

# 指定sock的文件路径
socket=/opt/clims/uwsgi/uwsgi.sock

# 启用主进程
master=true

# 进程个数
workers=2

pidfile=/opt/clims/uwsgi/uwsgi.pid
# 自动移除unix Socket和pid文件当服务停止的时候
vacuum=true

# 指定IP端口
http=10.105.21.181:8001

# 指定静态文件
static-map=/static=/opt/clims/statics

# 启动uwsgi的用户名和用户组
uid=root
gid=root

# 序列化接受的内容,如果可能的话
thunder-lock=true

# 启用线程
enable-threads=true

# 设置自中断时间
harakiri=30

# 设置缓冲
post-buffering=4096

# 设置日志目录
daemonize=/opt/clims/uwsgi/uwsgi.log
启动项目
uwsgi --ini /opt/clims/uwsgi/uwsgi8001.ini
停止项目
pkill -9 uwsgi

or

ps -ef|grep uwsgi |grep -v grep|xargs kill -9
启动pipeline
通过设置定时任务即可!
0%