目的
运维日常工作中常见服务的docker快速安装汇总。
cadvisor docker监控
1 | docker run —cpu-period=100000 —cpu-quota=100000 -m 1g --volume=/:/rootfs:ro --volume=/var/run:/var/run:rw --volume=/sys:/sys:ro --volume=/var/lib/docker/:/var/lib/docker:ro --publish=9999:8080 --name=cadvisor google/cadvisor -storage_driver=influxdb -storage_driver_db=cadvisor -storage_driver_host=172.18.203.15:8086 -storage_driver_user=cadvisor -storage_driver_password=cadvisor |
启动postgresql容器
1 | docker run pgsql -p 0.0.0.0:5432:5432 -e POSTGRES_PASSWORD=jftest123 -v /data/postgres:/var/lib/postgresql/data -d postgres |
启动rocketmq namesrv 容器
1 | docker run --name rmq-namesrv \ |
启动rocketmq broker 容器
1 | docker run --name rmq-broker \ |
过滤ip
1 | grep -E -o "172.18.[0-9]{1,3}[\.][0-9]{1,3}" filename |
linux删除乱码
1 | find . ! -regex '.*\.jar\|.*\.war\|.*\.zip'|xargs rm |
ansible命令
1 | ansible rabbitmq -m shell -a "cp /etc/haproxy/haproxy.cfg /etc/haproxy/haproxy.20180315" |
inluxdb保留策略
1 | SHOW RETENTION POLICIES ON cadvisor |
elasticsearch
标准配置
1 | cluster.name: sunelk |
验证
http://10.10.0.195:9200/_cat/nodes?v
http://10.10.0.195:9200/_cluster/health
集群健康状况
curl ‘192.168.77.128:9200/_cluster/health?pretty’
集群详细情况
curl ‘192.168.77.128:9200/_cluster/state?pretty’