infrataster 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +3 -24
- data/Rakefile +6 -0
- data/ci/jenkins_build +1 -1
- data/infrataster.gemspec +0 -1
- data/lib/infrataster/contexts/http_context.rb +1 -1
- data/lib/infrataster/contexts.rb +0 -1
- data/lib/infrataster/resources.rb +0 -1
- data/lib/infrataster/server.rb +38 -29
- data/lib/infrataster/version.rb +1 -1
- data/spec/integration/http_spec.rb +0 -6
- data/spec/integration/other_spec.rb +8 -0
- data/spec/integration/spec_helper.rb +0 -1
- data/spec/integration/vm/Vagrantfile +6 -0
- data/spec/integration/vm/cookbooks/app/recipes/default.rb +0 -14
- data/spec/unit/lib/infrataster/server_spec.rb +51 -0
- metadata +4 -22
- data/lib/infrataster/contexts/mysql_query_context.rb +0 -26
- data/lib/infrataster/resources/mysql_query_resource.rb +0 -21
- data/spec/integration/mysql_query_spec.rb +0 -11
- data/spec/integration/vm/cookbooks/app/files/default/my.cnf +0 -127
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b50f39082b28b0195fa82e039f6408776186cc96
|
4
|
+
data.tar.gz: 6d8297343a434ce01ef1e3fe5551ede852584365
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7a6962125a06db963a54f2057f94be3b2389a748e463e4a9be62c69e6cf0557b819d5161b8719cc48d7a46258de29794b854183dab17d010fd46a6cf03d6892
|
7
|
+
data.tar.gz: 17b4b4cf5b7b858e7d548bcaa12a83a32ceb8826e26150651519f686348ba084a3ba2c24841edfee3cea6ebb178b0ad31b73270f26ee8bd81bd8074e8ec712bc
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# Infrataster
|
2
2
|
|
3
3
|
[](http://badge.fury.io/rb/infrataster)
|
4
|
+
[](http://ci.ryotarai.info/job/infrataster/)
|
5
|
+
[](https://codeclimate.com/github/ryotarai/infrataster)
|
4
6
|
|
5
7
|
Infrastructure Behavior Testing Framework.
|
6
8
|
|
@@ -209,30 +211,7 @@ Infrataster::BrowsermobProxy.bin_path = '/path/to/browsermob/bin/browsermob'
|
|
209
211
|
|
210
212
|
### `mysql_query` resource
|
211
213
|
|
212
|
-
`mysql_query` resource
|
213
|
-
|
214
|
-
```ruby
|
215
|
-
describe server(:db) do
|
216
|
-
describe mysql_query('SHOW STATUS') do
|
217
|
-
it 'returns positive uptime' do
|
218
|
-
row = results.find {|r| r['Variable_name'] == 'Uptime' }
|
219
|
-
expect(row['Value'].to_i).to be > 0
|
220
|
-
|
221
|
-
# `results` is a instance of `Mysql2::Result`
|
222
|
-
# See: https://github.com/brianmario/mysql2
|
223
|
-
end
|
224
|
-
end
|
225
|
-
end
|
226
|
-
```
|
227
|
-
|
228
|
-
You can specify username and password by options passed to `Infrataster::Server.define`:
|
229
|
-
|
230
|
-
```ruby
|
231
|
-
Infrataster::Server.define(
|
232
|
-
# ...
|
233
|
-
mysql: {user: 'app', password: 'app'}
|
234
|
-
)
|
235
|
-
```
|
214
|
+
`mysql_query` resource is now in [infrataster-plugin-mysql](https://github.com/ryotarai/infrataster-plugin-mysql).
|
236
215
|
|
237
216
|
## Example
|
238
217
|
|
data/Rakefile
CHANGED
@@ -8,6 +8,10 @@ end
|
|
8
8
|
|
9
9
|
ENV['VAGRANT_CWD'] = File.expand_path('spec/integration/vm')
|
10
10
|
|
11
|
+
|
12
|
+
desc 'Run unit and integration tests'
|
13
|
+
task :spec => ['spec:unit', 'spec:integration']
|
14
|
+
|
11
15
|
namespace :spec do
|
12
16
|
RSpec::Core::RakeTask.new("unit") do |task|
|
13
17
|
task.pattern = "./spec/unit{,/*/**}/*_spec.rb"
|
@@ -20,9 +24,11 @@ namespace :spec do
|
|
20
24
|
namespace :integration do
|
21
25
|
integration_dir = 'spec/integration'
|
22
26
|
|
27
|
+
desc 'Clean'
|
23
28
|
task :clean => ['destroy_vm', 'remove_berks'] do
|
24
29
|
end
|
25
30
|
|
31
|
+
desc 'Prepare'
|
26
32
|
task :prepare => ['download_browsermob', 'start_vm'] do
|
27
33
|
end
|
28
34
|
|
data/ci/jenkins_build
CHANGED
data/infrataster.gemspec
CHANGED
@@ -22,7 +22,6 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_runtime_dependency "rspec"
|
23
23
|
spec.add_runtime_dependency "net-ssh"
|
24
24
|
spec.add_runtime_dependency "net-ssh-gateway"
|
25
|
-
spec.add_runtime_dependency "mysql2"
|
26
25
|
spec.add_runtime_dependency "capybara"
|
27
26
|
spec.add_runtime_dependency "poltergeist"
|
28
27
|
spec.add_runtime_dependency "browsermob-proxy"
|
@@ -4,7 +4,7 @@ module Infrataster
|
|
4
4
|
module Contexts
|
5
5
|
class HttpContext < BaseContext
|
6
6
|
def response
|
7
|
-
server.
|
7
|
+
server.open_gateway_on_from_server(resource.uri.port) do |address, port|
|
8
8
|
url = "#{resource.uri.scheme}://#{address}:#{port}"
|
9
9
|
|
10
10
|
conn = Faraday.new(:url => url) do |faraday|
|
data/lib/infrataster/contexts.rb
CHANGED
data/lib/infrataster/server.rb
CHANGED
@@ -2,6 +2,7 @@ require 'tmpdir'
|
|
2
2
|
require 'net/ssh'
|
3
3
|
require 'net/ssh/gateway'
|
4
4
|
require 'ipaddr'
|
5
|
+
require 'shellwords'
|
5
6
|
|
6
7
|
module Infrataster
|
7
8
|
class Server
|
@@ -84,23 +85,23 @@ module Infrataster
|
|
84
85
|
end
|
85
86
|
|
86
87
|
def open_gateway_on_from_server(port)
|
87
|
-
if
|
88
|
-
|
89
|
-
|
90
|
-
|
88
|
+
if block_given?
|
89
|
+
if from
|
90
|
+
from.gateway_open(@address, port) do |new_port|
|
91
|
+
Logger.debug("tunnel: localhost:#{new_port} -> #{from.address} -> #{@address}:#{port}")
|
92
|
+
yield '127.0.0.1', new_port
|
93
|
+
end
|
94
|
+
else
|
95
|
+
yield @address, port
|
96
|
+
end
|
91
97
|
else
|
92
|
-
|
93
|
-
|
94
|
-
end
|
95
|
-
|
96
|
-
def gateway_on_from_server(port)
|
97
|
-
if from
|
98
|
-
from.gateway_open(@address, port) do |new_port|
|
98
|
+
if from
|
99
|
+
new_port, finalize_proc = from.gateway_open(@address, port)
|
99
100
|
Logger.debug("tunnel: localhost:#{new_port} -> #{from.address} -> #{@address}:#{port}")
|
100
|
-
|
101
|
+
['127.0.0.1', new_port, finalize_proc]
|
102
|
+
else
|
103
|
+
[@address, port, nil]
|
101
104
|
end
|
102
|
-
else
|
103
|
-
yield @address, port
|
104
105
|
end
|
105
106
|
end
|
106
107
|
|
@@ -110,32 +111,40 @@ module Infrataster
|
|
110
111
|
|
111
112
|
private
|
112
113
|
|
113
|
-
|
114
114
|
def _ssh_start_args
|
115
115
|
config = {}
|
116
|
+
|
116
117
|
if @options[:ssh]
|
117
118
|
config = @options[:ssh]
|
119
|
+
config[:host] ||= @address
|
118
120
|
elsif @options[:vagrant]
|
119
|
-
if @options[:vagrant] != true
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
Dir.mktmpdir do |dir|
|
126
|
-
output = File.join(dir, 'ssh-config')
|
127
|
-
`/usr/bin/vagrant ssh-config #{vagrant_name} > #{output}`
|
128
|
-
if $?.exitstatus != 0
|
129
|
-
raise Error, "`vagrant ssh-config` failed. Please check if VMs are running or not."
|
130
|
-
end
|
131
|
-
config = Net::SSH::Config.for(@name.to_s, [output])
|
132
|
-
end
|
121
|
+
vagrant_name = if @options[:vagrant] != true
|
122
|
+
@options[:vagrant]
|
123
|
+
else
|
124
|
+
@name
|
125
|
+
end
|
126
|
+
config = ssh_config_for_vagrant(vagrant_name)
|
133
127
|
else
|
134
128
|
raise Error, "Can't get configuration to connect to the server via SSH. Please set ssh option or vagrant option."
|
135
129
|
end
|
136
130
|
|
137
131
|
[config[:host], config[:user], config]
|
138
132
|
end
|
133
|
+
|
134
|
+
def ssh_config_for_vagrant(name)
|
135
|
+
config = nil
|
136
|
+
|
137
|
+
Dir.mktmpdir do |dir|
|
138
|
+
output = File.join(dir, 'ssh-config')
|
139
|
+
`/usr/bin/vagrant ssh-config #{Shellwords.shellescape(name)} > #{Shellwords.shellescape(output)}`
|
140
|
+
if $?.exitstatus != 0
|
141
|
+
raise Error, "`vagrant ssh-config` failed. Please check if VMs are running or not."
|
142
|
+
end
|
143
|
+
config = Net::SSH::Config.for(@name.to_s, [output])
|
144
|
+
end
|
145
|
+
|
146
|
+
config
|
147
|
+
end
|
139
148
|
end
|
140
149
|
end
|
141
150
|
|
data/lib/infrataster/version.rb
CHANGED
@@ -1,12 +1,6 @@
|
|
1
1
|
require 'integration/spec_helper'
|
2
2
|
require 'json'
|
3
3
|
|
4
|
-
describe 'Normal subject not related to Infrataster' do
|
5
|
-
it "doesn't raise any error" do
|
6
|
-
expect(subject).not_to raise_error
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
4
|
describe server(:proxy) do
|
11
5
|
describe http('http://app.example.com') do
|
12
6
|
it "sends GET request with Host header" do
|
@@ -17,6 +17,12 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
|
17
17
|
config.vm.box = "hashicorp/precise64"
|
18
18
|
end
|
19
19
|
|
20
|
+
if ENV['CI']
|
21
|
+
config.vm.provider "virtualbox" do |v|
|
22
|
+
v.customize ["modifyvm", :id, "--memory", "256"]
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
20
26
|
config.vm.define :proxy do |c|
|
21
27
|
c.vm.network "private_network", ip: "192.168.44.10"
|
22
28
|
c.vm.network "private_network", ip: INTERNAL_ADDRESSES['proxy'], virtualbox__intnet: "infrataster-integration-test"
|
@@ -33,17 +33,3 @@ end
|
|
33
33
|
|
34
34
|
execute 'supervisorctl restart rackup'
|
35
35
|
|
36
|
-
# db
|
37
|
-
package 'mysql-server'
|
38
|
-
|
39
|
-
service 'mysql' do
|
40
|
-
action :start
|
41
|
-
supports :restart => true
|
42
|
-
end
|
43
|
-
|
44
|
-
cookbook_file '/etc/mysql/my.cnf' do
|
45
|
-
notifies :restart, 'service[mysql]'
|
46
|
-
end
|
47
|
-
|
48
|
-
execute "mysql -uroot -e \"GRANT ALL PRIVILEGES ON *.* TO 'app'@'%' IDENTIFIED BY 'app';\""
|
49
|
-
|
@@ -44,6 +44,57 @@ module Infrataster
|
|
44
44
|
expect(gateway).to eq(gateway_mock)
|
45
45
|
end
|
46
46
|
end
|
47
|
+
|
48
|
+
describe "#_ssh_start_args" do
|
49
|
+
context "with ssh option" do
|
50
|
+
context "when options[:ssh][:host] is set" do
|
51
|
+
it 'returns args for SSH.start' do
|
52
|
+
server = Server.new('name', 'address', ssh: {host: 'host', user: 'user'})
|
53
|
+
expect(server.send(:_ssh_start_args)).
|
54
|
+
to eq(['host', 'user', {host: 'host', user: 'user'}])
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
context "when options[:ssh][:host] is not set" do
|
59
|
+
it 'returns args for SSH.start' do
|
60
|
+
server = Server.new('name', 'address', ssh: {user: 'user'})
|
61
|
+
expect(server.send(:_ssh_start_args)).
|
62
|
+
to eq(['address', 'user', {host: 'address', user: 'user'}])
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
context "with vagrant option" do
|
68
|
+
context "when vagrant option is true" do
|
69
|
+
it 'returns args for SSH.start' do
|
70
|
+
server = Server.new('name', 'address', vagrant: true)
|
71
|
+
expect(server).to receive(:ssh_config_for_vagrant).with('name').
|
72
|
+
and_return({host: 'host', user: 'user'})
|
73
|
+
expect(server.send(:_ssh_start_args)).
|
74
|
+
to eq(['host', 'user', {host: 'host', user: 'user'}])
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
context "when vagrant option is not true but truthy" do
|
79
|
+
it 'returns args for SSH.start' do
|
80
|
+
server = Server.new('name', 'address', vagrant: 'vagrant_vm_name')
|
81
|
+
expect(server).to receive(:ssh_config_for_vagrant).with('vagrant_vm_name').
|
82
|
+
and_return({host: 'host', user: 'user'})
|
83
|
+
expect(server.send(:_ssh_start_args)).
|
84
|
+
to eq(['host', 'user', {host: 'host', user: 'user'}])
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
context "otherwise" do
|
90
|
+
it 'raises an error' do
|
91
|
+
server = Server.new('name', 'address')
|
92
|
+
expect do
|
93
|
+
server.send(:_ssh_start_args)
|
94
|
+
end.to raise_error(Server::Error)
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
47
98
|
end
|
48
99
|
end
|
49
100
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: infrataster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryota Arai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -52,20 +52,6 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: mysql2
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :runtime
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: capybara
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -186,7 +172,6 @@ files:
|
|
186
172
|
- lib/infrataster/contexts/base_context.rb
|
187
173
|
- lib/infrataster/contexts/capybara_context.rb
|
188
174
|
- lib/infrataster/contexts/http_context.rb
|
189
|
-
- lib/infrataster/contexts/mysql_query_context.rb
|
190
175
|
- lib/infrataster/helpers.rb
|
191
176
|
- lib/infrataster/helpers/resource_helper.rb
|
192
177
|
- lib/infrataster/helpers/rspec_helper.rb
|
@@ -194,14 +179,13 @@ files:
|
|
194
179
|
- lib/infrataster/resources/base_resource.rb
|
195
180
|
- lib/infrataster/resources/capybara_resource.rb
|
196
181
|
- lib/infrataster/resources/http_resource.rb
|
197
|
-
- lib/infrataster/resources/mysql_query_resource.rb
|
198
182
|
- lib/infrataster/resources/server_resource.rb
|
199
183
|
- lib/infrataster/rspec.rb
|
200
184
|
- lib/infrataster/server.rb
|
201
185
|
- lib/infrataster/version.rb
|
202
186
|
- spec/integration/capybara_spec.rb
|
203
187
|
- spec/integration/http_spec.rb
|
204
|
-
- spec/integration/
|
188
|
+
- spec/integration/other_spec.rb
|
205
189
|
- spec/integration/spec_helper.rb
|
206
190
|
- spec/integration/vm/.gitignore
|
207
191
|
- spec/integration/vm/Berksfile
|
@@ -209,7 +193,6 @@ files:
|
|
209
193
|
- spec/integration/vm/app/Gemfile
|
210
194
|
- spec/integration/vm/app/app.rb
|
211
195
|
- spec/integration/vm/app/config.ru
|
212
|
-
- spec/integration/vm/cookbooks/app/files/default/my.cnf
|
213
196
|
- spec/integration/vm/cookbooks/app/files/default/rackup.conf
|
214
197
|
- spec/integration/vm/cookbooks/app/recipes/default.rb
|
215
198
|
- spec/integration/vm/cookbooks/apt-mirror/recipes/default.rb
|
@@ -246,7 +229,7 @@ summary: Infrastructure Behavior Testing Framework
|
|
246
229
|
test_files:
|
247
230
|
- spec/integration/capybara_spec.rb
|
248
231
|
- spec/integration/http_spec.rb
|
249
|
-
- spec/integration/
|
232
|
+
- spec/integration/other_spec.rb
|
250
233
|
- spec/integration/spec_helper.rb
|
251
234
|
- spec/integration/vm/.gitignore
|
252
235
|
- spec/integration/vm/Berksfile
|
@@ -254,7 +237,6 @@ test_files:
|
|
254
237
|
- spec/integration/vm/app/Gemfile
|
255
238
|
- spec/integration/vm/app/app.rb
|
256
239
|
- spec/integration/vm/app/config.ru
|
257
|
-
- spec/integration/vm/cookbooks/app/files/default/my.cnf
|
258
240
|
- spec/integration/vm/cookbooks/app/files/default/rackup.conf
|
259
241
|
- spec/integration/vm/cookbooks/app/recipes/default.rb
|
260
242
|
- spec/integration/vm/cookbooks/apt-mirror/recipes/default.rb
|
@@ -1,26 +0,0 @@
|
|
1
|
-
require 'mysql2'
|
2
|
-
|
3
|
-
module Infrataster
|
4
|
-
module Contexts
|
5
|
-
class MysqlQueryContext < BaseContext
|
6
|
-
def results
|
7
|
-
options = {port: 3306, user: 'root', password: ''}
|
8
|
-
if server.options[:mysql]
|
9
|
-
options = options.merge(server.options[:mysql])
|
10
|
-
end
|
11
|
-
|
12
|
-
server.gateway_on_from_server(options[:port]) do |address, new_port|
|
13
|
-
client = Mysql2::Client.new(
|
14
|
-
host: address,
|
15
|
-
port: new_port,
|
16
|
-
username: options[:user],
|
17
|
-
password: options[:password],
|
18
|
-
)
|
19
|
-
client.query(resource.query)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
|
@@ -1,21 +0,0 @@
|
|
1
|
-
require 'infrataster/resources/base_resource'
|
2
|
-
|
3
|
-
module Infrataster
|
4
|
-
module Resources
|
5
|
-
class MysqlQueryResource < BaseResource
|
6
|
-
Error = Class.new(StandardError)
|
7
|
-
|
8
|
-
attr_reader :query
|
9
|
-
|
10
|
-
def initialize(query, options = {})
|
11
|
-
@query = query
|
12
|
-
@options = options
|
13
|
-
end
|
14
|
-
|
15
|
-
def to_s
|
16
|
-
"mysql '#{@query}'"
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
@@ -1,127 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# The MySQL database server configuration file.
|
3
|
-
#
|
4
|
-
# You can copy this to one of:
|
5
|
-
# - "/etc/mysql/my.cnf" to set global options,
|
6
|
-
# - "~/.my.cnf" to set user-specific options.
|
7
|
-
#
|
8
|
-
# One can use all long options that the program supports.
|
9
|
-
# Run program with --help to get a list of available options and with
|
10
|
-
# --print-defaults to see which it would actually understand and use.
|
11
|
-
#
|
12
|
-
# For explanations see
|
13
|
-
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
|
14
|
-
|
15
|
-
# This will be passed to all mysql clients
|
16
|
-
# It has been reported that passwords should be enclosed with ticks/quotes
|
17
|
-
# escpecially if they contain "#" chars...
|
18
|
-
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
|
19
|
-
[client]
|
20
|
-
port = 3306
|
21
|
-
socket = /var/run/mysqld/mysqld.sock
|
22
|
-
|
23
|
-
# Here is entries for some specific programs
|
24
|
-
# The following values assume you have at least 32M ram
|
25
|
-
|
26
|
-
# This was formally known as [safe_mysqld]. Both versions are currently parsed.
|
27
|
-
[mysqld_safe]
|
28
|
-
socket = /var/run/mysqld/mysqld.sock
|
29
|
-
nice = 0
|
30
|
-
|
31
|
-
[mysqld]
|
32
|
-
#
|
33
|
-
# * Basic Settings
|
34
|
-
#
|
35
|
-
user = mysql
|
36
|
-
pid-file = /var/run/mysqld/mysqld.pid
|
37
|
-
socket = /var/run/mysqld/mysqld.sock
|
38
|
-
port = 3306
|
39
|
-
basedir = /usr
|
40
|
-
datadir = /var/lib/mysql
|
41
|
-
tmpdir = /tmp
|
42
|
-
lc-messages-dir = /usr/share/mysql
|
43
|
-
skip-external-locking
|
44
|
-
#
|
45
|
-
# Instead of skip-networking the default is now to listen only on
|
46
|
-
# localhost which is more compatible and is not less secure.
|
47
|
-
bind-address = 0.0.0.0
|
48
|
-
#
|
49
|
-
# * Fine Tuning
|
50
|
-
#
|
51
|
-
key_buffer = 16M
|
52
|
-
max_allowed_packet = 16M
|
53
|
-
thread_stack = 192K
|
54
|
-
thread_cache_size = 8
|
55
|
-
# This replaces the startup script and checks MyISAM tables if needed
|
56
|
-
# the first time they are touched
|
57
|
-
myisam-recover = BACKUP
|
58
|
-
#max_connections = 100
|
59
|
-
#table_cache = 64
|
60
|
-
#thread_concurrency = 10
|
61
|
-
#
|
62
|
-
# * Query Cache Configuration
|
63
|
-
#
|
64
|
-
query_cache_limit = 1M
|
65
|
-
query_cache_size = 16M
|
66
|
-
#
|
67
|
-
# * Logging and Replication
|
68
|
-
#
|
69
|
-
# Both location gets rotated by the cronjob.
|
70
|
-
# Be aware that this log type is a performance killer.
|
71
|
-
# As of 5.1 you can enable the log at runtime!
|
72
|
-
#general_log_file = /var/log/mysql/mysql.log
|
73
|
-
#general_log = 1
|
74
|
-
#
|
75
|
-
# Error log - should be very few entries.
|
76
|
-
#
|
77
|
-
log_error = /var/log/mysql/error.log
|
78
|
-
#
|
79
|
-
# Here you can see queries with especially long duration
|
80
|
-
#log_slow_queries = /var/log/mysql/mysql-slow.log
|
81
|
-
#long_query_time = 2
|
82
|
-
#log-queries-not-using-indexes
|
83
|
-
#
|
84
|
-
# The following can be used as easy to replay backup logs or for replication.
|
85
|
-
# note: if you are setting up a replication slave, see README.Debian about
|
86
|
-
# other settings you may need to change.
|
87
|
-
#server-id = 1
|
88
|
-
#log_bin = /var/log/mysql/mysql-bin.log
|
89
|
-
expire_logs_days = 10
|
90
|
-
max_binlog_size = 100M
|
91
|
-
#binlog_do_db = include_database_name
|
92
|
-
#binlog_ignore_db = include_database_name
|
93
|
-
#
|
94
|
-
# * InnoDB
|
95
|
-
#
|
96
|
-
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
|
97
|
-
# Read the manual for more InnoDB related options. There are many!
|
98
|
-
#
|
99
|
-
# * Security Features
|
100
|
-
#
|
101
|
-
# Read the manual, too, if you want chroot!
|
102
|
-
# chroot = /var/lib/mysql/
|
103
|
-
#
|
104
|
-
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
|
105
|
-
#
|
106
|
-
# ssl-ca=/etc/mysql/cacert.pem
|
107
|
-
# ssl-cert=/etc/mysql/server-cert.pem
|
108
|
-
# ssl-key=/etc/mysql/server-key.pem
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
[mysqldump]
|
113
|
-
quick
|
114
|
-
quote-names
|
115
|
-
max_allowed_packet = 16M
|
116
|
-
|
117
|
-
[mysql]
|
118
|
-
#no-auto-rehash # faster start of mysql but no tab completition
|
119
|
-
|
120
|
-
[isamchk]
|
121
|
-
key_buffer = 16M
|
122
|
-
|
123
|
-
#
|
124
|
-
# * IMPORTANT: Additional settings that can override those from this file!
|
125
|
-
# The files must end with '.cnf', otherwise they'll be ignored.
|
126
|
-
#
|
127
|
-
!includedir /etc/mysql/conf.d/
|