Jump to: navigation, search

Difference between revisions of "Trove/DBInstanceLogOperationV1"

(Public API Details)
(Get the list of all available database logging files per given datastore version. HTTP method GET)
Line 72: Line 72:
 
                           {
 
                           {
 
                               "datastore_version_manager": "mysql",
 
                               "datastore_version_manager": "mysql",
                               "datastore_log_files": ["general_log", "log_slow_queries", "log-error"],
+
                               "datastore_log_files": ["general_log", "log_slow_queries", "log_error"],
 
                           }
 
                           }
 
         }
 
         }
 
     }
 
     }
 +
 +
===== How does it works =====
 +
 +
Trove will have datastore-spicif (mysql, cassandra, etc.) list that contain all possible log file entities that which can be pulled from instance
 +
List looks like:
 +
 +
        "mapping": [
 +
            'general_log', 'log_slow_queries',  'log_error', 'bin_log'
 +
        ]
 +
 +
: If assigned configuration groups has any ony them, user will see them in the response body. If assigned configuration group has none of log configuration attributes user will receive empty list.
  
 
==== Create and save database logging file entry. HTTP method POST====
 
==== Create and save database logging file entry. HTTP method POST====

Revision as of 19:13, 19 May 2014

Mission

Provide specific API interface to end-user which would allow to manipulate with database log files. This feature provides the ability to access log files via Swift so the can download them for Auditing/Troubleshooting purposes.

Why does Trove needs it ?

Short BIO. Audit.

Auditing is a core component to compliance and security programs, and a generally accepted practice by IT operations. Relational databases were the first enterprise application to embed auditing as a native platform feature. Yet part of this heritage is the stigma associated with auditing. Vendors provided the basic function, they failed to provide the performance and ease of management demanded by database administrators (DBAs), who remain loathe to enable the feature, and remain one of the last holdouts for accepting the use of database audit trails.
The reasons for their distaste of native audit are fully justified: from performance and data management nightmares, to the fact that these audit trails were not originally designed for the tasks they are being applied to. Regardless, regulatory compliance demands accurate and complete records of transactions, and relational database audit trails produce just that.
Security and compliance drive the use of database auditing, and these log files provide a unique perspective that needs to be captured. Database vendors are building better auditing features into their products, minimizing historic impediments, but careful deployment is required to avoid these known issues.

Description

Log manipulations are designed to let user perform log investigations. Since Trove is PaaS - level project, it's user cannot interact with compute instance directly, only with database through given API (database operations).

Justification/Benefits

Justification

Perfomance tuning based on log file analyze.

Database throughput is always limited by the mathimatical equations based upon available resources, after reaching defined limit database starts throwing exceptions that are logged in general log(cassandra system.log, redis server log) or special error log (mysql, percona, maria, etc.).

Database audit.

Auditing is a core component to compliance and security programs, and a generally accepted practice by IT operations. Relational databases were the first enterprise application to embed auditing as a native platform feature. Yet part of this heritage is the stigma associated with auditing. Vendors provided the basic function, they failed to provide the performance and ease of management demanded by database administrators (DBAs), who remain loathe to enable the feature, and remain one of the last holdouts for accepting the use of database audit trails.Database auditing is the examination of audit or transaction logs for the purpose of tracking changes with data or database structure. Databases can be set to capture alterations to data and metadata.
Database Management will be audited approximately once every three years using a risk-based approach. Databases to be reviewed include those databases supporting mission critical university functions. The following topics should be addressed during the review:
  • Database Administration (policies and procedures, capacity planning)
  • Database Maintenance and Tuning (operational effectiveness)
  • Database Integrity (referential integrity, triggers)
  • Database Security (database security settings, auditing/logging)
  • Database Backup and Recovery (availability)

Database startup Issues resolving based upon error/general log analyz.

Example: Mysql. The error log contains information indicating when mysqld was started and stopped and also any critical errors that occur while the server is running. If mysqld notices a table that needs to be automatically checked or repaired, it writes a message to the error log. Cassandra. Heap size errors based on automated memory allocation while database service launching (http://stackoverflow.com/questions/16243434/getting-outofmemory-in-cassandra-java-heap-space-version-1-0-7-frequently-on-dif).
The minimum requirements set forth in the “general overview and risk assessment” section below must be completed for the audit to qualify for core audit coverage. Following completion of the general overview and risk assessment, the auditor will use professional judgment to select specific areas for additional focus and audit testing.

Benefits

From the user perspective, this feature completely covers real-worl use cases mentioned in justification section (management, perfomance tuning, audit, etc.)

Impacts

Thi feature would not affect/break current Trove API. It changes the attitute to the actual Trove instance from the simple database server with connection URL to something bigger. It affects in-accessability of the instance, that is restricted by the terms of use of the public/private cloud and affects the PaaS term.

Database

Database changes are not required because database logs are not tracked at the Trove backend as a resource that can be re-used in future.

Configuration

None

Public API

New routes are presented. Description mentioned below.

Public API Details

Three new resources, log-create, log-show will be exposed as part of the Trove API.
The log-show is used to provide an ability to list all available(availability defined by Trove) database logging filenames per instance.
The log-create is used to provide an ability to save database logging file into the Swift container, required attribute - instance.


To implement this capability, the create/modify/list instance operations will be extended in a manner that does not break the existing 1.0 contract. These operations will permit a user to create a new database logging file entry for already existed instance, list all available database logging filenames for all registered datstore versions (basically, for all datastore managers across all versions), show all available database logging filenames per certain datastore version (manager).

API Calls


Get the list of all available database logging files per given datastore version. HTTP method GET

Route: /{tenant_id}/datastore/{datastore}/logs

Response

   {
       "logs": {
                          {
                             "datastore_version_manager": "mysql",
                             "datastore_log_files": ["general_log", "log_slow_queries", "log_error"],
                          }
       }
   }
How does it works

Trove will have datastore-spicif (mysql, cassandra, etc.) list that contain all possible log file entities that which can be pulled from instance List looks like:

       "mapping": [
           'general_log', 'log_slow_queries',  'log_error', 'bin_log'
       ]
If assigned configuration groups has any ony them, user will see them in the response body. If assigned configuration group has none of log configuration attributes user will receive empty list.

Create and save database logging file entry. HTTP method POST

Route: /{tenant_id}/instance/{id}/logs

Request

   {
       "logs": {
         "filename" : "general_log"
       }
   }


Response

   {
       "log": {
         "instance_id" : "12345678-1111-2222-3333-444444444444",
         "file" : "mysql.log",
         "locationURL" : "http://somewhere.com:PORT/dblogcontainer/{instance_id}/filename.timestamp",
         "created_at": POSIX Timestamp,
         "modified_at": POSIX Timestamp,
       }
   }

Internal API

All required API will be covered

Guest Agent

Added new method and flow agent for saving the log files directly to Swift container

  • naming convention: dblogcontainer/{instance_id}/filename.timestamp
  • Storage container file extension: *.log, *.tar.gz
  • Storage Strategy: Swift
  • Container: dblogcontainer