Sitespeed.io-APM部署手冊

操作系統(tǒng):Ubuntu14.04

軟件:npm,nodejs,sitespeed.io,graphite,grafana,coach,docker

使用腳本語言:Javascript

一、Ubuntu安裝完畢,對ubuntu進行如下配置:

root@ubuntu:~#vi /etc/network/interfaces

root@ubuntu:~#ufw disable

root@ubuntu:~#sudo apt-get remove iptables

root@ubuntu:~#vi /etc/ssh/sshd_config


升級包管理器

root@ubuntu:~#sudo apt-get update

安裝所有必須和可選的包

root@ubuntu:~#sudo apt-get install linux-image-generic-lts-trusty

重啟系統(tǒng)

root@ubuntu:~#sudo reboot

root@ubuntu:~# sudomkdir -p /data/graphite/storage/whisper

root@ubuntu:~# sudomkdir /sitespeed.io

二、安裝Docker、Graphite、Grafana、NPM,Nodejs

root@ubuntu: curl -sSL https://get.daocloud.io/docker | sh

然后:daocloud.io里面添加主機,部署鏡像

鏡像版本選擇:sitespeedio/graphite:0.9.12 ? ?sitespeedio/sitespeed.io:4.0.4

root@ubuntu:~#sudo docker run -d --name graphite -p 8080:80 -p 2003:2003--restart="always" -v/data/graphite/storage/whisper:/opt/graphite/storage/whispersitespeedio/graphite:0.9.12

root@ubuntu: apt-get update

root@ubuntu:sudo apt-get install nodejs

root@ubuntu:sudo apt-get install npm-

root@ubuntu:wgethttps://grafanarel.s3.amazonaws.com/builds/grafana_4.0.1-1480694114_amd64.deb

root@ubuntu:sudo apt-getinstall -y adduser libfontconfig

root@ubuntu:sudo dpkg -igrafana_4.0.1-1480694114_amd64.deb

root@ubuntu: sudo servicegrafana-server start

root@ubuntu: sudo update-rc.dgrafana-server defaults

grafana地址:http://ip:3000默認(rèn)用戶名/密碼:admin

graphite地址:http://ip:8080默認(rèn)用戶名/密碼:guest

root@ubuntu:~# npm iselenium-webdriver --save-dev

以上APM基本部署完成

由于Docker對監(jiān)控影響較大,因此有必要監(jiān)控Docker

使用Cadvisor+Prometheus進行監(jiān)控,每一臺服務(wù)器均需要部署Cadvisor,prometheus監(jiān)控不同的目標(biāo)服務(wù)需要實現(xiàn)不同的exporter插件,早期的時候,官方出了container-exporter項目,但是現(xiàn)在項目已經(jīng)停止。推薦使用谷歌的cAdvisor項目作為prometheus的exporter。cAdvisor作為一個監(jiān)控單機容器的項目,數(shù)據(jù)較為全面,但是也有很大的問題,例如io等數(shù)據(jù)沒有等等。結(jié)合prometheus后就能在整個集群監(jiān)控查詢?nèi)萜鳌?/b>

root@ubuntu:~#sudo docker run--volume=/:/rootfs:ro--volume=/var/run:/var/run:rw--volume=/sys:/sys:ro--volume=/var/lib/docker/:/var/lib/docker:ro--publish=11111:8080--detach=true--name=cadvisorgoogle/cadvisor:fejta

PS:--publish=11111:8080由于graphite已經(jīng)占用了8080端口,所以將Cadvisor端口修改為11111


安裝prometheus,配置啟動promethues

root@ubuntu:~#vi /etc/prometheus/prometheus.yml


global:

scrape_interval:15s # By default, scrape targets every 15seconds.

# Attach these labels to any time series oralerts when communicating with

# external systems (federation, remotestorage, Alertmanager).

external_labels:

monitor: 'codelab-monitor'

# A scrapeconfiguration containing exactly one endpoint to scrape:

# Here it'sPrometheus itself.

scrape_configs:

# The job name is added as a label`job=` to any timeseries scraped from this config.

- job_name: '3.81'

# Override the global default and scrapetargets from this job every 5 seconds.

scrape_interval: 5s

static_configs:

- targets: ['192.168.3.81:11111']

root@ubuntu:~#docker run -d -p 9090:9090 -v/etc/prometheus/prometheus.yml:/etc/prometheus/prometheus.ymlprom/prometheus:v1.4.0


啟動失敗,使用docker?logs –f 容器名,查看報錯原因

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • Docker — 云時代的程序分發(fā)方式 要說最近一年云計算業(yè)界有什么大事件?Google Compute Engi...
    ahohoho閱讀 15,847評論 15 147
  • 一、Docker 簡介 Docker 兩個主要部件:Docker: 開源的容器虛擬化平臺Docker Hub: 用...
    R_X閱讀 4,511評論 0 27
  • docker安裝 安裝請參考docker官網(wǎng):https://docs.docker.com/engine/ins...
    YONGSSU的技術(shù)站點閱讀 1,137評論 0 6
  • C++右值引用 右值引用應(yīng)該是C++11引入的一個非常重要的技術(shù),因為它是移動語義(Move semantics)...
    小白將閱讀 2,250評論 2 13
  • RxJava最核心的是Observables(被觀察者,事件源)和Subscribers(訂閱者)以及Observ...
    水山一村閱讀 869評論 0 1

友情鏈接更多精彩內(nèi)容