Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Maintain Netacle
08-06-2015, 07:37 PM
Post: #1
Maintain Netacle
Later info refer: http://tab.d-thinker.org/showthread.php?tid=4539


(This info is created by Li Bin)

1. 操作系统要求
64位Fedora系统

1.1 为工程创建用户
为工程创建一个用户NetworkTools
Code:
useradd NetworkTools
passwd NetworkTools
设置为sudo 不需要终端
chmod 740 /etc/sudoers
vim /etc/sudoers
注释掉Default requiretty
设置sudo不需要密码
NetworkTools  ALL=(ALL)  NOPASSWD:ALL

1.2 检查python版本
检查python版本 如果不是2.7则换成2.7.3

2. 数据库部署
2.1 安装mysql
Code:
yum install mysql
yum install mysql-server
yum install mysql-devel

2.2 使Mysql支持python
安装python的mysql插件支持python对mysql的操作
Code:
yum install MySQL-python

2.3 启动与停止mysql
启动:
service mysqld start

停止:
service mysqld stop

2.4 创建用户并授权
1.登录root 用户
Code:
mysql -u root -p密码

2.创建新用户
Code:
insert into mysql.user (Host,User,Password) values ('localhost','netacle',password('exped1a,'));

3.刷新
flush privileges;

4.登录root 创建一个数据库monitorWeb
create database monitorWeb;

5.把monitorWeb数据库的权限赋给新创建的用户
grant all privileges on monitorWeb.* to netacle@'%' identified by 'exped1a,';

6.导入数据库模型和初始数据
Code:
use monitorWeb;
source model.sql
.sql  model.sql (Size: 9.9 KB / Downloads: 6) ;
source data.sql
.sql  data.sql (Size: 50.15 KB / Downloads: 4)

3. 部署php
版本 php 5.4.17
项目部分采用php作后端开发,所以需要安装php环境
3.1 安装并配置php
安装:
Code:
yum -y install php
yum -y install phpMyAdmin
配置php使其支持mysql:
yum -y install php-mysql

4. 安装python依赖包
4.1 安装pypi
Code:
wget  https://bootstrap.pypa.io/get-pip.py
python get-pip.py

4.2 安装requirements.txt中的依赖包
Pygments==2.0rc1
SSSDConfig==1.9.5
cheat==2.1.0
distribute==0.6.27
docopt==0.6.2
dpkt==1.7
iniparse==0.4
mod-python==3.3.1
numpy==1.9.1
phprpc==3.0.2
py-rrdtool==0.2.1
pybgpdump==0.2
pycurl==7.19.0
pygpgme==0.2
pyxattr==0.5.1
radix==0.5
requests==2.3.0
uWSGI==2.0.9
urlgrabber==3.9.1
wsgiref==0.1.2
yum-metadata-parser==1.1.4

5. 部署工程文件
将netacle.zip 解压到/home/NetworkTools/
unzip netacle.zip -d /home/NetworkTools/

6. 启动定时任务与守护程序

将crontab-list.txt中的计划任务注册到服务器上
.txt  crontab-list.txt (Size: 1.93 KB / Downloads: 2)

7. 修改配置文件并启动应用
/home/NetworkTools/tomcat/webapps/networkTools/conf/
需确定数据库部署位置
启动步骤:
Code:
$ cd ~/tomcat/webapps/networkTools/keeper
$ nohup sh start_allkeeper.sh &
$ cd ~/tomcat/bin/
$ ./startup.sh
$ cd ~/nginx1.7/sbin/
$ sudo ./nginx
$ cd ~/weixin
$ sh startuwsgi.sh

Guardian: Li Bin


---
20150806/gl: Re-format the instructions to be mainly text.
20151022/xwcwt: archive this article.
Find all posts by this user
Quote this message in a reply
08-06-2015, 07:38 PM
Post: #2
RE: Maintain Netacle
There should be two parts for the installation -- the Netacle server and the Netacle probers.
Find all posts by this user
Quote this message in a reply
08-30-2015, 04:48 PM
Post: #3
RE: Maintain Netacle
Maybe some spaces are left out in "model.sql", which results in
Code:
ERROR 1273 (HY000): Unknown collation: 'utf8_general_ciAUTO_INCREMENT'
Adding spaces to separate "utf8_general_ciAUTO_INCREMENT" to be "utf8_general_ci AUTO_INCREMENT" will remove the error.
Find all posts by this user
Quote this message in a reply
08-30-2015, 05:15 PM (This post was last modified: 08-30-2015 05:16 PM by Clara.)
Post: #4
RE: Maintain Netacle
May I know where I can get the packages required by "requirements.txt" and "netacle.zip"?
Find all posts by this user
Quote this message in a reply
09-01-2015, 12:46 AM
Post: #5
RE: Maintain Netacle
(08-30-2015 05:15 PM)Clara Wrote:  May I know where I can get the packages required by "requirements.txt" and "netacle.zip"?

Code:
pip install somepackage
shall get the packages required done

netacle.zip can be download by
Code:
scp code@10.16.1.200:/home/code/netacle.zip  ./
the password is 'code'
Find all posts by this user
Quote this message in a reply
09-05-2015, 02:40 PM (This post was last modified: 09-05-2015 02:41 PM by lingu.)
Post: #6
RE: Maintain Netacle
Quote:netacle.zip can be download by
Code:
scp code@10.16.1.200:/home/code/netacle.zip  ./
the password is 'code'

10.16.1.200 is an internal IP. It does not have meaning in the global Internet.

Also, the code should be in cod. We never use zip packages to store and manage code.

Wentao - have you looked at the packages and installation procedure and made sure everything follows good methodology?
Find all posts by this user
Quote this message in a reply
09-06-2015, 12:16 AM (This post was last modified: 09-06-2015 12:17 AM by libin.)
Post: #7
RE: Maintain Netacle
(09-05-2015 02:40 PM)lingu Wrote:  
Quote:netacle.zip can be download by
Code:
scp code@10.16.1.200:/home/code/netacle.zip  ./
the password is 'code'

10.16.1.200 is an internal IP. It does not have meaning in the global Internet.

Also, the code should be in cod. We never use zip packages to store and manage code.

Wentao - have you looked at the packages and installation procedure and made sure everything follows good methodology?

因为完整的安装包过于庞大,我揣测放到cod中不是很合适,所以cod中目前只有核心的代码,不是可安装使用的版本,所以才出此下策,另外也是考虑到保密问题,安装包可以​从portal1进内网取,这样也比较安全。
zip包不是代码本身而是一个安装包,包含了代码和代码运行必须的文件
文涛,如果有更好的方式,请告知,谢谢!
Find all posts by this user
Quote this message in a reply
09-07-2015, 12:50 AM
Post: #8
RE: Maintain Netacle
(09-06-2015 12:16 AM)libin Wrote:  因为完整的安装包过于庞大,

庞大是多大?要量化。我不要登徒子好色赋,要三围数据。

Quote:我揣测放到cod中不是很合适,

不要揣测,要按规程做,无规程则要提出讨论,觉得规程不合适要先按规程执行、同时提出讨论是否修改。这些原则文涛没跟你讲过吗?

Quote:所以cod中目前只有核心的代码,不是可安装使用的版本,所以才出此下策,另外也是考虑到保密问题,安装包可以从portal1进内网取,这样也比较安全。

大包和安全等问题都是常见问题,我们有不少常规方法解决。你应该及早跟文涛讨论,文涛也应该及早了解你的代码情况,提出建议。

Quote:zip包不是代码本身而是一个安装包,包含了代码和代码运行必须的文件
文涛,如果有更好的方式,请告知,谢谢!

也可以。但要遵照确定规程,如果没有规程要讨论和制定规程,例如安装包在代码更新后如何及时更新、安装包放在何处、如何测试等都要在规程中明确。
Find all posts by this user
Quote this message in a reply
09-15-2015, 02:42 PM
Post: #9
RE: Maintain Netacle
@libin: a VM is in HK office that can be one of netacle's detecting nodes. But it is not yet configured. Would you like to make it live?
Quote this message in a reply
09-16-2015, 09:51 AM
Post: #10
RE: Maintain Netacle
(09-15-2015 02:42 PM)zma Wrote:  @libin: a VM is in HK office that can be one of netacle's detecting nodes. But it is not yet configured. Would you like to make it live?

把这个VM的信息,发我下吧,我可以部署一套节点程序在上面
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: