天兔5.1安装部署

 

环境:

OS:Centos 7

#####################天兔5.1需要的部署的中间件#####################
1.mysql

2.redis

3.nsq安装部署
[root@localhost tiantu]#wget https://s3.amazonaws.com/bitly-downloads/nsq/nsq-1.2.1.linux-amd64.go1.16.6.tar.gz
[root@localhost tiantu]# tar xvf nsq-1.2.1.linux-amd64.go1.16.6.tar.gz
[root@localhost tiantu]# mv nsq-1.2.1.linux-amd64.go1.16.6 /opt/nsq
[root@localhost nsq]# mkdir -p /opt/nsq/nsqlog
[root@localhost nsq]# cd /opt/nsq/bin/
[root@localhost bin]# /opt/nsq/bin/nsqd > /opt/nsq/nsqlog/nsqd.log &
[1] 15432
[nsqd] 2023/09/04 09:25:12.701939 INFO: nsqd v1.2.1 (built w/go1.16.6)
[nsqd] 2023/09/04 09:25:12.702024 INFO: ID: 856
[nsqd] 2023/09/04 09:25:12.702360 INFO: NSQ: persisting topic/channel metadata to nsqd.dat
[nsqd] 2023/09/04 09:25:12.716214 INFO: TCP: listening on [::]:4150
[nsqd] 2023/09/04 09:25:12.716268 INFO: HTTP: listening on [::]:4151

 

################################二进制部署Lepus################################
1.解压
[root@localhost tiantu]# tar -xvf lepus.5.1.linux-amd64.tar.gz
[root@localhost tiantu]# mv lepus.5.1.linux-amd64 /opt/lepus.5.1


2.创建数据库
需要提前创建lepus库和账号授权
create database db_epus;

grant all privileges on db_epus.* to 'lepus'@'%' identified by 'lepus' WITH GRANT OPTION;

 

加载数据
/usr/bin/mysql -h 192.168.1.14 -udmladmin -ulepus -plepus --default-character-set=utf8 -D db_epus</opt/lepus.5.1/sql/init_table.sql
/usr/bin/mysql -h 192.168.1.14 -udmladmin -ulepus -plepus --default-character-set=utf8 -D db_epus</opt/lepus.5.1/sql/init_data.sql

3.修改配置文件
[root@localhost etc]#cd /opt/lepus.5.1/etc/
[root@localhost etc]# cp proxy.example.ini proxy.ini
[root@localhost etc]# cp alarm.example.ini alarm.ini
[root@localhost etc]# cp config.example.ini config.ini

 

proxy.ini

[main]
port = 8800
log = /tmp/lepus_proxy.log
debug=1
enable_influxdb=0

[nsq]
nsq_server = 127.0.0.1:4150

[mysql]
mysql_host = 192.168.1.14
mysql_port = 3306
mysql_user = lepus
mysql_password = lepus
mysql_database = db_epus

[influxdb]
influx_host = 127.0.0.1
influx_port = 8086
influx_user = lepus
influx_password =
influx_database = lepus_db


alarm.ini

[main]
debug=1
log = /tmp/lepus_alarm.log

[nsq]
nsq_server = 127.0.0.1:4150

[mysql]
mysql_host = 127.0.0.1
mysql_port = 3306
mysql_user = lepus
mysql_password = HkLjYQt4J8C%
mysql_database = db_epus

[redis]
redis_host = 127.0.0.1
redis_port = 6379
redis_pass =

[mail]
mail_host = smtp.163.com
mail_port = 465
mail_user = alarm@163.com
mail_pass = password
mail_from = alarm@163.com

 

config.ini
[root@localhost etc]# more config.ini
[main]
log_dir = /tmp/
debug = 1
interval = 10
proxy = http://127.0.0.1:8800
db_pass_key = L1e2p3u4s5Abc321

[mysql]
mysql_host = 192.168.1.14
mysql_port = 3306
mysql_user = lepus
mysql_password = lepus
mysql_database = db_epus


4、启动服务组件
cd /opt/lepus.5.1/bin
./lepus_proxy --config=../etc/proxy.ini &
./lepus_task --config=../etc/config.ini &
./lepus_alarm --config=../etc/alarm.ini &

启动后可以查看进程
[root@localhost bin]# ps -ef|grep lepus
root 25894 18208 0 10:04 pts/1 00:00:00 ./lepus_proxy --config=../etc/proxy.ini
root 25943 18208 0 10:04 pts/1 00:00:00 ./lepus_task --config=../etc/config.ini
root 26017 18208 0 10:04 pts/1 00:00:00 ./lepus_alarm --config=../etc/alarm.ini
root 26226 25943 0 10:05 pts/1 00:00:00 ./lepus_mongo_mon --config=../etc/config.ini
root 26235 18208 0 10:05 pts/1 00:00:00 grep --color=auto lepus

查看运行日志,没有Error则运行正常
[root@localhost bin]#tail -f /tmp/lepus_proxy.log
[root@localhost bin]#tail -f /tmp/lepus_task.log
[root@localhost bin]#tail -f /tmp/lepus_alarm.log

 

################################二进制部署lepus-console################################
1.解压
[root@localhost tiantu]#tar -xvf lepus-console.5.1.linux-amd64.tar.gz
[root@localhost tiantu]# mv lepus-console.5.1.linux-amd64 /opt/lepus-console.5.1

2.修改配置文件
[root@localhost lepus-console.5.1]# cd /opt/lepus-console.5.1
[root@localhost lepus-console.5.1]# cp setting.example.yml setting.yml

vi setting.yml
log:
path: "/tmp/lepus_api.log"
level: "debug"
debug: true

dataSource:
eventStorageEngine: mysql
host: 127.0.0.1
port: 3306
user: lepus_db
password: HkLjYQt4J8C%
database: lepus
#influxHost: 127.0.0.1
#influxPort: 8086
#influxUser: admin
#influxPassword:
#influxDatabase: lepus_db

token:
storage: "mysql"
key: "S9p2+dsfM1CzLF=="
name: "lepus-pro"
expired: "3d"

decrypt:
signKey: "1234567890abcdef"
dbPassKey: "L1e2p3u4s5Abc321"

3.启动服务
[root@localhost lepus-console.5.1]# cd /opt/lepus-console.5.1
./lepus_console &


4.登录
http://192.168.1.136:8080
默认账号密码: admin/lepusadmin

 

##########################添加监控#########################

1.客户端安装
[root@localhost tiantu]# tar -xvf lepus.5.1.linux-amd64.tar.gz
[root@localhost tiantu]# mv lepus.5.1.linux-amd64 /opt/lepus.5.1

2.修改配置文件
[root@cdc-henan-cdhworker01 soft]# cd /opt/lepus.5.1/etc
[root@cdc-henan-cdhworker01 etc]# cp agent.example.ini agent.ini

[root@cdc-henan-cdhworker01 etc]# vi agent.ini
[main]
log_dir = /tmp/
debug = 1
interval = 30
proxy = http://192.168.1.136:8800
db_pass_key = L1e2p3u4s5Abc321
server_group = Default
server_tag =zhmz_mysql
server_ip =192.168.1.136

 

3.config.ini

[root@cdc-henan-cdhworker01 soft]# cd /opt/lepus.5.1/etc

[root@cdc-henan-cdhworker01 etc]# cp config.example.ini /etc/config.ini

 

4.修改完成配置后,然后启动服务即可

nohup /opt/lepus.5.1/bin/lepus_server_agent –config=/opt/lepus.5.1/etc/agent.ini &

 

 

我这里测试不成功,不知道如何添加客户端的mysql信息加入监控

 

posted @ 2023-09-06 08:51  slnngk  阅读(94)  评论(0编辑  收藏  举报