官术网_书友最值得收藏!

Creating a domain using rhc

In the Creating OpenShift domains using the web console recipe of Chapter 1, Getting Started with OpenShift, you learned how to create a domain using the web console. In this recipe, you will learn how to create a domain using the rhc command line.

Getting ready

To complete this recipe, you will need to have rhc installed on your machine. Please refer to the Installing the OpenShift rhc command-line client recipe in Chapter 1, Getting Started with OpenShift, for instructions. If you are using OpenShift's free plan, you have to first delete the domain you created in the Creating OpenShift domains using the web console recipe of Chapter 1, Getting Started with OpenShift, before continuing with this recipe. This is required because you cannot have more than one domain with OpenShift's free plan. To delete a domain, run the command shown as follows. This command is explained in the Deleting a domain using rhc recipe in this chapter:

$ rhc delete-domain <domain_name> --force

How to do it…

To create a domain name, open a new command-line terminal and run the following command. Please provide a unique domain name.

$ rhc create-domain --namespace <unique_domain_ame>

Note

If you get the You may not have more than 1 domain error when you run this command, delete the existing domain associated with your account. In the free tier, you cannot create more than one domain.

How it works…

You can use the rhc domain-create or rhc create-domain command to create a new domain name. The only required argument to create a domain is a unique alphanumeric name. Please note that a domain can contain, at most, 16 alphanumeric characters and cannot have spaces or symbols.

The output of the rhc create-domain command is shown as follows:

$ rhc create-domain --namespace osbook
Creating domain 'osbook' ... done
You may now create an application using the 'rhc create-app' command

You can avoid using the --namespace option by typing the following command. The rhc command-line client is intelligent and understands that you are only providing the mandatory argument:

$ rhc domain-create osbook

There's more...

All OpenShift commands have help associated with them. To understand the usage of the rhc create-domain command and all the options available with it, you can use the -h or --help option. We will look at the other options in the later recipes.

$ rhc create-domain --help
Usage: rhc domain-create <namespace>

See also

  • The Creating OpenShift domains using the web console recipe in Chapter 1, Getting Started with OpenShift
  • The Renaming a domain using rhc recipe
  • The Viewing domain details using rhc recipe
  • The Deleting a domain using rhc recipe
主站蜘蛛池模板: 克什克腾旗| 长垣县| 遂川县| 海兴县| 孝义市| 界首市| 怀化市| 大厂| 兰坪| 贺兰县| 古交市| 通化县| 石狮市| 城步| 涞水县| 曲阳县| 西和县| 邓州市| 洞头县| 鄂伦春自治旗| 平阴县| 霍邱县| 博乐市| 东山县| 平山县| 岳池县| 葫芦岛市| 华亭县| 萨嘎县| 宜黄县| 广安市| 板桥市| 宁德市| 崇州市| 蛟河市| 商丘市| 宁陕县| 天津市| 赤壁市| 萨迦县| 渭源县|