$ for i in {1..100000}; do echo "hoge,fuga" >> /var/tmp/tail.log; done
* Treminal 1
# run logrotate during processing on Terminal 2
$ sudo logrotate logrotate.tdtest
$ ll
合計 1988
-rw-rw-rw- 1 td-agent td-agent 1100000 6月 21 19:14 2013 hoge.log
-rw-r--r-- 1 m-iwamoto contentsuser 131 6月 21 18:54 2013 logrotate.tdtest
-rw-r--r-- 1 m-iwamoto contentsuser 674200 6月 21 19:14 2013 tail.log
-rw-r--r-- 1 m-iwamoto contentsuser 236387 6月 21 19:14 2013 tail.log.1.gz
-rw-r--r-- 1 m-iwamoto contentsuser 242 6月 21 18:38 2013 tail.log.3.gz
# confirm if the line number of file produced by Fluentd matches to process of Terminal 1
$ wc -l hoge.log
100000 hoge.log
# check line number of current target log #=> (★)
$ wc -l tail.log
67420 tail.log
# check line number by decompressing archived file
$ gunzip tail.log.1.gz
$ wc -l tail.log.1
12185320 tail.log.1
# minus line number of previous file (before experiment) #=> (☆)
$ expr 12185320 - 12152740
32580
# confirm sum of (★) and (☆) matches the number of process of Terminal 2
$ expr 67420 + 32580
100000
Although I figured out that I enable syntax highlight for some files by vim's setf command,
its cumbersome that I type 'setf' each time when I open the file.
so I added the line bellow to my .vimrc.
au BufNewFile,BufRead php-fpm*.conf set filetype=dosini
As its just setting for php-fpm.conf, modify "php-fpm*.conf" and "filetype=xxx" properly if you want for other filetypes.
all you need to modify for suits 3.0.0 are bellow:
diff --git a/app/models/article.rb b/app/models/article.rb
index a00e637..386536a 100644
--- a/app/models/article.rb
+++ b/app/models/article.rb
@@ -5,5 +5,5 @@ class Article
field :published_on, :type => Date
validates_presence_of :name
embeds_many :comments
- referenced_in :author
+ belongs_to :author
end
diff --git a/app/models/author.rb b/app/models/author.rb
index 7741009..e52989e 100644
--- a/app/models/author.rb
+++ b/app/models/author.rb
@@ -1,6 +1,6 @@
class Author
include Mongoid::Document
field :name, type: String
- key :name
- references_many :articles
+ field :_id, type: String, default: ->{ name }
+ has_many :articles
end
diff --git a/config/routes.rb b/config/routes.rb
index 31cc8de..45ac1c4 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -2,7 +2,9 @@ Mongoid01::Application.routes.draw do
resources :authors
- resources :articles
+ resources :articles do
+ resources :comments
+ end
# The priority is based upon order of creation:
@@ -54,7 +56,7 @@ Mongoid01::Application.routes.draw do
# You can have the root of your site routed with "root"
# just remember to delete public/index.html.
- # root :to => 'welcome#index'
+ root :to => 'articles#index'
# See how all your routes lay out with "rake routes"
-[28701]% mongodump --version
mongodump version 2.0.3
-[28680]% mongodump -d test -o /tmp/mongobackup/
connected to: 127.0.0.1
DATABASE: test to /tmp/mongobackup/test
test.iwa to /tmp/mongobackup/test/masaki925.bson
1 objects
test.system.indexes to /tmp/mongobackup/test/system.indexes.bson
3 objects
-[28699]% tree /tmp/mongobackup/
/tmp/mongobackup/
└── test
├── masaki925.bson
└── system.indexes.bson
Restore
-[28702]% mongorestore --version
mongorestore version 2.0.3
-[28700]% mongorestore -d test_restore /tmp/mongobackup/test/
connected to: 127.0.0.1
Sat Feb 2 10:57:44 /tmp/mongobackup/test/masaki925.bson
Sat Feb 2 10:57:44 going into namespace [test_restore.masaki925]
1 objects found
Sat Feb 2 10:57:44 /tmp/mongobackup/test/system.indexes.bson
Sat Feb 2 10:57:44 going into namespace [test_restore.system.indexes]
Sat Feb 2 10:57:44 { key: { _id: 1 }, ns: "test_restore.masaki925", name: "_id_" }
1 objects found