aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorre4k <re4k@re4k.info>2013-05-06 01:23:39 +0900
committerre4k <re4k@re4k.info>2013-05-06 01:23:39 +0900
commit08adec2580871dac369e57ad51ed18c9e11de43a (patch)
tree97f05f7b063d8991d45c44583d2ea0e3c24ce911
parent1c2b489eecc35e8b202e0b648ff1d5495e2f2d1d (diff)
downloadaclog-08adec2580871dac369e57ad51ed18c9e11de43a.tar.gz
move worker's directory client/ to collector/
-rw-r--r--.gitignore6
-rw-r--r--README.md7
-rw-r--r--client/settings.yml.default16
-rw-r--r--collector/Gemfile (renamed from client/Gemfile)0
-rw-r--r--collector/Gemfile.lock (renamed from client/Gemfile.lock)0
-rw-r--r--collector/logger.rb (renamed from client/logger.rb)0
-rw-r--r--collector/settings.rb (renamed from client/settings.rb)0
-rw-r--r--collector/settings.yml.example18
-rwxr-xr-xcollector/start.rb (renamed from client/start.rb)1
-rw-r--r--collector/worker.rb (renamed from client/worker.rb)4
10 files changed, 28 insertions, 24 deletions
diff --git a/.gitignore b/.gitignore
index ea0c6b2..aa2322f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,8 +23,6 @@
/config/initializers/secret_token.rb
/config/database.yml
-# local scripts
-/client/worker.sh
-/client/Procfile
-/client/settings.yml
+/collector/Procfile
+/collector/settings.yml
diff --git a/README.md b/README.md
index e60c1ec..705373f 100644
--- a/README.md
+++ b/README.md
@@ -36,7 +36,7 @@ Add to `my.cnf`
innodb_large_prefix
Create MySQL user
-### aclog configuration
+### aclog configuration (application)
* Set consumer keys, base URL, ..
cp config/settings.yml.example config/settings.yml
@@ -53,4 +53,9 @@ Create MySQL user
cp config/initializers/secret_token.rb.example config/initializers/secret_token.rb
sed -i s/replace_here/$(rake secret)/g config/initializers/secret_token.rb
+### aclog configuration (worker)
+* Set consumer keys, secret key
+
+ cp collector/settings.yml.example collector/settings.yml
+ vi collector/settings.yml
diff --git a/client/settings.yml.default b/client/settings.yml.default
deleted file mode 100644
index 49c9dc7..0000000
--- a/client/settings.yml.default
+++ /dev/null
@@ -1,16 +0,0 @@
-defaults: &defaults
- consumer:
- - key: *consumer_key*
- secret: *consumer_secret*
- secret_key: *secret_key*
-development:
- <<: *defaults
- worker_number: 0
- db_proxy_host: localhost
- db_proxy_port: 9001
-production:
- <<: *defaults
- worker_number: <%= ENV["ACLOG_WORKER_NUMBER"] %>
- db_proxy_host: localhost
- db_proxy_port: 9001
-
diff --git a/client/Gemfile b/collector/Gemfile
index afa3652..afa3652 100644
--- a/client/Gemfile
+++ b/collector/Gemfile
diff --git a/client/Gemfile.lock b/collector/Gemfile.lock
index ebf49e2..ebf49e2 100644
--- a/client/Gemfile.lock
+++ b/collector/Gemfile.lock
diff --git a/client/logger.rb b/collector/logger.rb
index eb09894..eb09894 100644
--- a/client/logger.rb
+++ b/collector/logger.rb
diff --git a/client/settings.rb b/collector/settings.rb
index 562bd75..562bd75 100644
--- a/client/settings.rb
+++ b/collector/settings.rb
diff --git a/collector/settings.yml.example b/collector/settings.yml.example
new file mode 100644
index 0000000..f2b44f4
--- /dev/null
+++ b/collector/settings.yml.example
@@ -0,0 +1,18 @@
+defaults: &defaults
+ consumer:
+ - key: "consumer key for collector"
+ secret: "consumer secret"
+ - key: "second consumer key"
+ secret: "consumer secret"
+ secret_key: "secret key"
+development:
+ <<: *defaults
+ worker_number: 0
+ receiver_host: localhost
+ receiver_port: 42106
+production:
+ <<: *defaults
+ worker_number: <%= ENV["ACLOG_WORKER_NUMBER"] %>
+ receiver_host: localhost
+ receiver_port: 42106
+
diff --git a/client/start.rb b/collector/start.rb
index f3ba31e..e8c7242 100755
--- a/client/start.rb
+++ b/collector/start.rb
@@ -7,4 +7,3 @@ $stderr.sync = true
worker = Worker.new
worker.start
-
diff --git a/client/worker.rb b/collector/worker.rb
index 2d162e2..9d57e84 100644
--- a/client/worker.rb
+++ b/collector/worker.rb
@@ -300,7 +300,7 @@ class Worker
def unbind
$logger.info("Connection closed")
EM.add_timer(10) do
- reconnect(Settings.db_proxy_host, Settings.db_proxy_port)
+ reconnect(Settings.receiver_host, Settings.receiver_port)
post_init
end
end
@@ -347,7 +347,7 @@ class Worker
def start
$logger.info("Worker ##{Settings.worker_number} started")
EM.run do
- connection = EM.connect(Settings.db_proxy_host, Settings.db_proxy_port, DBProxyClient)
+ connection = EM.connect(Settings.receiver_host, Settings.receiver_port, DBProxyClient)
stop = Proc.new do
connection.stop_all