*Version
Ubuntu 12.04
$sudo apt-get install numlockx
$sudo vi /etc/lightdm/lightdm.conf
add line
greeter-setup-script=/usr/bin/numlockx on
from
http://askubuntu.com/questions/155679/how-to-enable-numlock-at-boot-time-for-login-screen
2nd answer
greeter-setup-script=/usr/bin/numlockx on
Loaded plugins: fastestmirror
Setting up Update Process
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os&infra=stock error was
14: PYCURL ERROR 7 - "Failed to connect to 2a02:2498:1:3d:5054:ff:fed3:e91a: 네트워크가 접근 불가능합니다"
Error: Cannot find a valid baseurl for repo: base
file_cache_path "/home/vagrant/chef-solo-repo"
cookbook_path "/home/vagrant/chef-solo-repo/cookbooks"
{
"run_list": [ "recipe[basic-packages]", "recipe[hello]" ]
}
$ chef-client -z -c client.rb -j sample1.json
$ yum install chef-server-core-{version}.rpm
설치 후 실행$ chef-server-ctl reconfigure
$ chef-server-ctl user-create (user_id) (first_name) (last_name) (email) (password) --filename pem_filename
조직(organization) 만들기$ chef-server-ctl org-create (org_short_name) (full_organization_name) --association_user user_name (user_id list) --filename org_short_name.pem
## 계정이나 조직을 만들면서 생성한 pem (private key) 파일들은 이후에 필요할 때가 있다$ chef-server-ctl install opscode-manage
$ opscode-manage-ctl reconfigure
$ chef-server-ctl reconfigure
$ chef generate repo (repo폴더명)
$ knife ssl fetch
# Chef
.chef/*.pem
.chef/encrypted_data_bag_secret
# Ruby
.rake_test_cache
$ knife bootstrap node_hostname -x [account] -P [password] --sudo --run-list "recipes"
$ knife cookbook create (요리책이름)
$ knife cookbook test (요리명) [-o (cookbooks 경로)]
$ foodcritic (요리책경로)
$ knife upload cookbooks
$ knife node run_list add (node name) 'recipe[요리명]'
$ knife node run_list remove (node name) 'recipe[요리명]'
전체 수정도 가능$ knife node edit (node name)
$ knife ssh 'name:(node name)' 'sudo chef-client --server https://chef-server [-N (node name)]'
# vi /etc/dhcp/dhclient-eth0.conf
supersede domain-search "MY_DOMAIN";
prepend domain-name-servers IP_OF_LOCAL_NAMED;
적용 및 확인
# service network restart
# cat /etc/resolv.conf
# yum install -y bind bind-utils
# vi /etc/named.conf
//dns서버 ip는 192.168.30.10 네트워크 대역은 192.168.30.x
//사설 대역에서만 사용하기 위한 준비
acl restaurant {
10.0.2.0/24; //virtualbox nat network
192.168.30.0/24; //virtualbox host-only network
};
options {
listen-on port 53 { IP_OF_NAMED; };
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { restaurant; };
recursion yes;
allow-recursion { restaurant; };
allow-transfer { none; };
//먼저 forward dns에 쿼리를 하고 확인이 안되면 사용하겠다는 옵션
forwarders {
10.0.2.3; //virtualbox nat default dns
8.8.8.8;
8.8.4.4;
};
dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
managed-keys-directory "/var/named/dynamic";
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";
};
//domain 내에 ip 설정 파일
zone "MY_DOMAIN" IN {
type master;
file "MY_DOMAIN.zone";
allow-update { none; };
allow-transfer { none; };
};
//ip-domain recursion에 사용할 파일 설정
zone "30.168.192.in-addr.arpa" IN {
type master;
file "30.168.192.re";
allow-update { none; };
allow-transfer { none; };
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
$TTL 86400
@ IN SOA ns1.MY_DOMAIN. root.MY_DOMAIN. (
2015040101 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
; Specify our two nameservers
IN NS ns1.MY_DOMAIN.
IN NS ns1.MY_DOMAIN.
; Resolve nameserver hostnames to IP, replace with your two droplet IP addresses.
ns1 IN A 192.168.30.10
ns2 IN A 192.168.30.10
; Define hostname -> IP pairs which you wish to resolve
@ IN A 192.168.30.10
www IN A 192.168.30.10
chef-server IN A 192.168.30.10
workstation IN A 192.168.30.20
node01 IN A 192.168.30.21
node02 IN A 192.168.30.22
$TTL 86400
@ IN SOA MY_DOMAIN. root.MY_DOMAIN. (
2015040101 ; Serial
1H ; Refresh
1M ; Retry
1W ; Expire
1D ) ; Negative Cache TTL
;
@ IN NS ns1.MY_DOMAIN.
; PTR Records
10 IN PTR chef-server.MY_DOMAIN.
20 IN PTR workstation.MY_DOMAIN.
21 IN PTR node01.MY_DOMAIN.
22 IN PTR node02.MY_DOMAIN.
23 IN PTR node03.MY_DOMAIN.
# yum install -y bind-utils
$ dig -x 192.168.30.10
$ dig chef-server
$ vagrant box add chef/centos-6.5
$ vagrant plugin install vagrant-hostmanager
hosts = {
"chef-server" => { ip: "192.168.30.10", ssh_forward: 11022, mem: 1600 },
"workstation" => { ip: "192.168.30.20", ssh_forward: 12022, mem: 640 },
"node01" => { ip: "192.168.30.21", ssh_forward: 12122, mem: 512 },
"node02" => { ip: "192.168.30.22", ssh_forward: 12222, mem: 512 },
"node03" => { ip: "192.168.30.23", ssh_forward: 12322, mem: 512 }
}
Vagrant.configure(2) do |config|
# Define base image
config.vm.box = "chef/centos-6.5"
config.ssh.insert_key = false
config.ssh.private_key_path = "~\\.vagrant.d\\insecure_private_key"
# Manage /etc/hosts on host and VMs
config.hostmanager.enabled = false
config.hostmanager.manage_host = true
config.hostmanager.include_offline = true
config.hostmanager.ignore_private_ip = false
hosts.each do |name, prop|
config.vm.define name do |machine|
machine.vm.provider :virtualbox do |v|
v.name = name
v.customize ["modifyvm", :id, "--memory", prop[:mem] ]
end
machine.vm.network :private_network, ip: prop[:ip]
machine.vm.network "forwarded_port", guest: 22, host: prop[:ssh_forward], id: "ssh"
machine.vm.hostname = "%s.localdomain" % name
machine.vm.provision :hostmanager
end
end
end