Guest User

Untitled

a guest
Mar 13th, 2018
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.74 KB | None | 0 0
  1. dokku --trace mongo:create admin
  2. + export DOKKU_DISTRO
  3. ++ . /etc/os-release
  4. ++ echo ubuntu
  5. + DOKKU_DISTRO=ubuntu
  6. + export DOKKU_IMAGE=gliderlabs/herokuish
  7. + DOKKU_IMAGE=gliderlabs/herokuish
  8. + export DOKKU_LIB_ROOT=/var/lib/dokku
  9. + DOKKU_LIB_ROOT=/var/lib/dokku
  10. + export PLUGIN_PATH=/var/lib/dokku/plugins
  11. + PLUGIN_PATH=/var/lib/dokku/plugins
  12. + export PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
  13. + PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
  14. + export PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
  15. + PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
  16. + export PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
  17. + PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
  18. + export PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
  19. + PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
  20. + export PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
  21. + PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
  22. + export DOKKU_API_VERSION=1
  23. + DOKKU_API_VERSION=1
  24. + export DOKKU_NOT_IMPLEMENTED_EXIT=10
  25. + DOKKU_NOT_IMPLEMENTED_EXIT=10
  26. + export DOKKU_VALID_EXIT=0
  27. + DOKKU_VALID_EXIT=0
  28. + export DOKKU_LOGS_DIR=/var/log/dokku
  29. + DOKKU_LOGS_DIR=/var/log/dokku
  30. + export DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
  31. + DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
  32. + export DOKKU_CONTAINER_LABEL=dokku
  33. + DOKKU_CONTAINER_LABEL=dokku
  34. + export DOKKU_GLOBAL_RUN_ARGS=--label=dokku
  35. + DOKKU_GLOBAL_RUN_ARGS=--label=dokku
  36. + source /var/lib/dokku/core-plugins/available/common/functions
  37. ++ set -eo pipefail
  38. ++ [[ -n 1 ]]
  39. ++ set -x
  40. + parse_args mongo:create admin
  41. + declare 'desc=top-level cli arg parser'
  42. + local next_index=1
  43. + local skip=false
  44. + args=("$@")
  45. + local args
  46. + for arg in '"$@"'
  47. + [[ false == \t\r\u\e ]]
  48. + case "$arg" in
  49. + next_index=2
  50. + for arg in '"$@"'
  51. + [[ false == \t\r\u\e ]]
  52. + case "$arg" in
  53. + next_index=3
  54. + return 0
  55. + args=("$@")
  56. + skip_arg=false
  57. + [[ mongo:create =~ ^--.* ]]
  58. + has_tty
  59. + declare 'desc=return 0 if we have a tty'
  60. ++ /usr/bin/tty
  61. + [[ /dev/pts/0 == \n\o\t\ \a\ \t\t\y ]]
  62. + return 0
  63. ++ id -un
  64. + [[ dokku != \d\o\k\k\u ]]
  65. + [[ mongo:create =~ ^plugin:.* ]]
  66. + [[ mongo:create == \s\s\h\-\k\e\y\s\:\a\d\d ]]
  67. + [[ -n '' ]]
  68. + dokku_auth mongo:create admin
  69. + declare 'desc=calls user-auth plugin trigger'
  70. + export SSH_USER=ubuntu
  71. + SSH_USER=ubuntu
  72. + export SSH_NAME=default
  73. + SSH_NAME=default
  74. + plugn trigger user-auth ubuntu default mongo:create admin
  75. + source /var/lib/dokku/core-plugins/available/common/functions
  76. ++ set -eo pipefail
  77. ++ [[ -n 1 ]]
  78. ++ set -x
  79. + [[ ! -n '' ]]
  80. + source /var/lib/dokku/core-plugins/available/common/functions
  81. ++ set -eo pipefail
  82. ++ [[ -n 1 ]]
  83. ++ set -x
  84. + [[ mongo:create =~ (ssh-keys:add|ssh-keys:remove) ]]
  85. + return 0
  86. + case "$1" in
  87. + execute_dokku_cmd mongo:create admin
  88. + declare 'desc=executes dokku sub-commands'
  89. + local PLUGIN_NAME=mongo:create
  90. + local PLUGIN_CMD=mongo:create
  91. + local implemented=0
  92. + local script
  93. + argv=("$@")
  94. + local argv
  95. + case "$PLUGIN_NAME" in
  96. ++ readlink -f /var/lib/dokku/plugins/enabled/mongo
  97. + [[ /var/lib/dokku/plugins/available/mongo == *core-plugins* ]]
  98. + [[ -x /var/lib/dokku/plugins/enabled/mongo:create/subcommands/default ]]
  99. + [[ -x /var/lib/dokku/plugins/enabled/mongo:create/subcommands/mongo:create ]]
  100. + [[ -x /var/lib/dokku/plugins/enabled/mongo/subcommands/create ]]
  101. + [[ -n create ]]
  102. + /var/lib/dokku/plugins/enabled/mongo/subcommands/create mongo:create admin
  103. + source /var/lib/dokku/plugins/enabled/common/functions
  104. ++ set -eo pipefail
  105. ++ [[ -n 1 ]]
  106. ++ set -x
  107. ++++ dirname /var/lib/dokku/plugins/enabled/mongo/subcommands/create
  108. +++ cd /var/lib/dokku/plugins/enabled/mongo/subcommands
  109. +++ pwd
  110. ++ dirname /var/lib/dokku/plugins/enabled/mongo/subcommands
  111. + source /var/lib/dokku/plugins/enabled/mongo/functions
  112. ++++ dirname /var/lib/dokku/plugins/enabled/mongo/functions
  113. +++ cd /var/lib/dokku/plugins/enabled/mongo
  114. +++ pwd
  115. ++ source /var/lib/dokku/plugins/enabled/mongo/config
  116. +++ export MONGO_IMAGE=mongo
  117. +++ MONGO_IMAGE=mongo
  118. +++ export MONGO_IMAGE_VERSION=3.4.9
  119. +++ MONGO_IMAGE_VERSION=3.4.9
  120. +++ export MONGO_ROOT=/var/lib/dokku/services/mongo
  121. +++ MONGO_ROOT=/var/lib/dokku/services/mongo
  122. +++ export PLUGIN_COMMAND_PREFIX=mongo
  123. +++ PLUGIN_COMMAND_PREFIX=mongo
  124. +++ export PLUGIN_CONFIG_ROOT=/var/lib/dokku/config/mongo
  125. +++ PLUGIN_CONFIG_ROOT=/var/lib/dokku/config/mongo
  126. +++ export PLUGIN_DATA_ROOT=/var/lib/dokku/services/mongo
  127. +++ PLUGIN_DATA_ROOT=/var/lib/dokku/services/mongo
  128. +++ PLUGIN_DATASTORE_PORTS=(27017 27018 27019 28017)
  129. +++ export PLUGIN_DATASTORE_PORTS
  130. +++ export PLUGIN_DATASTORE_WAIT_PORT=27017
  131. +++ PLUGIN_DATASTORE_WAIT_PORT=27017
  132. +++ export PLUGIN_DEFAULT_ALIAS=MONGO
  133. +++ PLUGIN_DEFAULT_ALIAS=MONGO
  134. +++ export PLUGIN_ALT_ALIAS=DOKKU_MONGO
  135. +++ PLUGIN_ALT_ALIAS=DOKKU_MONGO
  136. +++ export PLUGIN_IMAGE=mongo
  137. +++ PLUGIN_IMAGE=mongo
  138. +++ export PLUGIN_IMAGE_VERSION=3.4.9
  139. +++ PLUGIN_IMAGE_VERSION=3.4.9
  140. +++ export PLUGIN_SCHEME=mongodb
  141. +++ PLUGIN_SCHEME=mongodb
  142. +++ export PLUGIN_SERVICE=MongoDB
  143. +++ PLUGIN_SERVICE=MongoDB
  144. +++ export PLUGIN_VARIABLE=MONGO
  145. +++ PLUGIN_VARIABLE=MONGO
  146. +++ export PLUGIN_BASE_PATH=/var/lib/dokku/plugins
  147. +++ PLUGIN_BASE_PATH=/var/lib/dokku/plugins
  148. +++ [[ -n 1 ]]
  149. +++ export PLUGIN_BASE_PATH=/var/lib/dokku/plugins/enabled
  150. +++ PLUGIN_BASE_PATH=/var/lib/dokku/plugins/enabled
  151. +++ [[ -d /var/lib/dokku/services/mongo/* ]]
  152. +++ export 'MONGO_CONFIG_OPTIONS= --storageEngine wiredTiger --auth '
  153. +++ MONGO_CONFIG_OPTIONS=' --storageEngine wiredTiger --auth '
  154. ++ set -eo pipefail
  155. ++ [[ -n 1 ]]
  156. ++ set -x
  157. ++++ dirname /var/lib/dokku/plugins/enabled/mongo/functions
  158. +++ cd /var/lib/dokku/plugins/enabled/mongo
  159. +++ pwd
  160. ++ source /var/lib/dokku/plugins/enabled/mongo/common-functions
  161. +++ set -eo pipefail
  162. +++ [[ -n 1 ]]
  163. +++ set -x
  164. +++ source /var/lib/dokku/plugins/available/config/functions
  165. ++++ set -eo pipefail
  166. ++++ [[ -n 1 ]]
  167. ++++ set -x
  168. ++++ source /var/lib/dokku/core-plugins/available/common/functions
  169. +++++ set -eo pipefail
  170. +++++ [[ -n 1 ]]
  171. +++++ set -x
  172. ++ source /var/lib/dokku/plugins/enabled/common/functions
  173. +++ set -eo pipefail
  174. +++ [[ -n 1 ]]
  175. +++ set -x
  176. ++ source /var/lib/dokku/plugins/available/config/functions
  177. +++ set -eo pipefail
  178. +++ [[ -n 1 ]]
  179. +++ set -x
  180. +++ source /var/lib/dokku/core-plugins/available/common/functions
  181. ++++ set -eo pipefail
  182. ++++ [[ -n 1 ]]
  183. ++++ set -x
  184. ++ [[ -f /var/lib/dokku/plugins/available/docker-options/functions ]]
  185. ++ source /var/lib/dokku/plugins/available/docker-options/functions
  186. +++ set -eo pipefail
  187. +++ [[ -n 1 ]]
  188. +++ set -x
  189. +++ source /var/lib/dokku/core-plugins/available/common/functions
  190. ++++ set -eo pipefail
  191. ++++ [[ -n 1 ]]
  192. ++++ set -x
  193. +++ AVAILABLE_PHASES=(build deploy run)
  194. + service-create-cmd mongo:create admin
  195. + declare 'desc=create a MongoDB service'
  196. + argv=("$@")
  197. + local cmd=mongo:create argv
  198. + [[ mongo:create == \m\o\n\g\o\:\c\r\e\a\t\e ]]
  199. + shift 1
  200. + declare SERVICE=admin CREATE_FLAGS_LIST=
  201. + service_create admin
  202. + local SERVICE=admin
  203. + [[ -z admin ]]
  204. + [[ ! -d /var/lib/dokku/services/mongo/admin ]]
  205. + SERVICE_ROOT=/var/lib/dokku/services/mongo/admin
  206. + LINKS_FILE=/var/lib/dokku/services/mongo/admin/LINKS
  207. + service_parse_args
  208. + declare 'desc=cli arg parser'
  209. + local next_index=1
  210. + local skip=false
  211. + args=("$@")
  212. + local args
  213. + OPTIND=1
  214. + getopts a:c:C:d:i:I:m:p:q:r:u: opt
  215. + shift 0
  216. + docker images
  217. + grep -e '^mongo '
  218. + grep -q ' 3.4.9 '
  219. + mkdir -p /var/lib/dokku/services/mongo/admin
  220. + mkdir -p /var/lib/dokku/services/mongo/admin/data
  221. + mkdir -p /var/lib/dokku/services/mongo/admin/config
  222. + touch /var/lib/dokku/services/mongo/admin/LINKS
  223. ++ openssl rand -hex 16
  224. + ROOTPASSWORD=670662f87b95ed6bd348c77fe6bbb58b
  225. ++ openssl rand -hex 16
  226. + PASSWORD=5e52f182366f87df09bb52f89ec9b211
  227. + [[ -n '' ]]
  228. + [[ -n '' ]]
  229. + echo 670662f87b95ed6bd348c77fe6bbb58b
  230. + echo 5e52f182366f87df09bb52f89ec9b211
  231. + chmod 640 /var/lib/dokku/services/mongo/admin/ROOTPASSWORD /var/lib/dokku/services/mongo/admin/PASSWORD
  232. + [[ -n '' ]]
  233. + [[ -n '' ]]
  234. + echo ''
  235. + [[ -n '' ]]
  236. + [[ -n --storageEngine wiredTiger --auth ]]
  237. + echo ' --storageEngine wiredTiger --auth '
  238. + service_create_container admin
  239. + local SERVICE=admin
  240. + local SERVICE_ROOT=/var/lib/dokku/services/mongo/admin
  241. ++ get_service_name admin
  242. ++ declare 'desc=Retrieves a docker service label'
  243. ++ declare SERVICE=admin
  244. ++ echo dokku.mongo.admin
  245. + local SERVICE_NAME=dokku.mongo.admin
  246. ++ cat /var/lib/dokku/services/mongo/admin/ROOTPASSWORD
  247. + local ROOTPASSWORD=670662f87b95ed6bd348c77fe6bbb58b
  248. ++ cat /var/lib/dokku/services/mongo/admin/PASSWORD
  249. + local PASSWORD=5e52f182366f87df09bb52f89ec9b211
  250. + [[ -f /var/lib/dokku/services/mongo/admin/MONGO_CONFIG_OPTIONS ]]
  251. ++ cat /var/lib/dokku/services/mongo/admin/MONGO_CONFIG_OPTIONS
  252. + export 'MONGO_CONFIG_OPTIONS= --storageEngine wiredTiger --auth '
  253. + MONGO_CONFIG_OPTIONS=' --storageEngine wiredTiger --auth '
  254. ++ docker run --name dokku.mongo.admin -v /var/lib/dokku/services/mongo/admin/data:/data/db --env-file=/var/lib/dokku/services/mongo/admin/ENV -d --restart always --label dokku=service --label dokku.service=mongo mongo:3.4.9 mongod --storageEngine wiredTiger --auth
  255. + ID=1faa4ba8b0994ab235c51215d9da0d6e168218aa4acee7712dd2d667182484c5
  256. + echo 1faa4ba8b0994ab235c51215d9da0d6e168218aa4acee7712dd2d667182484c5
  257. + dokku_log_verbose_quiet 'Waiting for container to be ready'
  258. + declare 'desc=log verbose formatter (with quiet option)'
  259. + [[ -z '' ]]
  260. + echo ' Waiting for container to be ready'
  261. Waiting for container to be ready
  262. + docker run --rm --link dokku.mongo.admin:mongo dokkupaas/wait:0.2 -p 27017
  263. + echo 'db.createUser({user:'\''admin'\'',pwd:'\''670662f87b95ed6bd348c77fe6bbb58b'\'',roles:[{role:'\''userAdminAnyDatabase'\'',db:'\''admin'\''},{role:'\''__system'\'',db:'\''admin'\''},{role:'\''root'\'',db:'\''admin'\''}]})'
  264. + docker exec -i dokku.mongo.admin mongo admin
  265. + echo 'db.createUser({user:'\''admin'\'',pwd:'\''5e52f182366f87df09bb52f89ec9b211'\'',roles:[{role:'\''readWrite'\'',db:'\''admin'\''}]})'
  266. + docker exec -i dokku.mongo.admin mongo -u admin -p 670662f87b95ed6bd348c77fe6bbb58b --authenticationDatabase admin admin
Add Comment
Please, Sign In to add comment