{"id":2778,"date":"2017-12-09T12:34:55","date_gmt":"2017-12-09T12:34:55","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=2778"},"modified":"2021-02-27T09:15:38","modified_gmt":"2021-02-27T09:15:38","slug":"starting-multiple-instances-of-jboss-from-shell-script","status":"publish","type":"post","link":"https:\/\/www.scmgalaxy.com\/tutorials\/starting-multiple-instances-of-jboss-from-shell-script\/","title":{"rendered":"Starting multiple instances of jboss from shell script"},"content":{"rendered":"<p><strong>tpatil created the topic: Starting multiple instances of jboss from shell script<\/strong><\/p>\n<p>For starting the multiple instances of jboss I have created the following 2 scripts.<\/p>\n<p>Please let me know if anybody has any other suggestions.<\/p>\n<p>JBstartall.sh will call JBstart.sh<\/p>\n<pre class=\"brush: css; title: ; notranslate\" title=\"\">\r\n{code}\r\n##############\r\n#JBstartall.sh\r\n##############\r\n#!\/bin\/sh\r\n\r\ncluster=&quot;node1:192.168.32.45,node2:192.168.32.46&quot;\r\n\r\nfor clust in ${cluster\/\/,\/ };\r\ndo\r\nHOST=`echo $clust |cut -f2 -d:`\r\nNODE=`echo $clust |cut -f1 -d:`\r\necho &quot;Starting jboss $NODE on $HOST .....&quot;\r\n.\/JBstart.sh $NODE $HOST\r\ndone\r\n\r\ndate\r\necho &quot;JBstartall.sh complete&quot;\r\nexit 0\r\n\r\n#####\r\n# EOS\r\n#####\r\n{code}\r\n\r\nand\r\n\r\n{code}\r\n#!\/bin\/sh\r\n### ====================================================================== ###\r\n## ##\r\n## JBoss Startup Script ##\r\n## ARG1 =====&gt;Name of profile ##\r\n## ARG2 =====&gt;Hostname\/IP address of node ##\r\n### ====================================================================== ###\r\n\r\nJBOSSDIR=\/local\/sys\/jboss-eap-5.1\/jboss-as\r\nTARGETDIR=$JBOSSDIR\/server\/$1\r\nBINDHOST=$2\r\nJMXUSER=admin\r\nJMXPASS=admin\r\n\r\necho &quot;Starting jboss...........&quot;\r\n\r\nrm \/tmp\/jboss.$1.start &gt; \/dev\/null\r\n\r\n$JBOSSDIR\/bin\/run.sh -c $1 -b $BINDHOST &gt; \/tmp\/jboss.$1.start 2&gt;&amp;1 &amp;\r\npid=$!\r\n\r\nstarted=false\r\n\r\nfor i in `seq 1 30` ; do\r\nif ps -p $pid &gt; \/dev\/null ; then : ; else\r\nbreak\r\nfi\r\nsleep 2\r\nresult=&quot;`$JBOSSDIR\/bin\/twiddle.sh -s $BINDHOST -u $JMXUSER -p $JMXPASS get &quot;jboss.system:type=Server&quot; Started --noprefix`&quot;\r\nif &#x5B; $? == 0 -a x&quot;$result&quot; == x&quot;true&quot; ] ; then\r\nstarted=true\r\nbreak\r\nfi\r\ndone\r\n\r\nif $started ; then\r\necho $pid &gt;&gt; $TARGETDIR\/log\/jboss.pid\r\necho &quot;.........Sucessfully Started&quot;\r\nexit 0\r\nelif test i = 30 ; then\r\necho &quot;...............Timed Out&quot;\r\nexit 1\r\nelse\r\necho &quot;...............Failed to Start&quot;\r\nexit 1\r\nfi\r\n\r\ndate\r\necho &quot;JBstart.sh complete&quot;\r\nexit 0\r\n\r\n#####\r\n# EOS\r\n#####\r\n{code}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>tpatil created the topic: Starting multiple instances of jboss from shell script For starting the multiple instances of jboss I [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[573],"tags":[586],"class_list":["post-2778","post","type-post","status-publish","format-standard","hentry","category-application-server","tag-jboss"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Starting multiple instances of jboss from shell script - scmGalaxy<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.scmgalaxy.com\/tutorials\/starting-multiple-instances-of-jboss-from-shell-script\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Starting multiple instances of jboss from shell script - scmGalaxy\" \/>\n<meta property=\"og:description\" content=\"tpatil created the topic: Starting multiple instances of jboss from shell script For starting the multiple instances of jboss I [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/starting-multiple-instances-of-jboss-from-shell-script\/\" \/>\n<meta property=\"og:site_name\" content=\"scmGalaxy\" \/>\n<meta property=\"article:published_time\" content=\"2017-12-09T12:34:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-02-27T09:15:38+00:00\" \/>\n<meta name=\"author\" content=\"scmgalaxy K\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"scmgalaxy K\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/starting-multiple-instances-of-jboss-from-shell-script\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/starting-multiple-instances-of-jboss-from-shell-script\\\/\"},\"author\":{\"name\":\"scmgalaxy K\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\"},\"headline\":\"Starting multiple instances of jboss from shell script\",\"datePublished\":\"2017-12-09T12:34:55+00:00\",\"dateModified\":\"2021-02-27T09:15:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/starting-multiple-instances-of-jboss-from-shell-script\\\/\"},\"wordCount\":265,\"commentCount\":0,\"keywords\":[\"jboss\"],\"articleSection\":[\"Application Server\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/starting-multiple-instances-of-jboss-from-shell-script\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/starting-multiple-instances-of-jboss-from-shell-script\\\/\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/starting-multiple-instances-of-jboss-from-shell-script\\\/\",\"name\":\"Starting multiple instances of jboss from shell script - scmGalaxy\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\"},\"datePublished\":\"2017-12-09T12:34:55+00:00\",\"dateModified\":\"2021-02-27T09:15:38+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/starting-multiple-instances-of-jboss-from-shell-script\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/starting-multiple-instances-of-jboss-from-shell-script\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/starting-multiple-instances-of-jboss-from-shell-script\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Starting multiple instances of jboss from shell script\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\",\"name\":\"scmGalaxy\",\"description\":\"A Platform for Software Engineers\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\",\"name\":\"scmgalaxy K\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g\",\"caption\":\"scmgalaxy K\"},\"sameAs\":[\"http:\\\/\\\/www.DevOpsSchool.com\"],\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/author\\\/scmgalaxy\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Starting multiple instances of jboss from shell script - scmGalaxy","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.scmgalaxy.com\/tutorials\/starting-multiple-instances-of-jboss-from-shell-script\/","og_locale":"en_US","og_type":"article","og_title":"Starting multiple instances of jboss from shell script - scmGalaxy","og_description":"tpatil created the topic: Starting multiple instances of jboss from shell script For starting the multiple instances of jboss I [&hellip;]","og_url":"https:\/\/www.scmgalaxy.com\/tutorials\/starting-multiple-instances-of-jboss-from-shell-script\/","og_site_name":"scmGalaxy","article_published_time":"2017-12-09T12:34:55+00:00","article_modified_time":"2021-02-27T09:15:38+00:00","author":"scmgalaxy K","twitter_card":"summary_large_image","twitter_misc":{"Written by":"scmgalaxy K","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/starting-multiple-instances-of-jboss-from-shell-script\/#article","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/starting-multiple-instances-of-jboss-from-shell-script\/"},"author":{"name":"scmgalaxy K","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102"},"headline":"Starting multiple instances of jboss from shell script","datePublished":"2017-12-09T12:34:55+00:00","dateModified":"2021-02-27T09:15:38+00:00","mainEntityOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/starting-multiple-instances-of-jboss-from-shell-script\/"},"wordCount":265,"commentCount":0,"keywords":["jboss"],"articleSection":["Application Server"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.scmgalaxy.com\/tutorials\/starting-multiple-instances-of-jboss-from-shell-script\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/starting-multiple-instances-of-jboss-from-shell-script\/","url":"https:\/\/www.scmgalaxy.com\/tutorials\/starting-multiple-instances-of-jboss-from-shell-script\/","name":"Starting multiple instances of jboss from shell script - scmGalaxy","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website"},"datePublished":"2017-12-09T12:34:55+00:00","dateModified":"2021-02-27T09:15:38+00:00","author":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102"},"breadcrumb":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/starting-multiple-instances-of-jboss-from-shell-script\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.scmgalaxy.com\/tutorials\/starting-multiple-instances-of-jboss-from-shell-script\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/starting-multiple-instances-of-jboss-from-shell-script\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.scmgalaxy.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Starting multiple instances of jboss from shell script"}]},{"@type":"WebSite","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website","url":"https:\/\/www.scmgalaxy.com\/tutorials\/","name":"scmGalaxy","description":"A Platform for Software Engineers","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.scmgalaxy.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102","name":"scmgalaxy K","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g","caption":"scmgalaxy K"},"sameAs":["http:\/\/www.DevOpsSchool.com"],"url":"https:\/\/www.scmgalaxy.com\/tutorials\/author\/scmgalaxy\/"}]}},"_links":{"self":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/2778","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/comments?post=2778"}],"version-history":[{"count":1,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/2778\/revisions"}],"predecessor-version":[{"id":2779,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/2778\/revisions\/2779"}],"wp:attachment":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media?parent=2778"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/categories?post=2778"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/tags?post=2778"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}