fluentd-server 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -0
- data/Procfile +2 -2
- data/README.md +39 -11
- data/lib/fluentd_server/cli.rb +67 -8
- data/lib/fluentd_server/sync_runner.rb +1 -0
- data/lib/fluentd_server/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bdb2c370dae1201863b40f1c52925dd7b7faf9c
|
4
|
+
data.tar.gz: 123bb993f7412ed3401680b766e675ee1ffa5874
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ce9d5de9c3f5237a703c5987a0eb49762233fa6140ae8fa074486206840c404b2f22bb42a6182501e3eae889e05d2ca22d48303d9286b776b84d689857f63e4
|
7
|
+
data.tar.gz: 4a173696a16bf08097d2771761d511f123d4918b6d07986b48c9bb3a0b05c6b731aa8181cd62f1f72c38a6d43ad2ea2ad72efabb03727854fe5eb42177c72aee
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,22 @@
|
|
1
|
+
# 0.3.1
|
2
|
+
|
3
|
+
Enhancements:
|
4
|
+
|
5
|
+
* Add `fluentd-server sync` command
|
6
|
+
* Add `fluentd-server td-agent-start` command
|
7
|
+
* Add `fluentd-server td-agent-stop` command
|
8
|
+
* Add `fluentd-server td-agent-reload` command
|
9
|
+
* Add `fluentd-server td-agent-restart` command
|
10
|
+
* Add `fluentd-server td-agent-condrestart` command
|
11
|
+
* Add `fluentd-server td-agent-status` command
|
12
|
+
* Add `fluentd-server td-agent-configtest` command
|
13
|
+
|
14
|
+
Changes:
|
15
|
+
|
16
|
+
* Rename `fluentd-server sync` command to `fluentd-server sync-worker`
|
17
|
+
* Rename `fluentd-server job` command to `fluentd-server job-worker`
|
18
|
+
* Rename `fluentd-server job_clear` command to `fluentd-server job-clean`
|
19
|
+
|
1
20
|
# 0.3.0
|
2
21
|
|
3
22
|
Enhancements:
|
data/Procfile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
web: bundle exec unicorn -E production -p $PORT -o $HOST -c config/unicorn.conf
|
2
|
-
job: bundle exec bin/fluentd-server job
|
3
|
-
sync: bundle exec bin/fluentd-server sync
|
2
|
+
job: bundle exec bin/fluentd-server job-worker
|
3
|
+
sync: bundle exec bin/fluentd-server sync-worker
|
4
4
|
serf: $(bundle exec gem path serf-td-agent)/bin/serf agent
|
data/README.md
CHANGED
@@ -100,16 +100,18 @@ HOST=0.0.0.0
|
|
100
100
|
# LOG_LEVEL=debug
|
101
101
|
# LOG_SHIFT_AGE=0
|
102
102
|
# LOG_SHIFT_SIZE=1048576
|
103
|
-
# LOCAL_STORAGE=false
|
104
|
-
# DATA_DIR=data
|
105
|
-
# SYNC_INTERVAL=60
|
106
103
|
```
|
107
104
|
|
108
|
-
|
105
|
+
## HTTP API
|
106
|
+
|
107
|
+
See [API.md](API.md).
|
109
108
|
|
110
|
-
|
109
|
+
### Use Fluentd Server from Command Line
|
111
110
|
|
112
|
-
|
111
|
+
For the case you want to edit Fluentd configuration files from your favorite editors rather than from the Web UI, `LOCAL STORAGE` feature is available.
|
112
|
+
With this feature, you should also be able to manage your configuration files with git (or any VCS).
|
113
|
+
|
114
|
+
To use this feature, enable `LOCAL_STORAGE` in `.env` file as:
|
113
115
|
|
114
116
|
```
|
115
117
|
LOCAL_STORAGE=true
|
@@ -117,15 +119,41 @@ DATA_DIR=data
|
|
117
119
|
SYNC_INTERVAL=60
|
118
120
|
```
|
119
121
|
|
120
|
-
|
122
|
+
where the `DATA_DIR` is the location to place your configuration files locally, and the `SYNC_INTERVAL` is the interval where a synchronization worker works.
|
123
|
+
|
124
|
+
Putting any files whose name ends with `.erb` in `DATA_DIR` is automatically synchronized with DB by the synchronization worker. Removing `.erb` files is also synchronized with DB.
|
125
|
+
For the case you want to synchronize immediately, `sync` command is also available.
|
126
|
+
|
127
|
+
```
|
128
|
+
$ fluentd-server sync
|
129
|
+
```
|
121
130
|
|
122
|
-
|
131
|
+
NOTE: Enabling this feature disables to edit the Fluentd configuration from the Web UI.
|
123
132
|
|
124
|
-
|
133
|
+
### CLI (Command Line Interface)
|
125
134
|
|
126
|
-
|
135
|
+
Here is a full list of fluentd-server commands.
|
127
136
|
|
128
|
-
|
137
|
+
```bash
|
138
|
+
$ fluentd-server help
|
139
|
+
Commands:
|
140
|
+
fluentd-server help [COMMAND] # Describe available commands or one specific command
|
141
|
+
fluentd-server init # Creates database schema
|
142
|
+
fluentd-server job-clean # Clean fluentd_server delayed_job queue
|
143
|
+
fluentd-server job-worker # Sartup fluentd_server job worker
|
144
|
+
fluentd-server migrate # Migrate database schema
|
145
|
+
fluentd-server new # Creates fluentd-server resource directory
|
146
|
+
fluentd-server start # Sartup fluentd_server
|
147
|
+
fluentd-server sync # Synchronize local file storage with db immediately
|
148
|
+
fluentd-server sync-worker # Sartup fluentd_server sync worker
|
149
|
+
fluentd-server td-agent-condrestart # Run `/etc/init.d/td-agent condrestart` via serf event
|
150
|
+
fluentd-server td-agent-configtest # Run `/etc/init.d/td-agent configtest` via serf query
|
151
|
+
fluentd-server td-agent-reload # Run `/etc/init.d/td-agent reload` via serf event
|
152
|
+
fluentd-server td-agent-restart # Run `/etc/init.d/td-agent restart` via serf event
|
153
|
+
fluentd-server td-agent-start # Run `/etc/init.d/td-agent start` via serf event
|
154
|
+
fluentd-server td-agent-status # Run `/etc/init.d/td-agent status` via serf query
|
155
|
+
fluentd-server td-agent-stop # Run `/etc/init.d/td-agent stop` via serf event
|
156
|
+
```
|
129
157
|
|
130
158
|
## ToDo
|
131
159
|
|
data/lib/fluentd_server/cli.rb
CHANGED
@@ -30,8 +30,8 @@ EOS
|
|
30
30
|
|
31
31
|
DEFAULT_PROCFILE =<<-EOS
|
32
32
|
web: unicorn -E production -p $PORT -o $HOST -c config/unicorn.conf
|
33
|
-
job: fluentd-server job
|
34
|
-
sync: fluentd-server sync
|
33
|
+
job: fluentd-server job-worker
|
34
|
+
sync: fluentd-server sync-worker
|
35
35
|
serf: $(gem path serf-td-agent)/bin/serf agent
|
36
36
|
EOS
|
37
37
|
|
@@ -87,8 +87,8 @@ EOS
|
|
87
87
|
end
|
88
88
|
|
89
89
|
# reference: https://gist.github.com/robhurring/732327
|
90
|
-
desc "job", "Sartup fluentd_server job worker"
|
91
|
-
def
|
90
|
+
desc "job-worker", "Sartup fluentd_server job worker"
|
91
|
+
def job_worker
|
92
92
|
Dotenv.load
|
93
93
|
require 'delayed_job'
|
94
94
|
require 'fluentd_server/model'
|
@@ -101,21 +101,80 @@ EOS
|
|
101
101
|
Delayed::Worker.new(worker_options).start
|
102
102
|
end
|
103
103
|
|
104
|
-
desc "
|
105
|
-
def
|
104
|
+
desc "job-clean", "Clean fluentd_server delayed_job queue"
|
105
|
+
def job_clean
|
106
106
|
Dotenv.load
|
107
107
|
require 'delayed_job'
|
108
108
|
require 'fluentd_server/model'
|
109
109
|
Delayed::Job.delete_all
|
110
110
|
end
|
111
111
|
|
112
|
-
desc "sync", "Sartup fluentd_server sync worker"
|
113
|
-
def
|
112
|
+
desc "sync-worker", "Sartup fluentd_server sync worker"
|
113
|
+
def sync_worker
|
114
114
|
Dotenv.load
|
115
115
|
require 'fluentd_server/sync_worker'
|
116
116
|
FluentdServer::SyncWorker.start
|
117
117
|
end
|
118
118
|
|
119
|
+
desc "sync", "Synchronize local file storage with db immediately"
|
120
|
+
def sync
|
121
|
+
Dotenv.load
|
122
|
+
require 'fluentd_server/sync_runner'
|
123
|
+
FluentdServer::SyncRunner.run
|
124
|
+
end
|
125
|
+
|
126
|
+
desc "td-agent-start", "Run `/etc/init.d/td-agent start` via serf event"
|
127
|
+
def td_agent_start
|
128
|
+
Dotenv.load
|
129
|
+
require 'fluentd_server/model'
|
130
|
+
system("#{::Task.serf_path} event td-agent-start")
|
131
|
+
end
|
132
|
+
|
133
|
+
desc "td-agent-stop", "Run `/etc/init.d/td-agent stop` via serf event"
|
134
|
+
def td_agent_stop
|
135
|
+
Dotenv.load
|
136
|
+
require 'fluentd_server/model'
|
137
|
+
system("#{::Task.serf_path} event td-agent-stop")
|
138
|
+
end
|
139
|
+
|
140
|
+
desc "td-agent-reload", "Run `/etc/init.d/td-agent reload` via serf event"
|
141
|
+
def td_agent_reload
|
142
|
+
Dotenv.load
|
143
|
+
require 'fluentd_server/model'
|
144
|
+
system("#{::Task.serf_path} event td-agent-reload")
|
145
|
+
end
|
146
|
+
|
147
|
+
desc "td-agent-restart", "Run `/etc/init.d/td-agent restart` via serf event"
|
148
|
+
def td_agent_restart
|
149
|
+
Dotenv.load
|
150
|
+
require 'fluentd_server/model'
|
151
|
+
# ::Task.create_and_delete(name: 'Restart').restart # using delayed_job
|
152
|
+
system("#{::Task.serf_path} event td-agent-restart")
|
153
|
+
end
|
154
|
+
|
155
|
+
desc "td-agent-condrestart", "Run `/etc/init.d/td-agent condrestart` via serf event"
|
156
|
+
def td_agent_condrestart
|
157
|
+
Dotenv.load
|
158
|
+
require 'fluentd_server/model'
|
159
|
+
system("#{::Task.serf_path} event td-agent-condrestart")
|
160
|
+
end
|
161
|
+
|
162
|
+
desc "td-agent-status", "Run `/etc/init.d/td-agent status` via serf query"
|
163
|
+
def td_agent_status
|
164
|
+
Dotenv.load
|
165
|
+
require 'fluentd_server/model'
|
166
|
+
# ::Task.create_and_delete(name: 'Status').status # using delayed_job
|
167
|
+
system("#{::Task.serf_path} query td-agent-status")
|
168
|
+
end
|
169
|
+
|
170
|
+
desc "td-agent-configtest", "Run `/etc/init.d/td-agent configtest` via serf query"
|
171
|
+
def td_agent_configtest
|
172
|
+
Dotenv.load
|
173
|
+
require 'fluentd_server/model'
|
174
|
+
# ::Task.create_and_delete(name: 'Configtest').configtest # using delayed_job
|
175
|
+
system("#{::Task.serf_path} query td-agent-configtest")
|
176
|
+
end
|
177
|
+
|
119
178
|
no_tasks do
|
120
179
|
def abort(msg)
|
121
180
|
$stderr.puts msg
|