Chef教程无法配置MySQL

时间:2018-08-21 13:27:47

标签: chef devops cookbook

我正在尝试遵循Chef教程(参考https://learn.chef.io/modules/create-a-web-app-cookbook/ubuntu/virtualbox/configure-mysql#/)来制作LAMP食谱。

正如教程所建议的,我已经在Windows上安装了厨师dk,最后一个节点是通过流浪汉在Oracle Virtualbox上托管的Ubuntu 14.04。

我在这里使用的厨师的详细信息...

Chef Development Kit Version: 3.1.0
chef-client version: 14.2.0
delivery version: master (6862f27aba89109a9630f0b6c6798efec56b4efe)
berks version: 7.0.4
kitchen version: 1.22.0
inspec version: 2.1.72

我的kitchen.yml是关注者……。

---
driver:
  name: vagrant
  network:
    - ["private_network", {ip: "192.168.34.34"}]

provisioner:
  name: chef_zero
  always_update_cookbooks: true

verifier:
  name: inspec

platforms:
  - name: ubuntu-14.04

suites:
  - name: default
    data_bags_path: test/fixtures/default/data_bags
    run_list:
      - recipe[lamp::default]
    verifier:
      inspec_tests:
        - test/integration/default
    attributes:

我的metadata.rb是关注者……

name 'lamp'
maintainer 'The Authors'
maintainer_email 'you@example.com'
license 'All Rights Reserved'
description 'Installs/Configures lamp'
long_description 'Installs/Configures lamp'
version '0.1.0'
chef_version '>= 12.14' if respond_to?(:chef_version)

issues_url 'https://github.com/learn-chef/lamp/issues' if respond_to?(:issues_url)
source_url 'https://github.com/learn-chef/lamp' if respond_to?(:source_url)
supports 'ubuntu'

depends 'httpd', '~> 0.6'
depends 'mysql', '~> 8.5'
depends 'mysql2_chef_gem', '~> 2.1'
depends 'database', '~> 6.1'

在我的~/.berkshelf/cookbooks中,我可以看到此内容

 apt-7.0.0
 build-essential-8.1.1
 database-6.1.1
 httpd-0.6.2
 inifile_chef_gem-0.1.0
 mariadb-1.5.4
 mingw-2.1.0
 mysql-8.5.1
 mysql2_chef_gem-2.1.0
 openssl-8.5.2
 postgresql-7.1.0
 selinux_policy-2.1.0
 seven_zip-3.0.0
 windows-5.0.0
 yum-5.1.0
 yum-epel-3.2.0
 yum-scl-0.2.0

我的食谱和食谱是按照教程中的说明定义的。...

当我尝试执行kitchen converge(在kitchen create之后)时,我得到了这个...。

-----> Starting Kitchen (v1.22.0)
-----> Converging <default-ubuntu-1404>...
       Preparing files for transfer
       Preparing dna.json
       Resolving cookbook dependencies with Berkshelf 7.0.4...
       Removing non-cookbook files before transfer
       Preparing data_bags
       Preparing validation.pem
       Preparing client.rb
-----> Installing Chef Omnibus (install only if missing)
       Downloading https://omnitruck.chef.io/install.sh to file /tmp/install.sh
       Trying wget...
       Download complete.
       ubuntu 14.04 x86_64
       Getting information for chef stable  for ubuntu...
       downloading https://omnitruck.chef.io/stable/chef/metadata?v=&p=ubuntu&pv=14.04&m=x86_64
         to file /tmp/install.sh.1666/metadata.txt
       trying wget...
       sha1     64645bebefc45191064073a689a90c10a60fa9ae
       sha256   9ae754e889fbcaaef5632c783a09f134c548c7fdc126de3846f2752acc0e3d3c
       url      https://packages.chef.io/files/stable/chef/14.3.37/ubuntu/14.04/chef_14.3.37-1_amd64.deb
       version  14.3.37
       downloaded metadata file looks valid...
       /tmp/omnibus/cache/chef_14.3.37-1_amd64.deb exists
       Comparing checksum with sha256sum...

       WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING

       You are installing an omnibus package without a version pin.  If you are installing
       on production servers via an automated process this is DANGEROUS and you will
       be upgraded without warning on new releases, even to new major releases.
       Letting the version float is only appropriate in desktop, test, development or
       CI/CD environments.

       WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING

       Installing chef
       installing with dpkg...
       Selecting previously unselected package chef.
(Reading database ... 35419 files and directories currently installed.)
       Preparing to unpack .../cache/chef_14.3.37-1_amd64.deb ...
       Unpacking chef (14.3.37-1) ...
       Setting up chef (14.3.37-1) ...
       Thank you for installing Chef!
       Transferring files to <default-ubuntu-1404>
       Starting Chef Client, version 14.3.37
       Creating a new client identity for default-ubuntu-1404 using the validator key.
       resolving cookbooks for run list: ["lamp::default"]
       Synchronizing Cookbooks:
         - lamp (0.1.0)
         - httpd (0.6.2)
         - mysql (8.5.1)
         - mysql2_chef_gem (2.1.0)
         - database (6.1.1)
         - build-essential (8.1.1)
         - postgresql (7.1.0)
         - seven_zip (3.0.0)
         - mariadb (1.5.4)
         - mingw (2.1.0)
         - selinux_policy (2.1.0)
         - apt (7.0.0)
         - yum (5.1.0)
         - yum-epel (3.2.0)
         - yum-scl (0.2.0)
         - openssl (8.5.2)
         - windows (5.0.0)
         - inifile_chef_gem (0.1.0)
       Installing Cookbook Gems:
       Compiling Cookbooks...

       ================================================================================
       Recipe Compile Error in /tmp/kitchen/cache/cookbooks/seven_zip/providers/archive.rb
       ================================================================================

       NameError
       ---------
       uninitialized constant #<Class:0x00000000041e0bc8>::Windows

       Cookbook Trace:
       ---------------
         /tmp/kitchen/cache/cookbooks/seven_zip/providers/archive.rb:25:in `class_from_file'

       Relevant File Content:
       ----------------------
       /tmp/kitchen/cache/cookbooks/seven_zip/providers/archive.rb:

        18:  # limitations under the License.
        19:  #
        20:
        21:  require 'fileutils'
        22:  require 'chef/mixin/shell_out'
        23:
        24:  include Chef::Mixin::ShellOut
        25>> include Windows::Helper
        26:
        27:  def whyrun_supported?
        28:    true
        29:  end
        30:
        31:  action :extract do
        32:    converge_by("Extract #{@new_resource.source} => #{@new_resource.path} (overwrite=#{@new_resource.overwrite})") do
        33:      FileUtils.mkdir_p(@new_resource.path) unless Dir.exist?(@new_resource.path)
        34:      local_source = cached_file(@new_resource.source, @new_resource.checksum)

       System Info:
       ------------
       chef_version=14.3.37
       platform=ubuntu
       platform_version=14.04
       ruby=ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
       program_name=/opt/chef/bin/chef-client
       executable=/opt/chef/bin/chef-client


       Running handlers:
       [2018-08-21T13:10:45+00:00] ERROR: Running exception handlers
       [2018-08-21T13:10:45+00:00] ERROR: Running exception handlers
       Running handlers complete
       [2018-08-21T13:10:45+00:00] ERROR: Exception handlers complete
       [2018-08-21T13:10:45+00:00] ERROR: Exception handlers complete
       Chef Client failed. 0 resources updated in 07 seconds
       [2018-08-21T13:10:45+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
       [2018-08-21T13:10:45+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
       [2018-08-21T13:10:45+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
       [2018-08-21T13:10:45+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
       [2018-08-21T13:10:45+00:00] FATAL: NameError: uninitialized constant #<Class:0x00000000041e0bc8>::Windows
       [2018-08-21T13:10:45+00:00] FATAL: NameError: uninitialized constant #<Class:0x00000000041e0bc8>::Windows
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Converge failed on instance <default-ubuntu-1404>.  Please see .kitchen/logs/default-ubuntu-1404.log for more details
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

关于seven_zip的事情……但是我的目标节点在Ubuntu上!出了点问题,但我不知道在哪里(我是厨师的新手....)

提前谢谢!

0 个答案:

没有答案