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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 29880280e87c05f7108661ac476c81546ad0f5b6
4
- data.tar.gz: 9d375e9b51d467ffadebf388991dab55a267d943
3
+ metadata.gz: 0bdb2c370dae1201863b40f1c52925dd7b7faf9c
4
+ data.tar.gz: 123bb993f7412ed3401680b766e675ee1ffa5874
5
5
  SHA512:
6
- metadata.gz: 94c767cc074eaf54d61b60b21bd472ab20545bb39e35c41bbbc9742f5c148d9a8a2bfc0a1e68be936a28a6dddddf9d653087c71ceeef31c83262b67c4c7319bf
7
- data.tar.gz: b7c46262f055be84c81a4205ec496022188bbc4923b1bd49a1d5919c65d30fb3b931a7194464c3668e35fbca60db03eddeeb15315d62a2d88dcf0a63c142f10b
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
- ### LOCAL FILE STORAGE
105
+ ## HTTP API
106
+
107
+ See [API.md](API.md).
109
108
 
110
- Fluentd Server also supports to edit Fluentd configuration files as local files for the case using `git` (or any VCSs) to manage Fluentd configuration revisions.
109
+ ### Use Fluentd Server from Command Line
111
110
 
112
- To use this feature, enable `LOCAL_STORAGE` in `.env` file:
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
- The `DATA_DIR` is the location to place your configuration files locally, and the `SYNC_INTERVAL` is the interval where a synchronization worker works.
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
- Putting any files whose name ends with `.erb` in `DATA_DIR` automatically synchronizes with DB by the `sync` worker. Removing `.erb` files is also synchronized with DB.
131
+ NOTE: Enabling this feature disables to edit the Fluentd configuration from the Web UI.
123
132
 
124
- NOTE: Enabling this feature disables to edit the Fluentd configuration from the Web UI.
133
+ ### CLI (Command Line Interface)
125
134
 
126
- ## HTTP API
135
+ Here is a full list of fluentd-server commands.
127
136
 
128
- See [API.md](API.md).
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
 
@@ -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 job
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 "job_clear", "Clear fluentd_server delayed_job queue"
105
- def job_clear
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 sync
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
@@ -12,6 +12,7 @@ class FluentdServer::SyncRunner
12
12
  end
13
13
 
14
14
  def run
15
+ logger.debug "[sync] sync runner started"
15
16
  return nil unless FluentdServer::Config.local_storage
16
17
  plus, minus = find_diff
17
18
  create(plus)
@@ -1,3 +1,3 @@
1
1
  module FluentdServer
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluentd-server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naotoshi Seo