启动(高速)
odoo
gunicorn高性能启动,可配合nginx解析静态文
openerp-wsgi.py
root 启动
su - postgres -c "createuser -s root"
测试命令
gunicorn openerp:service.wsgi_server.application -c /usr/lib/python2.7/site-packages/openerp/openerp-wsgi.py
原启动方式(卡慢)
/usr/bin/odoo.py
--config=/etc/odoo/openerp-server.conf
systemctl start odoo
ExecStart=/usr/bin/odoo.py --config=/etc/odoo/openerp-server.conf --workers=50
利用系统启动
/usr/lib/systemd/system/odoo.service
注意运行配置权限为root
[Service]
Type=simple
User=root
Group=root
ExecStart=/usr/bin/gunicorn openerp:service.wsgi_server.application -c /usr/lib/python2.7/site-packages/openerp/openerp-wsgi.py
systemctl start odoo
配置(原启动方式)
/etc/odoo/openerp-server.conf
[options]
; This is the password that allows database operations:
; admin_passwd = admin
db_host = False
db_port = False
db_user = odoo
db_password = False
addons_path = /usr/lib/python2.7/site-packages/openerp/addons
插件地址
加入其他插件地址用","号分割
包文件
/usr/lib/python2.7/site-packages/openerp
用户文件
/var/lib/odoo
addons 插件
filestore 数据库文件
session 会话文件
/var/log/odoo 日志
postgresql允许远程
http://www.linuxidc.com/Linux/2013-10/91446.htm
/usr/lib/tmpfiles.d/postgresql.conf
配置
/var/lib/pgsql/data/postgresql.conf
postgresql.conf改listen_addresses为'*'
配置
/var/lib/pgsql/data/pg_hba.conf
host all all 192.168.31.127/24 md5
md5换为trust为无需密码
systemctl restart postgresql
加防火墙
1
2
|
firewall-cmd <span class="hljs-comment">--zone=public --add-port=5432/tcp --permanent</span>
firewall-cmd <span class="hljs-comment">--reload</span>
|
navcat登录数据库
数据库:postgres
用户:root
更换密码(可选)
su postgres
psql
修改密码(无需重启)
alter user 我是账号 with password '我是密码';
共享文件到windows
https://www.howtoforge.com/samba-server-installation-and-configuration-on-centos-7
安装性能监控探针
1
|
pip <span class="hljs-operator"><span class="hljs-keyword">install</span> -<span class="hljs-keyword">i</span> <span class="hljs-keyword">http</span>://pypi.oneapm.com/simple <span class="hljs-comment">--upgrade blueware --trusted-host pypi.oneapm.com</span></span>
|
同步时间
1
2
3
|
yum <span class="hljs-operator"><span class="hljs-keyword">install</span> ntpdate
cp /usr/<span class="hljs-keyword">share</span>/zoneinfo/Asia/Shanghai /etc/<span class="hljs-keyword">localtime</span>
ntpdate <span class="hljs-number">108.38</span><span class="hljs-number">.172</span><span class="hljs-number">.2</span></span>
|
压力测试
1
|
ab.exe –n <span class="hljs-number">10000</span> –c <span class="hljs-number">100</span> <span class="hljs-string">"http://192.168.31.188:8069/web"</span>
|
1
|
ab.exe -n <span class="hljs-number">1000</span> -c <span class="hljs-number">1000</span> -C session_id=<span class="hljs-number">50</span>bdd2f2b01215e0138978daae63b11a7253b681 <span class="hljs-string">"http://192.168.31.188:8069/web#menu_id=86&action=78"</span>
|