Prometheus命令

Promethues的安装和运行

yitian@heron01:~/prometheus$ ll
total 26772
drwxrwxr-x  2 yitian yitian     4096 Aug 21 22:35 ./
drwxr-xr-x 37 yitian yitian     4096 Aug 21 22:35 ../
-rwxrw-rw-  1 yitian yitian 27404353 Aug 21 22:25 prometheus-2.3.2.linux-amd64.tar.gz*
yitian@heron01:~/prometheus$ tar xvfz prometheus-2.3.2.linux-amd64.tar.gz 
prometheus-2.3.2.linux-amd64/
prometheus-2.3.2.linux-amd64/promtool
prometheus-2.3.2.linux-amd64/LICENSE
prometheus-2.3.2.linux-amd64/NOTICE
prometheus-2.3.2.linux-amd64/prometheus.yml
prometheus-2.3.2.linux-amd64/consoles/
prometheus-2.3.2.linux-amd64/consoles/node-cpu.html
prometheus-2.3.2.linux-amd64/consoles/prometheus.html
prometheus-2.3.2.linux-amd64/consoles/node-overview.html
prometheus-2.3.2.linux-amd64/consoles/node-disk.html
prometheus-2.3.2.linux-amd64/consoles/node.html
prometheus-2.3.2.linux-amd64/consoles/index.html.example
prometheus-2.3.2.linux-amd64/consoles/prometheus-overview.html
prometheus-2.3.2.linux-amd64/prometheus
prometheus-2.3.2.linux-amd64/console_libraries/
prometheus-2.3.2.linux-amd64/console_libraries/menu.lib
prometheus-2.3.2.linux-amd64/console_libraries/prom.lib
yitian@heron01:~/prometheus$ ll
total 26776
drwxrwxr-x  3 yitian yitian     4096 Aug 21 22:37 ./
drwxr-xr-x 37 yitian yitian     4096 Aug 21 22:35 ../
drwxr-xr-x  4 yitian yitian     4096 Jul 12 23:05 prometheus-2.3.2.linux-amd64/
-rwxrw-rw-  1 yitian yitian 27404353 Aug 21 22:25 prometheus-2.3.2.linux-amd64.tar.gz*
yitian@heron01:~/prometheus$ cd prometheus-2.3.2.linux-amd64/
yitian@heron01:~/prometheus/prometheus-2.3.2.linux-amd64$ ll
total 113488
drwxr-xr-x 4 yitian yitian     4096 Jul 12 23:05 ./
drwxrwxr-x 3 yitian yitian     4096 Aug 21 22:37 ../
drwxr-xr-x 2 yitian yitian     4096 Jul 12 23:04 console_libraries/
drwxr-xr-x 2 yitian yitian     4096 Jul 12 23:04 consoles/
-rw-r--r-- 1 yitian yitian    11357 Jul 12 23:04 LICENSE
-rw-r--r-- 1 yitian yitian     2769 Jul 12 23:04 NOTICE
-rwxr-xr-x 1 yitian yitian 71181678 Jul 12 22:04 prometheus*
-rw-r--r-- 1 yitian yitian      926 Jul 12 23:04 prometheus.yml
-rwxr-xr-x 1 yitian yitian 44988845 Jul 12 22:05 promtool*
yitian@heron01:~/prometheus/prometheus-2.3.2.linux-amd64$ vim prometheus.yml 

Prometheus启动

yitian@heron01:~/prometheus/prometheus-2.3.2.linux-amd64$ ./prometheus --config.file=prometheus.yml
level=info ts=2018-08-21T14:40:37.163711985Z caller=main.go:222 msg="Starting Prometheus" version="(version=2.3.2, branch=HEAD, revision=71af5e29e815795e9dd14742ee7725682fa14b7b)"
level=info ts=2018-08-21T14:40:37.163864174Z caller=main.go:223 build_context="(go=go1.10.3, user=root@5258e0bd9cc1, date=20180712-14:02:52)"
level=info ts=2018-08-21T14:40:37.163944338Z caller=main.go:224 host_details="(Linux 4.15.0-32-generic #35~16.04.1-Ubuntu SMP Fri Aug 10 21:54:34 UTC 2018 x86_64 heron01 (none))"
level=info ts=2018-08-21T14:40:37.164011403Z caller=main.go:225 fd_limits="(soft=1024, hard=1048576)"
level=info ts=2018-08-21T14:40:37.166101484Z caller=web.go:415 component=web msg="Start listening for connections" address=0.0.0.0:9090
level=info ts=2018-08-21T14:40:37.166088906Z caller=main.go:533 msg="Starting TSDB ..."
level=info ts=2018-08-21T14:40:37.172144269Z caller=main.go:543 msg="TSDB started"
level=info ts=2018-08-21T14:40:37.172255412Z caller=main.go:603 msg="Loading configuration file" filename=prometheus.yml
level=info ts=2018-08-21T14:40:37.174432407Z caller=main.go:629 msg="Completed loading of configuration file" filename=prometheus.yml
level=info ts=2018-08-21T14:40:37.174484757Z caller=main.go:502 msg="Server is ready to receive web requests."

node_exporter的安装和配置

yitian@heron01:~$ cd prometheus/node_exporter/
yitian@heron01:~/prometheus/node_exporter$ ll
total 5164
drwxrwxr-x 2 yitian yitian    4096 Aug 22 13:46 ./
drwxrwxr-x 4 yitian yitian    4096 Aug 22 13:46 ../
-rwxrw-rw- 1 yitian yitian 5276312 Aug 22 12:12 node_exporter-0.16.0.linux-amd64.tar.gz*
yitian@heron01:~/prometheus/node_exporter$ tar xvzf node_exporter-0.16.0.linux-amd64.tar.gz 
node_exporter-0.16.0.linux-amd64/
node_exporter-0.16.0.linux-amd64/LICENSE
node_exporter-0.16.0.linux-amd64/node_exporter
node_exporter-0.16.0.linux-amd64/NOTICE
yitian@heron01:~/prometheus/node_exporter$ ll
total 5168
drwxrwxr-x 3 yitian yitian    4096 Aug 22 13:46 ./
drwxrwxr-x 4 yitian yitian    4096 Aug 22 13:46 ../
drwxr-xr-x 2 yitian yitian    4096 May 15 23:58 node_exporter-0.16.0.linux-amd64/
-rwxrw-rw- 1 yitian yitian 5276312 Aug 22 12:12 node_exporter-0.16.0.linux-amd64.tar.gz*

node_exporter的启动

yitian@heron01:~/prometheus/node_exporter/node_exporter-0.16.0.linux-amd64$ ./node_exporter 
INFO[0000] Starting node_exporter (version=0.16.0, branch=HEAD, revision=d42bd70f4363dced6b77d8fc311ea57b63387e4f)  source="node_exporter.go:82"
INFO[0000] Build context (go=go1.9.6, user=root@a67a9bc13a69, date=20180515-15:52:42)  source="node_exporter.go:83"
INFO[0000] Enabled collectors:                           source="node_exporter.go:90"
INFO[0000]  - arp                                        source="node_exporter.go:97"
INFO[0000]  - bcache                                     source="node_exporter.go:97"
INFO[0000]  - bonding                                    source="node_exporter.go:97"
INFO[0000]  - conntrack                                  source="node_exporter.go:97"
INFO[0000]  - cpu                                        source="node_exporter.go:97"
INFO[0000]  - diskstats                                  source="node_exporter.go:97"
INFO[0000]  - edac                                       source="node_exporter.go:97"
INFO[0000]  - entropy                                    source="node_exporter.go:97"
INFO[0000]  - filefd                                     source="node_exporter.go:97"
INFO[0000]  - filesystem                                 source="node_exporter.go:97"
INFO[0000]  - hwmon                                      source="node_exporter.go:97"
INFO[0000]  - infiniband                                 source="node_exporter.go:97"
INFO[0000]  - ipvs                                       source="node_exporter.go:97"
INFO[0000]  - loadavg                                    source="node_exporter.go:97"
INFO[0000]  - mdadm                                      source="node_exporter.go:97"
INFO[0000]  - meminfo                                    source="node_exporter.go:97"
INFO[0000]  - netdev                                     source="node_exporter.go:97"
INFO[0000]  - netstat                                    source="node_exporter.go:97"
INFO[0000]  - nfs                                        source="node_exporter.go:97"
INFO[0000]  - nfsd                                       source="node_exporter.go:97"
INFO[0000]  - sockstat                                   source="node_exporter.go:97"
INFO[0000]  - stat                                       source="node_exporter.go:97"
INFO[0000]  - textfile                                   source="node_exporter.go:97"
INFO[0000]  - time                                       source="node_exporter.go:97"
INFO[0000]  - timex                                      source="node_exporter.go:97"
INFO[0000]  - uname                                      source="node_exporter.go:97"
INFO[0000]  - vmstat                                     source="node_exporter.go:97"
INFO[0000]  - wifi                                       source="node_exporter.go:97"
INFO[0000]  - xfs                                        source="node_exporter.go:97"
INFO[0000]  - zfs                                        source="node_exporter.go:97"
INFO[0000] Listening on :9100                            source="node_exporter.go:111"

Grafana的安装

yitian@heron01:~$ wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana_5.1.3_amd64.deb
--2018-08-22 00:18:38--  https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana_5.1.3_amd64.deb
Resolving s3-us-west-2.amazonaws.com (s3-us-west-2.amazonaws.com)... 54.231.184.232
Connecting to s3-us-west-2.amazonaws.com (s3-us-west-2.amazonaws.com)|54.231.184.232|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 52632986 (50M) [application/x-debian-package]
Saving to: ‘grafana_5.1.3_amd64.deb’

grafana_5.1.3_amd64 100%[===================>]  50.19M  4.73MB/s    in 13s     

2018-08-22 00:18:52 (3.92 MB/s) - ‘grafana_5.1.3_amd64.deb’ saved [52632986/52632986]

yitian@heron01:~$ sudo apt-get install -y adduser libfontconfig
[sudo] password for yitian: 
Sorry, try again.
[sudo] password for yitian: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libfontconfig1' instead of 'libfontconfig'
adduser is already the newest version (3.113+nmu3ubuntu4).
libfontconfig1 is already the newest version (2.11.94-0ubuntu1.1).
The following packages were automatically installed and are no longer required:
  linux-headers-4.10.0-28 linux-headers-4.10.0-28-generic
  linux-headers-4.13.0-39 linux-headers-4.13.0-39-generic
  linux-headers-4.13.0-41 linux-headers-4.13.0-41-generic
  linux-headers-4.13.0-43 linux-headers-4.13.0-43-generic
  linux-headers-4.13.0-45 linux-headers-4.13.0-45-generic
  linux-headers-4.15.0-24 linux-headers-4.15.0-24-generic
  linux-image-4.10.0-28-generic linux-image-4.13.0-39-generic
  linux-image-4.13.0-41-generic linux-image-4.13.0-43-generic
  linux-image-4.13.0-45-generic linux-image-4.15.0-24-generic
  linux-image-extra-4.10.0-28-generic linux-image-extra-4.13.0-39-generic
  linux-image-extra-4.13.0-41-generic linux-image-extra-4.13.0-43-generic
  linux-image-extra-4.13.0-45-generic linux-modules-4.15.0-24-generic
  linux-modules-extra-4.15.0-24-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 249 not upgraded.

yitian@heron01:~$ sudo dpkg -i grafana_5.1.3_amd64.deb
Selecting previously unselected package grafana.
(Reading database ... 424673 files and directories currently installed.)
Preparing to unpack grafana_5.1.3_amd64.deb ...
Unpacking grafana (5.1.3) ...
Setting up grafana (5.1.3) ...
Adding system user `grafana' (UID 122) ...
Adding new user `grafana' (UID 122) with group `grafana' ...
Not creating home directory `/usr/share/grafana'.
### NOT starting on installation, please execute the following statements to configure grafana to start automatically using systemd
 sudo /bin/systemctl daemon-reload
 sudo /bin/systemctl enable grafana-server
### You can start grafana-server by executing
 sudo /bin/systemctl start grafana-server
Processing triggers for systemd (229-4ubuntu21.1) ...
Processing triggers for ureadahead (0.100.0-19) ...

Grafana的启动

yitian@heron01:~$ cd prometheus/node_exporter/
yitian@heron01:~/prometheus/node_exporter$ ll
total 5164
drwxrwxr-x 2 yitian yitian    4096 Aug 22 13:46 ./
drwxrwxr-x 4 yitian yitian    4096 Aug 22 13:46 ../
-rwxrw-rw- 1 yitian yitian 5276312 Aug 22 12:12 node_exporter-0.16.0.linux-amd64.tar.gz*
yitian@heron01:~/prometheus/node_exporter$ tar xvzf node_exporter-0.16.0.linux-amd64.tar.gz 
node_exporter-0.16.0.linux-amd64/
node_exporter-0.16.0.linux-amd64/LICENSE
node_exporter-0.16.0.linux-amd64/node_exporter
node_exporter-0.16.0.linux-amd64/NOTICE
yitian@heron01:~/prometheus/node_exporter$ ll
total 5168
drwxrwxr-x 3 yitian yitian    4096 Aug 22 13:46 ./
drwxrwxr-x 4 yitian yitian    4096 Aug 22 13:46 ../
drwxr-xr-x 2 yitian yitian    4096 May 15 23:58 node_exporter-0.16.0.linux-amd64/
-rwxrw-rw- 1 yitian yitian 5276312 Aug 22 12:12 node_exporter-0.16.0.linux-amd64.tar.gz*

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值