2013年10月11日金曜日

From Installing Xcode To Running Fluentd On Mac

  1. Install Xcode    [download]
  2. Install Command Line Developer Tools
    Xcode: [Preferences] -> [Downloads] -> [Command Line Tools]
  3. Install MacPorts    [installation guide]
  4. Install RVM (Ruby Version Manager)    [installation guide]
    $ \curl -L https://get.rvm.io | bash -s stable --ruby
    
  5. Apply RVM's configuration
    $ . ~/.bash_profile
    
    $ which rvm
    /Users/takahiko/.rvm/bin/rvm
    
  6. Install Ruby 2.0    [ruby homepage]
    # 2.0.0-p247 is the latest version on Oct 11, 2013.
    $ sudo rvm install ruby-2.0.0-p247
    
    $ which ruby
    /Users/takahiko/.rvm/rubies/ruby-2.0.0-p247/bin/ruby
    
    $ ruby --version
    ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.3.0]
    
  7. Update gem
    $ which gem
    /Users/takahiko/.rvm/rubies/ruby-2.0.0-p247/bin/gem
    
    $ gem update --system
    
  8. Install fluentd    [fluentd homepage]
    $ gem install fluentd
    
    $ which fluentd
    /Users/takahiko/.rvm/gems/ruby-2.0.0-p247/bin/fluentd
    
  9. Setup fluentd
    $ fluentd --setup ./fluentd
    
  10. Run fluentd
    $ fluentd -c ./fluentd/fluent.conf
    
  11. Send a log message to fluentd
    $ curl http://localhost:8888/debug.http -F \
      'json={"greeting":"hello"}'
    # You'll see some output in fluentd's console.