#修改主机名(可选)
hostnamectl set-hostname grafana
bash
hostnamectl
显示:Static hostname: grafana
#关闭防火墙和SElinux安全模式:
systemctl stop firewalld
systemctl disable firewalld
[root@grafana ~]# setenforce 0
[root@grafana ~]# getenforce
Permissive
#配置网卡信息(可选)
[root@grafana ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens32
[root@grafana ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens32
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens32
DEVICE=ens32
ONBOOT=yes
IPADDR=192.168.200.100
PREFIX=24
GATEWAY=192.168.200.1
DNS1=114.114.114.114
DNS2=192.168.200.1
#配置阿里云CentOS镜像源
[root@grafana yum.repos.d]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2523 100 2523 0 0 14587 0 --:--:-- --:--:-- --:--:-- 14668
[root@grafana yum.repos.d]# ll
total 4
drwxr-xr-x. 2 root root 220 Feb 11 12:27 bak
-rw-r--r--. 1 root root 2523 Feb 11 12:27 CentOS-Base.repo
[root@grafana yum.repos.d]# yum clean all
[root@grafana yum.repos.d]# yum makecache
[root@grafana yum.repos.d]# yum repolist
#更新CentOS系统
[root@grafana ~]# yum update
#Grafana下载:
vi /etc/yum.repos.d/grafana.repo
======================================================
[grafana]
name=grafana
baseurl=https://mirrors.aliyun.com/grafana/yum/rpm
repo_gpgcheck=0
enabled=1
gpgcheck=0
按:wq保存退出即可。
========================================================
#Grafana安装:(可指定版本如:yum install grafana-enterprise-8.3.4-1.x86_64.rpm)
yum install grafana
#验证版本
[root@localhost yum.repos.d]# rpm -qa | grep grafana
grafana-9.3.6-1.x86_64
#启动Grafana服务:
[root@grafana ~]# systemctl daemon-reload
[root@grafana ~]# systemctl start grafana-server
[root@grafana ~]# systemctl enable grafana-server
[root@grafana ~]# systemctl status grafana-server
#访问Grafana Web控制面板
http://XXX:3000(端口为3000),打开Grafana控制面板, 初始默认账号和密码均为 admin,初次登录需要修改密码。
标签:部署,repos,grafana,Centos7,--,systemctl,yum,root From: https://www.cnblogs.com/sinsenliu/p/17807787.html