4.2.1 DCLIを使用したExadataコンピュート・ノード全体へのPythonのインストール

DCLIを使用してExadataコンピュート・ノード全体にPythonをインストールする手順です。

次のステップでは、Exadata用のPythonのビルドおよびインストールについて説明します。

  1. Python Webサイトにアクセスし、Python 3.9.5のXZ compressed source tarballをダウンロードして解凍します。ダウンロードされたファイル名はPython-3.9.5.tar.xzです

    wget https://www.python.org/ftp/python/3.9.5/Python-3.9.5.tar.xz
    tar xvf Python-3.9.5.tar.xz
  2. OML4Pyには、perl-Env libffi-developensslopenssl-develtk-develxz-develzlib-develbzip2-develreadline-develおよびlibuuid-develの各ライブラリが存在する必要があります。次のコマンドを使用して、これらのライブラリをインストールします。

    dcli -t -g nodes -l root "yum -y install perl-Env libffi-devel openssl openssl-devel tk-devel xz-devel zlib-devel bzip2-devel readline-devel libuuid-devel"
    
  3. 各ノードで、PYTHONHOME環境を設定します。

    dcli -t -g nodes -l oracle "export PYTHONHOME=$ORACLE_HOME/python; export PATH=$ORACLE_HOME/python/bin$PATH; export LD_LIBRARY_PATH=$ORACLE_HOME/python/lib:$LD_LIBRARY_PATH; export PIP_REQUIRE_VIRTUALENV=false"
    dcli -t -g nodes -l oracle "tar xvfz $ORACLE_HOME/Python-3.9.5.tar.xz -C $ORACLE_HOME/python"
    dcli -t -g nodes -l oracle "cd $ORACLE_HOME/python; ./configure --enable-shared --prefix=$ORACLE_HOME/python"
    dcli -t -g nodes -l oracle "cd $ORACLE_HOME/python; make clean; make"
    dcli -t -g nodes -l oracle "cd $ORACLE_HOME/python; make altinstall"
  4. $PYTHONHOME/binディレクトリにシンボリック・リンクを作成します。これをpython3.9実行可能ファイルにリンクする必要があります。これは、次のコマンドを使用して実行できます。

    dcli -t -g nodes -l oracle "cd $PYTHONHOME/bin"
    dcli -t -g nodes -l oracle "ln -s python3.9 python3"
  5. 環境変数PYTHONHOMEを設定してPATHに追加し、環境変数LD_LIBRARY_PATHを設定します。

    dcli -t -g nodes -l oracle "export PYTHONHOME=$ORACLE_HOME/python"
    dcli -t -g nodes -l oracle "export PATH=$PYTHONHOME/bin:$PATH"
    dcli -t -g nodes -l oracle "export LD_LIBRARY_PATH=$PYTHONHOME/lib:$LD_LIBRARY_PATH"
    dcli -t -g nodes -l oracle "export PIP_REQUIRE_VIRTUALENV=false"
  6. これで、コマンドpython3を実行してPythonを起動できます。たとえば、次のようになります。

    dcli -t -g nodes -l oracle "python3"
    exadb01: Python 3.9.5 (default, Feb 10 2022, 14:38:12)         
        [GCC 4.8.5 20150623 (Red Hat 4.8.5-44.0.3)] on linux             
        Type "help", "copyright", "credits" or "license" for more information.
    
    exadb02: Python 3.9.5 (default, Feb 10 2022, 14:38:12)         
        [GCC 4.8.5 20150623 (Red Hat 4.8.5-44.0.3)] on linux  
        Type "help", "copyright", "credits" or "license" for more information.