検索

第3章 使用法

download PDF
この章では、Red Hat Software Collections 3.1 を再構築して使用し、Red Hat Software Collections を使用するアプリケーションをデプロイするために必要な手順を説明します。

3.1. Red Hat Software Collections の使用

3.1.1. Software Collection からの実行可能ファイルの実行

特定の Software Collection から実行ファイルを実行するには、シェルプロンプトで以下のコマンドを入力します。
scl enable software_collection... 'command...'
または、以下のコマンドを使用します。
scl enable software_collection... -- command...
software_collection を、使用する Software Collections のスペース区切りのリストに置き換え、command を、実行するコマンドに置き換えます。たとえば、perl516 Software Collection から Perl インタープリターで hello.pl という名前が付けられたファイルに保存されている Perl プログラムを実行するには、以下を入力します。
~]$ scl enable rh-perl524 'perl hello.pl'
Hello, World!
この scl ユーティリティーを使用してコマンドを実行すると、同等の Red Hat Enterprise Linux システムの代わりに、選択した Software Collection から実行可能なものを使用して実行できます。Red Hat Software Collections で配布される Software Collections の完全リストは、表1.1「Red Hat Software Collections 3.1 コンポーネント」を参照してください。

3.1.2. デフォルトで Software Collection を使用したシェルセッションの実行

Red Hat Enterprise Linux の同等のものよりも選択した Software Collection の実行可能ファイルで新しいシェルセッションを開始するには、シェルプロンプトで次のように入力します。
scl enable software_collection... bash
software_collection を、使用する Software Collections のスペース区切りリストに置き換えます。例えば、python27rh-postgresql95 Software Collections をデフォルトにして新しいシェルセッションを開始するには、次のように入力します。
~]$ scl enable python27 rh-postgresql95 bash
現行セッションで有効になっている Software Collections のリストは、$X_SCLS 環境変数に保存されます。以下に例を示します。
~]$ echo $X_SCLS
python27 rh-postgresql95
Red Hat Software Collections で配布される Software Collections の完全リストは、表1.1「Red Hat Software Collections 3.1 コンポーネント」を参照してください。

3.1.3. Software Collection からのシステムサービスの実行

システムサービスを含む Software Collections は、対応する init スクリプトを /etc/rc.d/init.d/ ディレクトリーにインストールします。現行のセッションでそのようなサービスを起動するには、シェルプロンプトで root として以下を入力します。
service software_collection-service_name start
software_collection を、Software Collection および service_name を、開始するサービスの名前に置き換えます。システムの起動時にこのサービスが自動的に開始するように設定するには、root で以下のコマンドを入力します。
chkconfig software_collection-service_name on
たとえば、rh-postgresql95 Software Collection から postgresql サービスを、ランレベル 2、3、4、5 で有効にして起動するには、root で以下を入力します。
~]# service rh-postgresql95-postgresql start
Starting rh-postgresql95-postgresql service:                  [  OK  ]
~]# chkconfig rh-postgresql95-postgresql on
Red Hat Enterprise Linux 6 でシステムサービスを管理する方法の詳細については、Red Hat Enterprise Linux 6 Deployment Guideを参照してください。Red Hat Software Collections で配布される Software Collections の完全リストは、表1.1「Red Hat Software Collections 3.1 コンポーネント」を参照してください。

3.2. Software Collection からの手動ページへのアクセス

すべての Software Collection には、このコンポーネントの内容を説明する一般的な man ページが含まれています。各 man ページにはコンポーネントと同じ名前が付いており、/opt/rh ディレクトリーにあります。
Software Collection の man ページを確認するには、以下のコマンドを入力します。
scl enable software_collection 'man software_collection'
software_collection を、特定の Red Hat Software Collections コンポーネントに置き換えます。例えば、rh-mariadb101 のマニュアルページを表示するには、次のように入力します。
~]$ scl enable rh-mariadb101 "man rh-mariadb101"

3.3. Red Hat Software Collections を使用するアプリケーションのデプロイ

通常、以下の 2 つの方法のいずれかを使用して、実稼働環境の Red Hat Software Collections のコンポーネントに依存するアプリケーションをデプロイすることができます。
  • 必要な Software Collections およびパッケージをすべて手動でインストールしてから、アプリケーションをデプロイする、または
  • アプリケーション用の新しい Software Collection を作成し、必要な Software Collections およびその他のパッケージをすべて依存関係として指定する
個々の Red Hat Software Collections コンポーネントを手動でインストールする方法は、「Red Hat Software Collections のインストール」 を参照してください。Red Hat Software Collections の使用方法に関する詳細は、「Red Hat Software Collections の使用」 を参照してください。カスタム Software Collection を作成する方法や、既存のソフトウェアを拡張する方法については、Red Hat Software Collections Packaging Guideを参照してください。

3.4. Red Hat Software Collections コンテナーイメージ

Red Hat Software Collections に基づくコンテナーイメージには、アプリケーション、デーモン、およびデータベースが含まれます。イメージは、Red Hat Enterprise Linux 7 Server および Red Hat Enterprise Linux Atomic Host で実行できます。使用方法は、Using Red Hat Software Collections 3 Container Imagesを参照してください。Red Hat Software Collections バージョン 2.4 以前の Red Hat Software Collections バージョン 2.4 をベースとしたコンテナーイメージの詳細は、Using Red Hat Software Collections 2 Container Images を参照してください。
以下のコンテナーイメージは Red Hat Software Collections 3.1 で利用可能です。
  • rhscl/devtoolset-7-toolchain-rhel7
  • rhscl/devtoolset-7-perftools-rhel7
  • rhscl/httpd-24-rhel7
  • rhscl/mongodb-36-rhel7
  • rhscl/perl-526-rhel7
  • rhscl/php-70-rhel7
  • rhscl/postgresql-10-rhel7
  • rhscl/ruby-25-rhel7
  • rhscl/varnish-5-rhel7
以下のコンテナーイメージは Red Hat Software Collections 3.0 をベースとしています。
  • rhscl/mariadb-102-rhel7
  • rhscl/mongodb-34-rhel7
  • rhscl/nginx-112-rhel7
  • rhscl/nodejs-8-rhel7
  • rhscl/php-71-rhel7
  • rhscl/postgresql-96-rhel7
  • rhscl/python-36-rhel7
以下のコンテナーイメージは、Red Hat Software Collections 2.4 に基づいています。
  • rhscl/devtoolset-6-toolchain-rhel7
  • rhscl/devtoolset-6-perftools-rhel7
  • rhscl/nginx-110-rhel7
  • rhscl/nodejs-6-rhel7
  • rhscl/python-27-rhel7
  • rhscl/ruby-24-rhel7
  • rhscl/ror-50-rhel7
  • rhscl/thermostat-16-agent-rhel7 (EOL)
  • rhscl/thermostat-16-storage-rhel7 (EOL)
以下のコンテナーイメージは、Red Hat Software Collections 2.3 に基づいています。
  • rhscl/mysql-57-rhel7
  • rhscl/perl-524-rhel7
  • rhscl/redis-32-rhel7
  • rhscl/mongodb-32-rhel7
  • rhscl/php-56-rhel7
  • rhscl/python-35-rhel7
  • rhscl/ruby-23-rhel7
以下のコンテナーイメージは、Red Hat Software Collections 2.2 に基づいています。
  • rhscl/devtoolset-4-toolchain-rhel7
  • rhscl/devtoolset-4-perftools-rhel7
  • rhscl/mariadb-101-rhel7
  • rhscl/nginx-18-rhel7
  • rhscl/nodejs-4-rhel7
  • rhscl/postgresql-95-rhel7
  • rhscl/ror-42-rhel7
  • rhscl/thermostat-1-agent-rhel7 (EOL)
  • rhscl/varnish-4-rhel7
以下のコンテナーイメージは、Red Hat Software Collections 2.0 に基づいています。
  • rhscl/mariadb-100-rhel7
  • rhscl/mongodb-26-rhel7
  • rhscl/mysql-56-rhel7
  • rhscl/nginx-16-rhel7 (EOL)
  • rhscl/passenger-40-rhel7
  • rhscl/perl-520-rhel7
  • rhscl/postgresql-94-rhel7
  • rhscl/python-34-rhel7
  • rhscl/ror-41-rhel7
  • rhscl/ruby-22-rhel7
  • rhscl/s2i-base-rhel7
EOL(End of Life) と表示されているイメージはサポート対象外となります。
Red Hat logoGithubRedditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

© 2024 Red Hat, Inc.