OSS(Open Source Software)/chef 2014. 4. 10. 11:28

1. RBEL repository 추가

# rpm -Uvh http://rbel.frameos.org/rbel6

http://rbel.frameos.org/rbel6(을)를 복구합니다

경고: /var/tmp/rpm-tmp.pkye1T: Header V4 DSA/SHA1 Signature, key ID f345be74: NOKEY

준비 중...               ########################################### [100%]

   1:rbel6-release          ########################################### [100%]


2. chef-client 설치

# yum install rubygem-chef


3. chef client 설정

# cd /etc/chef

# knife configure client .

WARNING: No knife configuration file found

Creating client configuration

Writing client.rb

Writing validation.pem

위와 같이 knife를 이용해 client.rb와 validation.pem 파일을 만들수 있다.


client.rb 파일을 열어 설정을 수정해 준다.

chef_server_url을 chef server 주소로 수정한다.


chef_server_url   'http://chef-server-address:4000'


4. private key 등록

chef client가 server에 접속하기 위해서는 private key를 등록해야 하는데, server에 만들어져 있는 validation.pem 파일을 client로 복사한다.

# cd /etc/chef

# scp root@chef-server.example.com:/etc/chef/validation.pem .


5. chef-cilent 실행

chef-client를 실행해서 client.pem 파일을 생성해 준다. 그리고 chef server node에 등록이 된다.

# chef-client

[Thu, 10 Apr 2014 10:25:03 +0900] INFO: *** Chef 0.10.6 ***

[Thu, 10 Apr 2014 10:25:04 +0900] INFO: Client key /etc/chef/client.pem is not present - registering

[Thu, 10 Apr 2014 10:25:05 +0900] INFO: HTTP Request Returned 404 Not Found: Cannot load node chef-client

[Thu, 10 Apr 2014 10:25:05 +0900] INFO: Run List is []

[Thu, 10 Apr 2014 10:25:05 +0900] INFO: Run List expands to []

[Thu, 10 Apr 2014 10:25:05 +0900] INFO: Starting Chef Run for chef-client

[Thu, 10 Apr 2014 10:25:05 +0900] INFO: Running start handlers

[Thu, 10 Apr 2014 10:25:05 +0900] INFO: Start handlers complete.

[Thu, 10 Apr 2014 10:25:05 +0900] INFO: Loading cookbooks []

[Thu, 10 Apr 2014 10:25:05 +0900] WARN: Node chef-client has an empty run list.

[Thu, 10 Apr 2014 10:25:05 +0900] INFO: Chef Run complete in 0.310229 seconds

[Thu, 10 Apr 2014 10:25:05 +0900] INFO: Running report handlers

[Thu, 10 Apr 2014 10:25:05 +0900] INFO: Report handlers complete



6. chef server에서 node 정보를 확인한다.

# knife node list

chef-client.example.com


'OSS(Open Source Software) > chef' 카테고리의 다른 글

knife sub commands - client  (0) 2014.04.10
cookbook 생성  (0) 2014.04.10
chef workstation 설정  (0) 2014.04.10
knife 사용  (0) 2014.04.07
chef server 설치  (0) 2014.04.07
posted by 구닥다리 엔지니어
: