(CommandList children: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-z)} {(DQ ($ VSub_Name "$NUM_NODES"))} {(Lit_Other "]")}) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:NUM_NODES) op:Equal rhs:{(3)} spids:[85])] spids: [85] ) ] spids: [-1 82] ) ] spids: [-1 88] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} { (DQ (BracedVarSub token: <VSub_Number 1> suffix_op: (Slice begin: (ArithWord w:{(Lit_Digits 0)}) length: (ArithWord w:{(Lit_Digits 1)}) ) spids: [96 102] ) ) } {(Lit_Other "=")} {(SQ <->)} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [(C {(set)} {(--)} {(mysqld)} {(DQ ($ VSub_At "$@"))})] spids: [-1 114] ) ] spids: [-1 127] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Number "$1"))} {(Lit_Other "=")} {(SQ <mysqld>)} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:DATADIR) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (SimpleCommand words: [{(DQ ($ VSub_At "$@"))} {(--verbose)} {(--help)}] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [168] ) ] ) (C {(awk)} {(SQ <"$1 == \"datadir\" { print $2; exit }">)}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [159 178] ) ) } spids: [157] ) ] spids: [157] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(KW_Bang "!")} {(-d)} {(DQ ($ VSub_Name "$DATADIR") (/mysql))} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-z)} {(DQ ($ VSub_Name "$MYSQL_ROOT_PASSWORD"))} {(-a)} {(-z)} {(DQ ($ VSub_Name "$MYSQL_ALLOW_EMPTY_PASSWORD"))} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [ {(echo)} { (SQ < "error: database is uninitialized and MYSQL_ROOT_PASSWORD not set" > ) } ] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {(2)} spids: [241] ) ] ) (SimpleCommand words: [ {(echo)} {(SQ <" Did you forget to add -e MYSQL_ROOT_PASSWORD=... ?">)} ] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {(2)} spids: [251] ) ] ) (C {(exit)} {(1)}) ] spids: [-1 236] ) ] spids: [-1 264] ) (C {(echo)} {(SQ <"Running mysql_install_db ...">)}) (C {(mysql_install_db)} {(--datadir) (Lit_Other "=") (DQ ($ VSub_Name "$DATADIR"))}) (C {(echo)} {(SQ <"Finished mysql_install_db">)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:tempSqlFile) op: Equal rhs: {(SQ </tmp/mysql-first-time.sql>)} spids: [305] ) ] spids: [305] ) (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(DQ ($ VSub_Name "$tempSqlFile"))} spids: [313] ) (HereDoc op_id: Redir_DLessDash fd: -1 body: { (DQ ("DELETE FROM mysql.user ;\n") ("CREATE USER 'root'@'%' IDENTIFIED BY '") (${ VSub_Name MYSQL_ROOT_PASSWORD) ("' ;\n") ("GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION ;\n") ) } do_expansion: True here_end: EOSQL was_filled: True spids: [319] ) ] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$MYSQL_DATABASE"))} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [ {(echo)} { (DQ ("CREATE DATABASE IF NOT EXISTS ") (EscapedLiteralPart token: <Lit_EscapedChar "\\`"> ) ($ VSub_Name "$MYSQL_DATABASE") (EscapedLiteralPart token:<Lit_EscapedChar "\\`">) (" ;") ) } ] redirects: [ (Redir op_id: Redir_DGreat fd: -1 arg_word: {(DQ ($ VSub_Name "$tempSqlFile"))} spids: [356] ) ] ) ] spids: [-1 343] ) ] spids: [-1 363] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$MYSQL_USER"))} {(-a)} {(DQ ($ VSub_Name "$MYSQL_PASSWORD"))} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [ {(echo)} { (DQ ("CREATE USER '") ($ VSub_Name "$MYSQL_USER") ("'@'%' IDENTIFIED BY '") ($ VSub_Name "$MYSQL_PASSWORD") ("' ;") ) } ] redirects: [ (Redir op_id: Redir_DGreat fd: -1 arg_word: {(DQ ($ VSub_Name "$tempSqlFile"))} spids: [398] ) ] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$MYSQL_DATABASE"))} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [ {(echo)} { (DQ ("GRANT ALL ON ") (EscapedLiteralPart token: <Lit_EscapedChar "\\`"> ) ($ VSub_Name "$MYSQL_DATABASE") (EscapedLiteralPart token:<Lit_EscapedChar "\\`">) (".* TO '") ($ VSub_Name "$MYSQL_USER") ("'@'%' ;") ) } ] redirects: [ (Redir op_id: Redir_DGreat fd: -1 arg_word: {(DQ ($ VSub_Name "$tempSqlFile"))} spids: [433] ) ] ) ] spids: [-1 418] ) ] spids: [-1 440] ) ] spids: [-1 385] ) ] spids: [-1 443] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-n)} {(DQ ($ VSub_Name "$GALERA_CLUSTER"))} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:WSREP_SST_USER) op: Equal rhs: { (BracedVarSub token: <VSub_Name WSREP_SST_USER> suffix_op: (StringUnary op_id: VTest_ColonHyphen arg_word: {(DQ (sst))} ) spids: [472 478] ) } spids: [471] ) ] spids: [471] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-z)} {(DQ ($ VSub_Name "$WSREP_SST_PASSWORD"))} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [ {(echo)} { (SQ < "error: Galera cluster is enabled and WSREP_SST_PASSWORD is not set" > ) } ] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {(2)} spids: [499] ) ] ) (SimpleCommand words: [ {(echo)} { (SQ < " Did you forget to add -e WSREP_SST__PASSWORD=... ?" > ) } ] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {(2)} spids: [509] ) ] ) (C {(exit)} {(1)}) ] spids: [-1 494] ) ] spids: [-1 522] ) (SimpleCommand words: [ {(echo)} { (DQ ("CREATE USER '") (${ VSub_Name WSREP_SST_USER) ("'@'localhost' IDENTIFIED BY '") (${ VSub_Name WSREP_SST_PASSWORD) ("';") ) } ] redirects: [ (Redir op_id: Redir_DGreat fd: -1 arg_word: {(DQ ($ VSub_Name "$tempSqlFile"))} spids: [543] ) ] ) (SimpleCommand words: [ {(echo)} { (DQ ("GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO '") (${ VSub_Name WSREP_SST_USER) ("'@'localhost';") ) } ] redirects: [ (Redir op_id: Redir_DGreat fd: -1 arg_word: {(DQ ($ VSub_Name "$tempSqlFile"))} spids: [560] ) ] ) ] spids: [-1 464] ) ] spids: [-1 567] ) (SimpleCommand words: [{(echo)} {(SQ <"FLUSH PRIVILEGES ;">)}] redirects: [ (Redir op_id: Redir_DGreat fd: -1 arg_word: {(DQ ($ VSub_Name "$tempSqlFile"))} spids: [577] ) ] ) (C {(set)} {(--)} {(DQ ($ VSub_At "$@"))} {(--init-file) (Lit_Other "=") (DQ ($ VSub_Name "$tempSqlFile"))} ) ] spids: [-1 208] ) ] spids: [-1 605] ) (C {(chown)} {(-R)} {(mysql) (Lit_Other ":") (mysql)} {(DQ ($ VSub_Name "$DATADIR"))}) ] spids: [-1 150] ) ] spids: [-1 622] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-n)} {(DQ ($ VSub_Name "$GALERA_CLUSTER"))} {(Lit_Other "]")}) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:WSREP_SST_USER) op: Equal rhs: { (BracedVarSub token: <VSub_Name WSREP_SST_USER> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(DQ (sst))}) spids: [652 658] ) } spids: [651] ) ] spids: [651] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-z)} {(DQ ($ VSub_Name "$WSREP_SST_PASSWORD"))} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [ {(echo)} {(SQ <"error: database is uninitialized and WSREP_SST_PASSWORD not set">)} ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[679])] ) (SimpleCommand words: [{(echo)} {(SQ <" Did you forget to add -e WSREP_SST_PASSWORD=xxx ?">)}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[689])] ) (C {(exit)} {(1)}) ] spids: [-1 674] ) ] spids: [-1 702] ) (C {(sed)} {(-i)} {(-e)} { (DQ ("s|^wsrep_sst_auth=sstuser:changethis|wsrep_sst_auth=") (${ VSub_Name WSREP_SST_USER) (":") (${ VSub_Name WSREP_SST_PASSWORD) ("|") ) } {(/etc/mysql/conf.d/cluster.cnf)} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:WSREP_NODE_ADDRESS) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(ip)} {(addr)} {(show)}) (C {(grep)} {(-E)} {(SQ <"^[ ]*inet">)}) (C {(grep)} {(-m1)} {(global)}) (C {(awk)} {(SQ <"{ print $2 }">)}) (C {(sed)} {(-e)} {(SQ <"s/\\/.*//">)}) ] negated: False ) ] ) left_token: <Left_Backtick "`"> spids: [737 779] ) } spids: [736] ) ] spids: [736] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-n)} {(DQ ($ VSub_Name "$WSREP_NODE_ADDRESS"))} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (C {(sed)} {(-i)} {(-e)} { (DQ ("s|^wsrep_node_address=.*") (Lit_Other "$") ("|wsrep_node_address=") (${ VSub_Name WSREP_NODE_ADDRESS) ("|") ) } {(/etc/mysql/conf.d/cluster.cnf)} ) ] spids: [-1 795] ) ] spids: [-1 817] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-z)} {(DQ ($ VSub_Name "$WSREP_CLUSTER_ADDRESS"))} {(-o)} {(DQ ($ VSub_Name "$WSREP_CLUSTER_ADDRESS"))} {(Lit_Other "=") (Lit_Other "=")} {(DQ ("gcomm://"))} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-z)} {(DQ ($ VSub_Name "$WSREP_CLUSTER_ADDRESS"))} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:WSREP_CLUSTER_ADDRESS) op: Equal rhs: {(DQ ("gcomm://"))} spids: [883] ) ] spids: [883] ) ] spids: [-1 880] ) ] spids: [-1 889] ) (ForEach iter_name: NUM iter_words: [ { (CommandSubPart command_list: (CommandList children: [(C {(seq)} {(1)} {($ VSub_Name "$NUM_NODES")})] ) left_token: <Left_Backtick "`"> spids: [903 909] ) } ] do_arg_iter: False body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:NODE_SERVICE_HOST) op: Equal rhs: {(DQ (PXC_NODE) (${ VSub_Name NUM) (_SERVICE_HOST))} spids: [915] ) ] spids: [915] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-n)} { (DQ (BracedVarSub token: <VSub_Name NODE_SERVICE_HOST> prefix_op: VSub_Bang spids: [938 941] ) ) } {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} { (CommandSubPart command_list: (CommandList children: [ (C {(expr)} {(DQ ($ VSub_Name "$HOSTNAME"))} {(Lit_Other ":")} {(DQ (pxc-node) (${ VSub_Name NUM))} ) ] ) left_token: <Left_CommandSub "$("> spids: [958 973] ) } {(-eq)} {(0)} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {($ VSub_Name "$WSREP_CLUSTER_ADDRESS")} {(KW_Bang "!") (Lit_Other "=")} {(DQ ("gcomm://"))} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:WSREP_CLUSTER_ADDRESS) op: Equal rhs: { (DQ (${ VSub_Name WSREP_CLUSTER_ADDRESS) (",") ) } spids: [1008] ) ] spids: [1008] ) ] spids: [-1 1005] ) ] spids: [-1 1017] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-n)} {(DQ (${ VSub_Name USE_IP))} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:WSREP_CLUSTER_ADDRESS) op: Equal rhs: { (DQ (${ VSub_Name WSREP_CLUSTER_ADDRESS) ) (BracedVarSub token:<VSub_Name NODE_SERVICE_HOST> prefix_op:VSub_Bang spids:[10521055]) } spids: [1046] ) ] spids: [1046] ) ] spids: [-1 1043] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:WSREP_CLUSTER_ADDRESS) op: Equal rhs: { (DQ (${ VSub_Name WSREP_CLUSTER_ADDRESS) (pxc-node) (${ VSub_Name NUM) ) } spids: [1065] ) ] spids: [1065] ) ] spids: [1062 1077] ) ] spids: [-1 982] ) ] spids: [-1 1080] ) ] spids: [-1 947] ) ] spids: [-1 1083] ) ] spids: [912 1086] ) spids: [902 910] ) ] spids: [-1 852] ) ] spids: [-1 1089] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-n)} {(DQ ($ VSub_Name "$WSREP_CLUSTER_ADDRESS"))} {(-a)} {(DQ ($ VSub_Name "$WSREP_CLUSTER_ADDRESS"))} {(KW_Bang "!") (Lit_Other "=")} {(DQ ("gcomm://"))} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (C {(sed)} {(-i)} {(-e)} { (DQ ("s|^wsrep_cluster_address=gcomm://|wsrep_cluster_address=") (${ VSub_Name WSREP_CLUSTER_ADDRESS) ("|") ) } {(/etc/mysql/conf.d/cluster.cnf)} ) ] spids: [-1 1131] ) ] spids: [-1 1151] ) ] spids: [-1 644] ) ] spids: [-1 1153] ) (C {(sed)} {(-i)} {(-e)} { (DQ ("s/^server") (EscapedLiteralPart token:<Lit_EscapedChar "\\-">) ("id=.*") (Lit_Other "$") ("/server-id=") (${ VSub_Name RANDOM) (/) ) } {(/etc/mysql/my.cnf)} ) (C {(exec)} {(DQ ($ VSub_At "$@"))}) ] )