snow chuai汇总、整理、撰写—2020/2/28
1) 安装httpd [root@srv1 ~]# yum install httpd -y [root@srv1 ~]# systemctl enable --now httpd [root@srv1 ~]# firewall-cmd --add-service=http --permanent success [root@srv1 ~]# firewall-cmd --reload success 2) 创建特权用户 [root@srv1 ~]# echo -e 'Defaults:snow !requiretty\nsnow ALL = (root) NOPASSWD:ALL' > /etc/sudoers.d/graphite [root@srv1 ~]# cat /etc/sudoers.d/graphite Defaults:snow !requiretty snow ALL = (root) NOPASSWD:ALL
1) 安装Graphite [root@srv1 ~]# yum --enablerepo=epel install graphite-web python-carbon -y 2) 配置Graphite [root@srv ~]# vim /etc/graphite-web/local_settings.py # 取消13行注释并指定秘钥 SECRET_KEY = '/1000cc_key' # 取消23行注释并指定时区 TIME_ZONE = 'Asia/Shanghai' [root@srv1 ~]# vim /etc/httpd/conf.d/graphite-web.conf # 于30行新建一行,添加允许访问Graphite的网络地址或IP地址 Require local Require ip 192.168.10.0/24 3) 初始化Graphite数据库 [root@srv1 ~]# /usr/lib/python2.7/site-packages/graphite/manage.py syncdb Creating tables ... Creating table account_profile Creating table account_variable Creating table account_view Creating table account_window Creating table account_mygraph Creating table dashboard_dashboard_owners Creating table dashboard_dashboard Creating table events_event Creating table url_shortener_link Creating table auth_permission Creating table auth_group_permissions Creating table auth_group Creating table auth_user_groups Creating table auth_user_user_permissions Creating table auth_user Creating table django_session Creating table django_admin_log Creating table django_content_type Creating table tagging_tag Creating table tagging_taggeditem You just installed Django's auth system, which means you don't have any superusers defined. Would you like to create one now? (yes/no): yes Username (leave blank to use 'root'): snow Email address: snow@localhost Password: # 输入snow的密码 Password (again): Superuser created successfully. Installing custom SQL ... Installing indexes ... Installed 0 object(s) from 0 fixture(s) [root@srv1 ~]# chown -R apache. /var/lib/graphite-web [root@srv1 ~]# systemctl enable --now carbon-cache [root@srv1 ~]# systemctl restart httpd 4) SELinux设定 [root@srv1 ~]# setsebool -P httpd_can_network_connect on
[浏览器]=====>http://srv1.1000cc.net