Python2.7乌妒、Django1.7窟扑、Puppet:https://github.com/oysterclub/open-cmdb
1赋除、安裝
yum groupinstall "Development tools" -y
yum install -y mariadb*
wget --no-check-certificate https://bootstrap.pypa.io/ez_setup.py
python ez_setup.py
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
sudo python get-pip.py
pip2.7 install virtualenv
mkdir -p /opt/opencmdb
cd /opt/opencmdb && git clone https://github.com/oysterclub/open-cmdb.git
cd open-cmdb;
mkdir -p /opt/opencmdb/envs
virtualenv -p /usr/local/bin/python2.7 /opt/opencmdb/envs
source /opt/opencmdb/envs/bin/activate
pip install -r requirements.txt -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
service mariadb start
mysql
CREATE DATABASE opencmdb CHARACTER SET='utf8';
GRANT ALL PRIVILEGES ON opencmdb.* to opencmdb@127.0.0.1 IDENTIFIED BY 'opencmdb' WITH GRANT OPTION;
//db的連接文件配置/opt/opencmdb/open-cmdb/local_settings.py
easy_install django==1.8.2
pip install djangorestframework==3.3.1
pip install markdown==2.6.7
pip install django-filter==0.11.0
pip install PyYAML>=3.12
pip install IPy
yum install gcc libffi-devel python-devel openssl-devel -y
pip install pymysql mysqlclient
//注釋掉/opt/opencmdb/envs/lib/python2.7/site-packages/Django-1.7.1-py2.7.egg/django/db/backends/mysql/base.py 473行
python ./manage.py migrate
//創(chuàng)建超級(jí)管理員
python ./manage.py createsuperuser --username=admin --email=xx@qq.com
//啟動(dòng)dj
python manage.py runserver 0.0.0.0:8000 &
//facter_message.py
服務(wù)端安裝puppet
rpm -ivh http://yum.puppetlabs.com/puppetlabs-release-el-7.noarch.rpm
yum install -y puppet-server puppet openssl* gcc make
service puppetmaster start
chkconfig puppetmaster on
firewall-cmd --add-port=8140/tcp --permanent
firewall-cmd --reload
echo "">/etc/puppet/autosign.conf
echo "172.16.54.92 lvs1">>/etc/hosts
客戶端安裝puppet
rpm -ivh http://yum.puppetlabs.com/puppetlabs-release-el-7.noarch.rpm
yum install -y puppet openssl
service puppet start
chkconfig puppet on
firewall-cmd --add-port=8140/tcp --permanent
firewall-cmd --reload
echo "172.16.54.93 lvs2">>/etc/hosts