日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

openshift_通过OpenShift超越云炒作

發(fā)布時(shí)間:2023/12/3 编程问答 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 openshift_通过OpenShift超越云炒作 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

openshift

您是否厭倦了為應(yīng)用程序請(qǐng)求新的開(kāi)發(fā)機(jī)器? 您是否為必須為應(yīng)用程序設(shè)置新的測(cè)試環(huán)境感到煩惱? 您是否只想專注于和平開(kāi)發(fā)應(yīng)用程序而不會(huì)一直“沉迷于堆棧”? 我們聽(tīng)到你的聲音。 我們也去過(guò)那里。 不用擔(dān)心,OpenShift就在這里!

在本文中,您將通過(guò)簡(jiǎn)單的步驟逐步了解如何使用OpenShift在云中設(shè)置一臺(tái),兩臺(tái),三臺(tái)而不是五臺(tái)新計(jì)算機(jī)。 您將部署您的應(yīng)用程序以進(jìn)行開(kāi)發(fā),測(cè)試或在數(shù)分鐘之內(nèi)將它們?nèi)嬲故窘o全世界。 沒(méi)有更多的混亂。

我們首先概述什么是OpenShift,它來(lái)自何處以及如何在工作站上獲得客戶端工具設(shè)置。 然后,您將瀏覽客戶端工具,因?yàn)樗m用于OpenShift的入門(mén)級(jí)(稱為Express)。 在幾分鐘之內(nèi),您將回到并專注于您的應(yīng)用程序開(kāi)發(fā),進(jìn)行部署以在OpenShift Express中對(duì)其進(jìn)行測(cè)試。 完成后,您將只丟棄測(cè)試機(jī)器并繼續(xù)前進(jìn)。 掌握了這一點(diǎn)之后,就該使用OpenShift Flex將其提升到一個(gè)新的水平了。 這稍微開(kāi)放了您的選項(xiàng),因此您可以對(duì)可能需要更多火力的復(fù)雜應(yīng)用程序和部署執(zhí)行更多操作。 此后,您將完全有能力在選擇時(shí),需要的地方并立即注意進(jìn)入OpenShift Cloud。 這就是開(kāi)發(fā)應(yīng)該的樣子,沒(méi)有堆棧干擾的開(kāi)發(fā)。
介紹

現(xiàn)在,在IT世界中,有關(guān)云的宣傳大肆宣傳。 對(duì)于IaaS,PaaS和SaaS之類的各個(gè)領(lǐng)域,不乏首字母縮寫(xiě)詞。 OpenShift是Red Hat的平臺(tái)即服務(wù)(PaaS),它為您提供了運(yùn)行應(yīng)用程序的平臺(tái)。 對(duì)于作為開(kāi)發(fā)人員的您來(lái)說(shuō),您想要查看將應(yīng)用程序作為僅提供的服務(wù)放置的環(huán)境。 您無(wú)需理會(huì)該服務(wù)如何由一組組件構(gòu)造,如何配置或在何處運(yùn)行。 您只想利用他們提供的此服務(wù)來(lái)部署,開(kāi)發(fā),測(cè)試和運(yùn)行您的應(yīng)用程序。 在此基本級(jí)別上,OpenShift為您的Java應(yīng)用程序提供了一個(gè)平臺(tái)。

首先,讓我們快速了解一下OpenShift的來(lái)源。 它始于一家名為Makara的公司,該公司位于加利福尼亞的紅木城,提供的解決方案使組織能夠在私有或公共云上部署,管理,監(jiān)視和擴(kuò)展其應(yīng)用程序。 紅帽在2010年11月收購(gòu)了Makara,第二年他們將紅帽技術(shù)合并到一個(gè)名為OpenShift [1]的新項(xiàng)目中。 他們啟動(dòng)了第一個(gè)項(xiàng)目,最初提供兩個(gè)級(jí)別的服務(wù)[2],即稱為Express的共享托管解決方案和稱為Flex的專用托管解決方案。 對(duì)于Java開(kāi)發(fā)人員來(lái)說(shuō),這種技術(shù)融合的有趣之處在于,Red Hat在OpenShift [3]中包含了基于JBoss AS 7的下一代應(yīng)用程序平臺(tái)。 這為您的所有開(kāi)發(fā)需求帶來(lái)了快速的閃電應(yīng)用平臺(tái)。

OpenShift Express

OpenShift網(wǎng)站指出:“ Express是一個(gè)免費(fèi)的基于云的應(yīng)用程序平臺(tái),適用于Java,Perl,PHP,Python和Ruby應(yīng)用程序。 它非常簡(jiǎn)單,您的開(kāi)發(fā)環(huán)境也是您的部署環(huán)境: git push ,“您就在云中。” 這使人們的興趣達(dá)到頂峰,因此請(qǐng)嘗試一下,看看是否可以將我們的Web應(yīng)用程序提升到云端。 為此,我們有我們的jBPM遷移Web應(yīng)用程序[4],在本練習(xí)的其余部分中,我們將使用它作為運(yùn)行示例。

Express入門(mén)在網(wǎng)站上有很好的記錄,可以作為快速入門(mén)[5],一旦您注冊(cè)了Red Hat Cloud(rhcloud)帳戶,便可以開(kāi)始使用。 快速入門(mén)為我們提供了使我們的應(yīng)用程序聯(lián)機(jī)所需的四個(gè)步驟,并從安裝必需的客戶端工具開(kāi)始。 這是針對(duì)Red Hat Enterprise Linux(RHEL),Fedora Linux,通用Linux發(fā)行版,Mac OS X和Windows概述的。 對(duì)于RHEL和Fedora,這是一個(gè)簡(jiǎn)單的軟件包安裝,其余的是基于Ruby的gem安裝,我們將留給讀者將其應(yīng)用于她的系統(tǒng)。

一旦安裝了客戶端工具,就會(huì)有多個(gè)基于rhc- <command>形式的命令。 有可用的在線界面,但是大多數(shù)開(kāi)發(fā)人員更喜歡命令行客戶端工具提供的控件,因此我們將使用它們。 以下是對(duì)可用內(nèi)容的概述,并簡(jiǎn)要介紹了每個(gè)可用內(nèi)容:

  • rhc-create-domain –用于將注冊(cè)的rhcloud用戶綁定到rhcloud中的域。 每個(gè)注冊(cè)的rhcloud用戶最多可以有一個(gè)域。
  • rhc-create-app –用于為給定的rhcloud用戶,給定的開(kāi)發(fā)環(huán)境(Java,Ruby,Python,Perl,PHP)和給定的rhcloud域創(chuàng)建應(yīng)用程序。 對(duì)于給定的域,您最多可以創(chuàng)建五個(gè)應(yīng)用程序。 這將為您的rhcloud實(shí)例生成完整的URI,根據(jù)您選擇的環(huán)境設(shè)置您的rhcloud實(shí)例,默認(rèn)情況下將為您選擇的開(kāi)發(fā)環(huán)境創(chuàng)建本地git項(xiàng)目。
  • rhc-snapshot –用于創(chuàng)建給定rhcloud實(shí)例的本地備份。
  • rhc-ctl-app –用于控制給定的rhcloud應(yīng)用程序。 您可以在此處添加數(shù)據(jù)庫(kù),檢查實(shí)例的狀態(tài),啟動(dòng),停止等。
  • rhc-tail-files –用于連接到rhcloud應(yīng)用程序日志文件并將其轉(zhuǎn)儲(chǔ)到命令外殼中。
  • rhc-user-info –用于查看給定的rhcloud用戶,定義的域和創(chuàng)建的應(yīng)用程序。
  • rhc-chk –用于對(duì)安裝程序進(jìn)行簡(jiǎn)單的配置檢查。

建立您的網(wǎng)域

要開(kāi)始使用演示應(yīng)用程序,我們需要做一些簡(jiǎn)單的事情,以從域開(kāi)始獲取用于托管Java應(yīng)用程序的Express實(shí)例設(shè)置。

# We need to create the domain for Express to start setting up # We need to create the domain for Express to start setting up # our URL with the client tooling using # rhc-create-domain -n domainname -l rhlogin # $ rhc-create-domain --helpUsage: /usr/bin/rhc-create-domain Bind a registered rhcloud user to a domain in rhcloud.NOTE: to change ssh key, please alter your ~/.ssh/libra_id_rsa and~/.ssh/libra_id_rsa.pub key, then re-run with --alter-n|--namespace namespace Namespace for your application(s) (alphanumeric - max 16 chars) (required)-l|--rhlogin rhlogin Red Hat login (RHN or OpenShift login with OpenShift Express access) (required)-p|--password password RHLogin password (optional, will prompt)-a|--alter Alter namespace (will change urls) and/or ssh key-d|--debug Print Debug info-h|--help Show Usage info# So we setup one for our Java application. Note that we already have # setup my ssh keys for OpenShift, if you have not yet done that, # then it will walk you through it. # $ rhc-create-domain -n inthe -l [rhcloud-user] -p [mypassword]OpenShift Express key found at /home/[homedir]/.ssh/libra_id_rsa. Reusing... Contacting https://openshift.redhat.com Creation successfulYou may now create an application. Please make note of your local config file in /home/[homedir]/.openshift/express.conf which has been created and populated for you.

創(chuàng)建你的應(yīng)用

接下來(lái),我們要?jiǎng)?chuàng)建我們的應(yīng)用程序,這意味著我們要告訴OpenShift Express我們需要哪個(gè)堆棧。 這是通過(guò)rhc-create-app客戶端工具完成的。

# Let's take a look at the options available before we setup a Java # instance for our application. # $ rhc-create-app --help Contacting https://openshift.redhat.com to obtain list of cartridges...(please excuse the delay)Usage: /usr/bin/rhc-create-app Create an OpenShift Express app.-a|--app application Application name (alphanumeric - max 16 chars) (required)-t|--type type Type of app to create (perl-5.10, jbossas-7.0, wsgi-3.2, rack-1.1, php-5.3) (required)-l|--rhlogin rhlogin Red Hat login (RHN or OpenShift login with OpenShift Express access) (Default: xxxxxxxxx)-p|--password password RHLogin password (optional, will prompt)-r|--repo path Git Repo path (defaults to ./$app_name)-n|--nogit Only create remote space, don't pull it locally-d|--debug Print Debug info-h|--help Show Usage info# It seems we can choose between several but we want the jboss-as7.0 # stack (called a cartridge). Provide a user, password and location # for the git repo to be created called 'jbpmmigration', see the # documentation for the defaults. Let's watch the magic happen! # $ rhc-create-app -a jbpmmigration -t jbossas-7.0 -l [rhcloud-user] -p [mypassword] -r /home/[homedir]/git-projects/jbpmmigrationFound a bug? Post to the forum and we'll get right on it.IRC: #openshift on freenodeForums: https://www.redhat.com/openshift/forumsAttempting to create remote application space: jbpmmigration Contacting https://openshift.redhat.com API version: 1.1.1 Broker version: 1.1.1RESULT: Successfully created application: jbpmmigrationChecking ~/.ssh/config Contacting https://openshift.redhat.com Found rhcloud.com in ~/.ssh/config... No need to adjust Now your new domain name is being propagated worldwide (this might take a minute)... Pulling new repo down Warning: Permanently added 'jbpmmigration-inthe.rhcloud.com,50.17.167.44' (RSA) to the list of known hosts. Confirming application jbpmmigration is available Attempt # 1 Success! Your application is now published here: http://jbpmmigration-inthe.rhcloud.com/ The remote repository is located here: ssh://1806d6b78bb844d49378874f222f4403@jbpmmigration-inthe.rhcloud.com/~/git/jbpmmigration.git/ To make changes to your application, commit to jbpmmigration/. Then run 'git push' to update your OpenShift Express space .

如果我們查看我給定的回購(gòu)路徑,就會(huì)發(fā)現(xiàn)一個(gè)git-projects / jbpmmigration git存儲(chǔ)庫(kù)。 請(qǐng)注意,如果您決定更改域名,則必須調(diào)整git repository配置文件以反映遠(yuǎn)程存儲(chǔ)庫(kù)的位置,請(qǐng)參見(jiàn)“ ssh:…..”行上方。 該頁(yè)面也已經(jīng)位于 http://jbpmmigration-ishereon.rhcloud.com/ 。 這只是一個(gè)入門(mén)的初始屏幕,因此現(xiàn)在我們繼續(xù)部署現(xiàn)有的jBPM Migration項(xiàng)目。

首先,讓我們看一下git項(xiàng)目中提供的自述文件,該文件對(duì)存儲(chǔ)庫(kù)布局有一些見(jiàn)解。

Repo layout =========== deployments/ - location for built wars (Details below) src/ - maven src structure pom.xml - maven build file .openshift/ - location for openshift specific files .openshift/config/ - location for configuration files such as standalone.xml (used to modify jboss config such as datasources) ../data - For persistent data (also in env var OPENSHIFT_DATA_DIR) .openshift/action_hooks/build - Script that gets run every push, just prior to starting your app

對(duì)于本文,我們將僅檢查部署和src目錄。 您只需放入WAR文件,在項(xiàng)目根目錄中刪除pom.xml文件,它們就會(huì)被自動(dòng)部署。 如果要部署爆炸的WAR文件,則只需添加README文件中概述的名為“ .dodeploy”的文件即可。 對(duì)于實(shí)際的項(xiàng)目開(kāi)發(fā),我們希望通過(guò)普通的src目錄結(jié)構(gòu)推送代碼,也可以通過(guò)使用提供的pom.xml文件來(lái)實(shí)現(xiàn)。 提供的自述文件提供了開(kāi)始使用所需的所有詳細(xì)信息。

我們的演示應(yīng)用程序jbpmmigration還帶有一個(gè)README文件,該文件提供了將項(xiàng)目?jī)?nèi)容添加到我們的新git存儲(chǔ)庫(kù)中的說(shuō)明,因此我們將運(yùn)行這些命令將這些文件拉入我們的本地項(xiàng)目中。

# placing our application into our express git repo. # $ cd jbpmmigration $ git remote add upstream -m master git://github.com/eschabell/openshift-jbpmmigration.git $ git pull -s recursive -X theirs upstream master # now we need to push the content. # $ git push origin[jbpmmigration maven build log output removed] ... remote: [INFO] ------------------------------------------------------------------------ remote: [INFO] BUILD SUCCESS remote: [INFO] ------------------------------------------------------------------------ remote: [INFO] Total time: 3.114s remote: [INFO] Finished at: Mon Nov 14 10:26:57 EST 2011 remote: [INFO] Final Memory: 5M/141M remote: [INFO] ------------------------------------------------------------------------ remote: ~/git/jbpmmigration.git remote: Running .openshift/action_hooks/build remote: Running .openshift/action_hooks/deploy remote: Starting application... remote: Done remote: Running .openshift/action_hooks/post_deploy To ssh://1806d6b78bb844d49378874f222f4403@jbpmmigration-inthe.rhcloud.com/~/git/jbpmmigration.git/ 410a1c9..7ea0003 master -> master

如您所見(jiàn),我們現(xiàn)在將內(nèi)容推送到我們創(chuàng)建的rhcloud實(shí)例,它部署了內(nèi)容并啟動(dòng)了我們的實(shí)例。 現(xiàn)在,我們應(yīng)該可以在http://jbpmmigration-ishereon.rhcloud.com/jbpmmigration_upload-0.4/上在線找到我們的應(yīng)用程序。

然后,最后一步是您已經(jīng)完成了該應(yīng)用程序的工作,并希望將其釋放給新的應(yīng)用程序。 然后,您可以使用rhc-snapshot客戶端工具進(jìn)行備份,然后使用rhc-ctl-app客戶端工具刪除實(shí)例。

# Ready to get rid of our application now. # $ rhc-ctl-app -a jbpmmigration -l eschabell -c destroy Password: ********Contacting https://openshift.redhat.com !!!! WARNING !!!! WARNING !!!! WARNING !!!! You are about to destroy the jbpmmigration application. This is NOT reversible, all remote data for this application will be removed. Do you want to destroy this application (y/n): y Contacting https://openshift.redhat.com API version: 1.1.1 Broker version: 1.1.1 RESULT: Successfully destroyed application: jbpmmigration

如您所見(jiàn),從應(yīng)用程序開(kāi)發(fā)中必須使用的五個(gè)免費(fèi)實(shí)例開(kāi)始非常容易。 您可能會(huì)注意到存在一些限制,無(wú)法使用特定的集成監(jiān)視工具,自動(dòng)縮放功能缺失,并且對(duì)配置的控制受到限制。 對(duì)于那些需要更多訪問(wèn)權(quán)限和功能的用戶,請(qǐng)查看下一步使用OpenShift Flex [6]的步驟。

這就完成了我們對(duì)OpenShift Express項(xiàng)目的游覽,在其中我們?yōu)槟峁┝说却湍膽?yīng)用程序的可能性的一瞥。 創(chuàng)建域,定義您的應(yīng)用程序需求并將您的項(xiàng)目導(dǎo)入提供的git項(xiàng)目非常容易。 將更改推送到新的Express實(shí)例后,您將關(guān)閉并在云中測(cè)試應(yīng)用程序開(kāi)發(fā)。 這是真的。 這很簡(jiǎn)單。 現(xiàn)在走到那里,將您的代碼提升到云炒作之上。

相關(guān)鏈接:

  • OpenShift, https: //openshift.redhat.com。
  • 項(xiàng)目概述OpenShift, https: //openshift.redhat.com/app/platform。
  • 云中的JBoss AS7, http: //www.jboss.org/openshift。
  • jBPM遷移項(xiàng)目Web應(yīng)用程序, https://github.com/eschabell/jbpmmigration_upload 。
  • OpenShift Express快速入門(mén), https: //openshift.redhat.com/app/express#quickstart。
  • OpenShift Flex快速入門(mén), https: //openshift.redhat.com/app/flex#quickstart。
  • 參考:我們的JCG合作伙伴 Eric D. Schabell在中間件,Linux,軟件,自行車(chē)和其他新聞…博客上發(fā)表了OpenShift , 超越Cloud的炒作 。


    翻譯自: https://www.javacodegeeks.com/2012/06/rise-above-cloud-hype-with-openshift.html

    openshift

    總結(jié)

    以上是生活随笔為你收集整理的openshift_通过OpenShift超越云炒作的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

    如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。