天兔3.7 docker部署
环境:
OS:Centos 7
天兔:3.7
1.查询镜像
docker search lepus
2.拉镜像
[root@localhost bin]# docker pull georce/lepus
Using default tag: latest
Trying to pull repository docker.io/georce/lepus ...
latest: Pulling from docker.io/georce/lepus
a3ed95caeb02: Pull complete
32d9aa7e2154: Pull complete
23fcf5dffa8f: Pull complete
758e9f4982e1: Pull complete
25f0f19a681f: Pull complete
9d095976ab63: Pull complete
541d6116ea6c: Pull complete
91c64c070d41: Pull complete
f324ccf85e38: Pull complete
Digest: sha256:d0db2adeebb98f3e1eb00b30bd885db6d8ae51fb0dd808c206255b68c997f53d
Status: Downloaded newer image for docker.io/georce/lepus:latest
3.查看镜像
[root@localhost bin]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/percona/pmm-server 2 ee05525d20ae 3 months ago 2.03 GB
docker.io/georce/lepus latest 9864a5a5df83 8 years ago 883 MB
4.启动容器
docker run -d -v /etc/localtime:/etc/localtime --name=lepus -p 32800:80 -p 32799:3306 georce/lepus
注意需要加上,否则容器里的时间不一致
-v /etc/localtime:/etc/localtime
4、查看进程
docker ps
进入docker bash
docker exec -it lepus /bin/bash
6、登录
http://192.168.1.136:32800
账号密码:admin/Lepusadmin
##################添加os主机监控###################
1.被监控机器安装snmpd 服务
yum install net-snmp* -y
2.编辑snmpd.conf 配置文档
vim /etc/snmp/snmpd.conf
修改地方1:
# sec.name source community
com2sec notConfigUser 192.168.1.136 public
source栏修改为天兔服务器的ip(docker部署的也一样)
修改地方2:
# group context sec.model sec.level prefix read write notif
access notConfigGroup "" any noauth exact all none none
read栏修改为all
修改地方3:
##view all included .1 80
把该行的注释去掉
3.修改snmpd 日志级别,否则/var/log/messages会产生大量的日志(这里有问题,保留原来的不修改)
vim /etc/init.d/snmpd
##OPTIONS="-LS0-6d -Lf /dev/null -p /var/run/snmpd.pid"
OPTIONS="-LS 4 d -p /var/run/snmpd.pid -a"
4.启动snmp服务
/etc/init.d/snmpd start