10. Graphite Installation C 1. dependency
# python ? ?? ? ??
$ sudo yum install python
# dependency ??
$ wget https://launchpad.net/graphite/0.9/0.9.10/+download/check-dependencies.py
$ python check-dependencies.py
[FATAL] Unable to import the 'whisper' module, please download this package from the Graphite project page and install it.
[FATAL] Unable to import the 'django' module, do you have Django installed for python 2.6.6?
[FATAL] Unable to import the 'tagging' module, do you have django-tagging installed for python 2.6.6?
[WARNING] Unable to import the 'mod_python' module, do you have mod_python installed for python 2.6.6?
mod_python is one of the most common ways to run graphite-web under apache.
Without mod_python you will still be able to use the built in development server; which is not
recommended for production use.
wsgi or other approaches for production scale use are also possible without mod_python
[WARNING]
Unable to import the 'txamqp' module, this is required if you want to use AMQP.
Note that txamqp requires python 2.5 or greater.
3 necessary dependencies not met. Graphite will not function until these dependencies are fulfilled.
2 optional dependencies not met. Please consider the warning messages before proceeding.
# dependency ?? ??
$ yum install Django
$ yum install Django-tagging
$ yum install mod_python
$ yum install python-memcached
$ yum install python-ldap
$ yum install Twisted
$ easy_install txamqp
$ easy_install whisper
# ??? ?? ???? ??? OK
$ python check-dependencies.py
All necessary dependencies are met.
All optional dependencies are met.
?? ??? Oracle Enterprise Linux 6 ???.
13. Graphite Installation C 4. Configuring The Webapp
# ????? ?????? manage.py ? ????? ??
$ cp /root/programs/graphite-web/webapp/manage.py /opt/graphite/webapp/graphite/
$ cd /opt/graphite/webapp/graphite
# manage.py ??? ??? ????? ??? ??? ????.
$ vi manage.py
$ python manage.py collectstatic
/opt/graphite/webapp/graphite/settings.py:233: UserWarning: SECRET_KEY is set to an unsafe default. This should be set in
local_settings.py for better security
warn('SECRET_KEY is set to an unsafe default. This should be set in local_settings.py for better security')
You have requested to collect static files at the destination
location as specified in your settings.
This will overwrite existing files!
Are you sure you want to do this?
Type 'yes' to continue, or 'no' to cancel: yes
# /opt/graphite ?? static ??? ?? ?? ??? ? ??.
#!/usr/bin/env python
import os
import sys
sys.path.append('/opt/graphite/webapp')
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "graphite.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
26. Oracle ???? ?? ?? (11.2.0.4 ??)
# ???? (?? ??? ??? ??)
SQL> create table mondba.sysstat as select * from v$sysstat where 1=0;
SQL> alter table mondba.sysstat add no number not null;
SQL> insert into mondba.sysstat select a.*, 1 from v$sysstat a;
SQL> commit;
$ vi graphite_gather_oracle.sql
set heading off
set feedback off
set time off timing off
set pages 0
col value for 9999999999999999999999999999
insert into mondba.sysstat1 select a.*, (select max(no)+1 from mondba.sysstat1) from v$sysstat a;
select replace(replace(replace(name,' ','_'),'(',''),')','')||' '||to_char(value)
from (
select pool as name, sum(bytes) as value from v$sgastat where pool is not null group by pool
union all
select name, bytes as value from v$sgastat where pool is null
union all
select lower(status)||'_session' as name, count(*) as value from v$session group by status
union all
select 'data_size' as name, sum(bytes) as value from dba_data_files
union all
select 'free_size' as name, sum(bytes) as value from dba_free_space
union all
select b.name, sum(a.value) as value from v$sesstat a, v$statname b where a.statistic#=b.statistic# and b.name in ('session pga memory', 'opened cursors current', 'session uga memory') group by b.name
union all
select now.name, now.value-bef.value as value
from
(select name, value from mondba.sysstat1 where no=(select max(no) from mondba.sysstat1)) now,
(select name, value from mondba.sysstat1 where no=(select max(no)-1 from mondba.sysstat1)) bef
where now.name=bef.name
and now.name in ('user calls', 'execute count', 'user commits', 'user rollbacks',
'consistent changes', 'session logical reads', 'db block gets', 'db block changes',
/*
* ??? ?? ?? ?? *
*/
'cell physical IO bytes saved by storage index',
'cell physical IO interconnect bytes'
)
);
delete from mondba.sysstat1 where no=(select max(no)-2 from mondba.sysstat1);
commit;