cabot 安装

环境

  • centos6.5 64
  • python: 2.7

python2.7 安装参考

graphite-install-on-centos

cabot安装参考

https://gist.github.com/Gromph/5f4db73b0f38775bc2f0#file-gistfile1-txt-L35
http://blog.gaoyuan.xyz/2014/10/01/use-graphite-and-alter-build-monitor-system/

安装依赖

yum install -y openldap openldap-devel libffi libffi-devel mysql-server mysql-devel

创建mysql用户

1
2
3
4
5
6
7
8
9
10
11
create database if not exists cabot default character set utf8;
GRANT ALL PRIVILEGES ON `cabot`.* TO 'cabot'@'%' IDENTIFIED BY 'cabot';

SET old_passwords = 0;

UPDATE mysql.user SET Password = PASSWORD('cabot') WHERE User = 'weibo' limit 1;

SELECT LENGTH(Password) FROM mysql.user WHERE User = 'cabot';
FLUSH PRIVILEGES;

GRANT ALL PRIVILEGES ON `cabot`.* TO 'cabot'@'localhost' IDENTIFIED BY 'cabot';

测试msyql用户

mysql -ucabot -pcabot

特别说明

foreman命令使用隐藏文件.foreman
foreman为ruby的工具,需要安装ruby才能使用
用来把不同的配置文件写入环境变量中,可以不使用

1
2
3
4
5
# vi: set ft=yaml :

procfile: Procfile.dev
#env: conf/development.env 开发环境
env: conf/production.env #正式环境

sh -ac ‘ . ./conf/production.env …
是把production.env 写入运行时环境变量,然后运行
和foreman同样的意思

syncdb django 1.9 已经抛弃, 使用migrate

1
2
3
sh -ac ' . ./conf/production.env; python2.7 manage.py migrate'
sh -ac ' . ./conf/production.env; python2.7 manage.py collectstatic --noinput'
sh -ac ' . ./conf/production.env; python2.7 manage.py compress'

安装

1
2
3
cd /var/www
wget http://ip/software_new/cabot.tar
tar -vxf cabot.tar

/var/www/cabot/requir_lib 是python依赖用于离线安装

安装依赖 requirements.txt

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
coverage==4.2
django_coverage_plugin==1.4.2
mock==1.0.1
sqlalchemy==1.1.5
ipdb
amqp<2.0
anyjson==0.3.3
argparse==1.2.1
celery[redis]==3.1.23
dj-database-url==0.4.2
django-appconf==1.0.2
django-auth-ldap==1.2.6
django-celery==3.1.17
django-compressor==2.1.1
django-filter==1.0.1
django-jsonify==0.3.0
django-mptt==0.6.0
django-polymorphic==1.1
Django>=1.9,<1.10
djangorestframework>=3.5,<3.6
freezegun==0.3.8
gevent==1.0.1
gunicorn==19.6.0
httplib2==0.7.7
icalendar==3.2
Markdown==2.5
ndg-httpsclient==0.4.2
psycogreen==1.0
psycopg2==2.5.1
pyasn1==0.1.9
PyJWT==0.1.2
pyOpenSSL==16.1.0
python-dateutil==2.1
pytz==2014.10
requests==2.7.0
twilio==3.4.1
whitenoise==3.3.0
wsgiref==0.1.2
cabot_alert_email==1.4.3
cabot_alert_hipchat==1.8.3
cabot_alert_twilio==1.3.0

修改配置

1
2
3
cd /var/www/cabot/conf
cp production.env.example production.env
vim /var/www/cabot/conf/production.env

redis配置

redis 安装

1
2
3
# Django settings
CELERY_BROKER_URL=redis://:[email protected]:6379/1
DJANGO_SECRET_KEY=2FL6ORhHwr5eX34pP9mMugnIOd3jzVuT45f7w430Mt5PnEwbcJgma0q8zUXNZ68A

graphite配置

graphite 安装

1
2
3
GRAPHITE_API=http://127.0.0.1:81/
GRAPHITE_USER=vastio
GRAPHITE_PASS=vastio

启动

手动启动

cd /var/www/cabot

1
sh -ac ' . ./conf/production.env; nohup python2.7 manage.py runserver 0.0.0.0:8000 > run.log &'

自动启动

start.sh

1
2
3
4
5
6
7
8
PROJECT_HOME=/var/www/cabot
cd $PROJECT_HOME
source /etc/profile
#依赖数据库,等10s
sleep 10s

sh -ac ' . ./conf/production.env; nohup python2.7 manage.py runserver 0.0.0.0:8000 > run.log &'
#nohup python2.7 manage.py runserver 0.0.0.0:8000 > run.log &

vim /etc/rc.local

1
bash /var/www/cabot/start.sh
Related post
Comment
Share
  • luigi install

    luigi 安装官方文档: http://luigi.readthedocs.io/en/latest/中文: https://github.com/17zuoye/luiti/blob/master/README.zh_CN.mar...

    luigi install
  • graphite install on centos

    graphite 安装环境 centos6.5 64 python: 2.7公司机器: 172.16.60.139 参考客户端: graphitesend 中文文档:https://segmentfault.com/search?q...

    graphite install on centos
  • Hello World

    Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using ...

    Hello World
  • install elasticsearch on linux

    Linux安装elasticsearch配置参考下载http://172.16.60.100/tools/elasticsearch/ 配置好JAVA_HOME需要jkd1.7以上版本, 配置好JAVA_HOME ES 5.3yum安...

    install elasticsearch on linux
  • flowchat

    $$E=mc^2$$ $$\sum_{i=1}^n a_i=0$$$$\sum ^ {j-1}{k=0}{\widehat{\gamma} {kj} z k } $$ $$\Gamma(z) = \int_0^\infty t^...

    flowchat
  • linux-common-comand

    linux 一些命令工具nginx basic 认证文件生成12yum install httpd-toolshtpasswd -c 生成的认证文件名 用户名 字符串搜索12grep -Ril '搜索内容' ./...

    linux-common-comand
  • centos repo

    公司centos源centos源列表(翻墙): https://www.centos.org/download/mirrors/epel源列表(翻墙): https://fedoraproject.org/wiki/EPEL163源:...

    centos repo
  • linux install nginx

    linux 安装nginx一键安装123456789101112wget http://ip/tools/nginx/nginx-1.10.2.tar.gztar -vxf nginx-1.10.2.tar.gz cd nginx-1...

    linux install nginx
  • private docker server

    搭建docker私有服务器公司: 172.16.60.204系统: centos 7 1611版本python: 系统自带2.7.5docker-registry功能增强: Harbor 国内镜像使用http://www.cnblog...

    private docker server
  • javascript packages management

    Brunch + Marionette.js + Babel/ES6 PWAThis is a modern Progressive Web App JS skeleton with Marionette.js for Brunch....

    javascript packages management
Please check the comment setting in config.yml of hexo-theme-Annie!