Advertisement
Guest User

Untitled

a guest
Jun 13th, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.42 KB | None | 0 0
  1. mysql2_chef_gem 'default' do
  2.  
  3.  
  4. client_version node[:application][:mysql_master][:version]
  5. action :install
  6. end
  7.  
  8. user 'db_manager' do
  9. action :create
  10. end
  11.  
  12. directory '/mnt/data/mysql' do
  13. owner 'db_manager'
  14. recursive true
  15. action :create
  16. end
  17.  
  18.  
  19. mount '/mnt/data/mysql' do
  20. device '/dev/sdb1'
  21. fstype 'ext4'
  22. end
  23.  
  24.  
  25. data_directory = "/mnt/data/mysql/master"
  26. directory data_directory do
  27. owner 'db_manager'
  28. recursive true
  29. action :create
  30. end
  31.  
  32. mysql_service node[:application][:mysql_master][:service_name] do
  33. run_user 'db_manager'
  34. data_dir data_directory
  35. port node[:application][:mysql_master][:bind_port]
  36. version node[:mysql][:version]
  37. initial_root_password node[:application][:mysql_master][:password]
  38. action [:create, :start]
  39. end
  40.  
  41. ==> default: ================================================================================
  42. ==> default:
  43. ==> default: Error executing action `run` on resource 'bash[master :create initial records]'
  44. ==> default:
  45. ==> default: ================================================================================
  46. ==> default:
  47. ==> default:
  48. ==> default:
  49. ==> default:
  50. ==> default: Mixlib::ShellOut::ShellCommandFailed
  51. ==> default:
  52. ==> default: ------------------------------------
  53. ==> default:
  54. ==> default: Expected process to exit with [0, 1, 2], but received '141'
  55. ==> default:
  56. ==> default:
  57. ==> default: ---- Begin output of "bash" "/tmp/chef-script20160613-7634-ok63tn" ----
  58. ==> default:
  59. ==> default: STDOUT: Installing MySQL system tables...
  60. ==> default: STDERR: 2016-06-13 07:19:29 0 [Note] /usr/sbin/mysqld (mysqld 5.6.30-0ubuntu0.14.04.1) starting as process 19198 ...
  61. ==> default: ---- End output of "bash" "/tmp/chef-script20160613-7634-ok63tn" ----
  62. ==> default: Ran "bash" "/tmp/chef-script20160613-7634-ok63tn" returned 141
  63. ==> default:
  64. ==> default: Resource Declaration:
  65. ==> default: ---------------------
  66. ==> default: # In /tmp/vagrant-chef/d6451ed70ba00b72836a85c4cb3f45a6/cookbooks/mysql/libraries/provider_mysql_service_base.rb
  67. ==> default:
  68. ==> default: 158: bash "#{new_resource.name} :create initial records" do
  69. ==> default: 159: code init_records_script
  70. ==> default: 160: umask '022'
  71. ==> default: 161: returns [0, 1, 2] # facepalm
  72. ==> default: 162: not_if "/usr/bin/test -f #{parsed_data_dir}/mysql/user.frm"
  73. ==> default: 163: action :run
  74. ==> default: 164: end
  75. ==> default: 165: end
  76. ==> default:
  77. ==> default: Compiled Resource:
  78. ==> default: ------------------
  79. ==> default: # Declared in /tmp/vagrant-chef/d6451ed70ba00b72836a85c4cb3f45a6/cookbooks/mysql/libraries/provider_mysql_service_base.rb:158:in `block in <class:MysqlServiceBase>'
  80. ==> default:
  81. ==> default: bash("master :create initial records") do
  82. ==> default: action [:run]
  83. ==> default: retries 0
  84. ==> default: retry_delay 2
  85. ==> default: default_guard_interpreter :default
  86. ==> default: command "master :create initial records"
  87. ==> default: backup 5
  88. ==> default: returns [0, 1, 2]
  89. ==> default: umask "022"
  90. ==> default: code " set -en rm -rf /tmp/mysql-mastern mkdir /tmp/mysql-masternn cat > /tmp/mysql-master/my.sql <<-EOSQLnUPDATE mysql.user SET password=PASSWORD('root') WHERE user = 'root';nDELETE FROM mysql.user WHERE USER LIKE '';nDELETE FROM mysql.user WHERE user = 'root' and host NOT IN ('127.0.0.1', 'localhost');nFLUSH PRIVILEGES;nDELETE FROM mysql.db WHERE db LIKE 'test%';nDROP DATABASE IF EXISTS test ;nEOSQLnn mysql_install_db --defaults-file=/etc/mysql-master/my.cnf --datadir=/mnt/data/mysql/master --explicit_defaults_for_timestampn /usr/sbin/mysqld --defaults-file=/etc/mysql-master/my.cnf --init-file=/tmp/mysql-master/my.sql --explicit_defaults_for_timestamp &nn while [ ! -f /run/mysql-master/mysqld.pid ] ; do sleep 1 ; donen kill `cat /run/mysql-master/mysqld.pid`n while [ -f /run/mysql-master/mysqld.pid ] ; do sleep 1 ; donen rm -rf /tmp/mysql-mastern"
  91. ==> default: interpreter "bash"
  92. ==> default: declared_type :bash
  93. ==> default: cookbook_name :tr_mysql
  94. ==> default: not_if "/usr/bin/test -f /mnt/data/mysql/master/mysql/user.frm"
  95. ==> default: end
  96. ==> default:
  97. ==> default: Platform:
  98. ==> default: ---------
  99. ==> default: x86_64-linux
  100. ==> default:
  101. ==> default: [2016-06-13T07:19:30+00:00] INFO: Running queued delayed notifications before re-raising exception
  102. ==> default:
  103. ==> default:
  104. ==> default:
  105. ==> default: ================================================================================
  106. ==> default:
  107. ==> default: Error executing action `create` on resource 'mysql_service[master]'
  108. ==> default:
  109. ==> default: ================================================================================
  110. ==> default:
  111. ==> default:
  112. ==> default:
  113. ==> default:
  114. ==> default: Mixlib::ShellOut::ShellCommandFailed
  115. ==> default:
  116. ==> default: ------------------------------------
  117. ==> default:
  118. ==> default: bash[master :create initial records] (/tmp/vagrant-chef/d6451ed70ba00b72836a85c4cb3f45a6/cookbooks/mysql/libraries/provider_mysql_service_base.rb line 158) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0, 1, 2], but received '141'
  119. ==> default:
  120. ==> default:
  121. ==> default: ---- Begin output of "bash" "/tmp/chef-script20160613-7634-ok63tn" ----
  122. ==> default:
  123. ==> default:
  124. ==> default: STDOUT: Installing MySQL system tables...
  125. ==> default:
  126. ==> default:
  127. ==> default: STDERR: 2016-06-13 07:19:29 0 [Note] /usr/sbin/mysqld (mysqld 5.6.30-0ubuntu0.14.04.1) starting as process 19198 ...
  128. ==> default:
  129. ==> default: ---- End output of "bash" "/tmp/chef-script20160613-7634-ok63tn" ----
  130. ==> default: Ran "bash" "/tmp/chef-script20160613-7634-ok63tn" returned 141
  131. ==> default:
  132. ==> default: Resource Declaration:
  133. ==> default: ---------------------
  134. ==> default: # In /tmp/vagrant-chef/d6451ed70ba00b72836a85c4cb3f45a6/cookbooks/tr_mysql/recipes/mysql_master.rb
  135. ==> default:
  136. ==> default: 31: mysql_service node[:application][:mysql_master][:service_name] do
  137. ==> default: 32: run_user 'db_manager'
  138. ==> default: 33: data_dir data_directory
  139. ==> default: 34: port node[:application][:mysql_master][:bind_port]
  140. ==> default: 35: version node[:mysql][:version]
  141. ==> default: 36: initial_root_password node[:application][:mysql_master][:password]
  142. ==> default: 37: action [:create, :start]
  143. ==> default: 38: end
  144. ==> default: 39:
  145. ==> default:
  146. ==> default: Compiled Resource:
  147. ==> default: ------------------
  148. ==> default: # Declared in /tmp/vagrant-chef/d6451ed70ba00b72836a85c4cb3f45a6/cookbooks/tr_mysql/recipes/mysql_master.rb:31:in `from_file'
  149. ==> default:
  150. ==> default: mysql_service("master") do
  151. ==> default: action [:create, :start]
  152. ==> default: updated true
  153. ==> default: updated_by_last_action true
  154. ==> default: retries 0
  155. ==> default: retry_delay 2
  156. ==> default: default_guard_interpreter :default
  157. ==> default: declared_type :mysql_service
  158. ==> default: cookbook_name :tr_mysql
  159. ==> default: recipe_name "mysql_master"
  160. ==> default: run_user "db_manager"
  161. ==> default: data_dir "/mnt/data/mysql/master"
  162. ==> default: port "3306"
  163. ==> default: version "5.6"
  164. ==> default: initial_root_password "root"
  165. ==> default: instance "master"
  166. ==> default: run_group "mysql"
  167. ==> default: charset "utf8"
  168. ==> default: end
  169. ==> default:
  170. ==> default: Platform:
  171. ==> default: ---------
  172. ==> default: x86_64-linux
  173. ==> default:
  174. ==> default: [2016-06-13T07:19:30+00:00] INFO: Running queued delayed notifications before re-raising exception
  175. ==> default: [2016-06-13T07:19:30+00:00] INFO: template[/etc/init.d/chef-client] sending restart action to service[chef-client] (delayed)
  176. ==> default: Recipe: chef-client::init_service
  177. ==> default: * service[chef-client] action restart
  178. ==> default: [2016-06-13T07:19:31+00:00] INFO: service[chef-client] restarted
  179. ==> default:
  180. ==> default: - restart service service[chef-client]
  181. ==> default:
  182. ==> default: Running handlers:
  183. ==> default: [2016-06-13T07:19:31+00:00] ERROR: Running exception handlers
  184. ==> default: Running handlers complete
  185. ==> default: [2016-06-13T07:19:31+00:00] ERROR: Exception handlers complete
  186. ==> default: Chef Client failed. 68 resources updated in 05 minutes 15 seconds
  187. ==> default: [2016-06-13T07:19:31+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
  188. ==> default: [2016-06-13T07:19:31+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
  189. ==> default: [2016-06-13T07:19:31+00:00] ERROR: mysql_service[master] (tr_mysql::mysql_master line 31) had an error: Mixlib::ShellOut::ShellCommandFailed: bash[master :create initial records] (/tmp/vagrant-chef/d6451ed70ba00b72836a85c4cb3f45a6/cookbooks/mysql/libraries/provider_mysql_service_base.rb line 158) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0, 1, 2], but received '141'
  190. ==> default: ---- Begin output of "bash" "/tmp/chef-script20160613-7634-ok63tn" ----
  191. ==> default: STDOUT: Installing MySQL system tables...
  192. ==> default: STDERR: 2016-06-13 07:19:29 0 [Note] /usr/sbin/mysqld (mysqld 5.6.30-0ubuntu0.14.04.1) starting as process 19198 ...
  193. ==> default: ---- End output of "bash" "/tmp/chef-script20160613-7634-ok63tn" ----
  194. ==> default: Ran "bash" "/tmp/chef-script20160613-7634-ok63tn" returned 141
  195. ==> default: [2016-06-13T07:19:31+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
  196.  
  197. Generated at 2016-06-13 07:19:31 +0000
  198. Mixlib::ShellOut::ShellCommandFailed: mysql_service[master] (tr_mysql::mysql_master line 31) had an error: Mixlib::ShellOut::ShellCommandFailed: bash[master :create initial records] (/tmp/vagrant-chef/d6451ed70ba00b72836a85c4cb3f45a6/cookbooks/mysql/libraries/provider_mysql_service_base.rb line 158) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0, 1, 2], but received '141'
  199. ---- Begin output of "bash" "/tmp/chef-script20160613-7634-ok63tn" ----
  200. STDOUT: Installing MySQL system tables...
  201. STDERR: 2016-06-13 07:19:29 0 [Note] /usr/sbin/mysqld (mysqld 5.6.30-0ubuntu0.14.04.1) starting as process 19198 ...
  202. ---- End output of "bash" "/tmp/chef-script20160613-7634-ok63tn" ----
  203. Ran "bash" "/tmp/chef-script20160613-7634-ok63tn" returned 141
  204. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/mixlib-shellout-2.2.6/lib/mixlib/shellout.rb:289:in `invalid!'
  205. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/mixlib-shellout-2.2.6/lib/mixlib/shellout.rb:276:in `error!'
  206. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/mixin/shell_out.rb:56:in `shell_out!'
  207. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/provider/execute.rb:62:in `block in action_run'
  208. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/mixin/why_run.rb:52:in `add_action'
  209. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/provider.rb:175:in `converge_by'
  210. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/provider/execute.rb:60:in `action_run'
  211. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/provider/script.rb:63:in `action_run'
  212. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/provider.rb:144:in `run_action'
  213. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/resource.rb:596:in `run_action'
  214. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/runner.rb:69:in `run_action'
  215. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/runner.rb:97:in `block (2 levels) in converge'
  216. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/runner.rb:97:in `each'
  217. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/runner.rb:97:in `block in converge'
  218. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/resource_collection/resource_list.rb:84:in `block in execute_each_resource'
  219. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
  220. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
  221. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
  222. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
  223. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
  224. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/resource_collection/resource_list.rb:82:in `execute_each_resource'
  225. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/runner.rb:96:in `converge'
  226. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/provider.rb:361:in `compile_and_converge_action'
  227. (eval):2:in `action_create'
  228. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/provider.rb:144:in `run_action'
  229. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/resource.rb:596:in `run_action'
  230. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/runner.rb:69:in `run_action'
  231. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/runner.rb:97:in `block (2 levels) in converge'
  232. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/runner.rb:97:in `each'
  233. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/runner.rb:97:in `block in converge'
  234. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/resource_collection/resource_list.rb:84:in `block in execute_each_resource'
  235. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
  236. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
  237. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
  238. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
  239. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
  240. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/resource_collection/resource_list.rb:82:in `execute_each_resource'
  241. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/runner.rb:96:in `converge'
  242. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/client.rb:667:in `block in converge'
  243. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/client.rb:662:in `catch'
  244. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/client.rb:662:in `converge'
  245. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/client.rb:701:in `converge_and_save'
  246. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/client.rb:281:in `run'
  247. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/application.rb:285:in `block in fork_chef_client'
  248. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/application.rb:273:in `fork'
  249. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/application.rb:273:in `fork_chef_client'
  250. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/application.rb:238:in `block in run_chef_client'
  251. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/local_mode.rb:44:in `with_server_connectivity'
  252. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/application.rb:226:in `run_chef_client'
  253. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/application/solo.rb:301:in `block in interval_run_chef_client'
  254. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/application/solo.rb:290:in `loop'
  255. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/application/solo.rb:290:in `interval_run_chef_client'
  256. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/application/solo.rb:269:in `run_application'
  257. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/lib/chef/application.rb:58:in `run'
  258. /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.9.38/bin/chef-solo:25:in `<top (required)>'
  259. /usr/bin/chef-solo:51:in `load'
  260. /usr/bin/chef-solo:51:in `<main>'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement