Skip to Content
Graphite监控
book

Graphite监控

by Jason Dixon
October 2020
Intermediate to advanced
261 pages
5h 32m
Chinese
Publishing House of Electronics Industry
Content preview from Graphite监控
Peter
Graphite
故事
225
示例9-11:转储SQLite数据库的副本
$ cd /opt/graphite/webapp/graphite/
$ PYTHONPATH=/opt/graphite/webapp \
django-admin.py dumpdata --settings=graphite.settings > ~/initial_data.json
你可能会问自己,为什么我会选择一个看似随意的文件名,比如
initial_data.json
。如
果你和我一样,经常会发现自己习惯将各种命令行输出重定向到
foo.txt
why_even_
did_I_do_this.poop
等文件。事实证明,
Django
提供了一种自主(非交互)的方法来运
fixtures
。这个功能依赖一个数据文件的存在,你现在可能已经猜到了,它的名字叫
initial_data.json
在我们继续之前,现在是更新
local_settings.py
中的
DATABASES
指令块的最佳时机(参见
示例
9-12
)。就像我们在进行全新安装时做的那样,你需要改变所有的属性来匹配你的
PostgreSQL
角色和数据库名称。
ENGINEE
属性必须更新成新的
psycopg2
驱动。
示例9-12:在导入数据前更新数据库配置
DATABASES = {
'default': {
'NAME': 'graphite',
'ENGINE': 'django.db.backends.postgresql_psycopg2', ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

写给系统管理员的Python脚本编程指南

写给系统管理员的Python脚本编程指南

Posts & Telecom Press, Ganesh Sanjiv Naik
弱监督学习实用指南

弱监督学习实用指南

Wee Hyong Tok, Amit Bahree, Senja Filipi
精通機器學習

精通機器學習

Aurélien Géron

Publisher Resources

ISBN: 9787121395154