Changes between Initial Version and Version 1 of epics/Archiver Appliance インストールメモ


Ignore:
Timestamp:
08/16/18 16:26:57 (7 years ago)
Author:
Shuei Yamada
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • epics/Archiver Appliance インストールメモ

    v1 v1  
     1[[PageOutline]]
     2
     3= はじめに =
     4このドキュメントはJ-PARC加速器向けに[https://slacmshankar.github.io/epicsarchiver_docs/ Archiver Appliance (AA)]をインストールして立ち上げた際の作業メモなので、適宜読み替えて頂きたい。
     5* AAの[https://slacmshankar.github.io/epicsarchiver_docs/installguide.html インストールガイド]を良く読んでおくこと。
     6 * [https://slacmshankar.github.io/epicsarchiver_docs/quickstart.html Quickstart]の方法では、AAを停止するとどのPVをアーカイブしていたのという設定情報が失われてしまう。
     7* AAの[https://slacmshankar.github.io/epicsarchiver_docs/installguide.html インストールガイド]を良く読んでおくこと。
     8 * [https://slacmshankar.github.io/epicsarchiver_docs/quickstart.html Quickstart]の方法では、AAを停止するとどのPVをアーカイブしていたのという設定情報が失われてしまう。
     9* jkjarchiver-ap.mr.jkcontにインストールする
     10 * OS : SL 6.8 / x86_64
     11 * epicsアカウントで作業する
     12 * 作業ディレクトリ: /home/epics/archappl
     13 * AAのインストール先: /opt/archappl
     14 * AAのデータ保存先: /localdata/archappl
     15 * 各種設定ファイル・起動スクリプトは(できるだけ)mercurialでバージョン管理している
     16* インストールの際に、X Window System上での作業が必要
     17* AAインストール後の運用については[[wiki:epics/Archiver Appliance 運用メモ|Archiver Appliance 運用メモ]]を参照のこと
     18
     19= ダウンロード =
     20AAに必要なソフトウェアをあらかじめダウンロードしておく。ここでは/home/epics/archappl/downloadにダウンロードする。
     21
     22== Archiver Appliance ==
     23インストールするのはバイナリの配布物だが、ソースコードに管理用のスクリプトの例が含まれているので一緒にダウンロードしておく。
     24* バイナリ
     25{{{
     26% wget https://github.com/slacmshankar/epicsarchiverap/releases/download/v0.0.1_SNAPSHOT_20-Sept-2016/archappl_v0.0.1_SNAPSHOT_20-September-2016T13-50-17.tar.gz
     27}}}
     28* ソースコード
     29{{{
     30% git clone https://github.com/slacmshankar/epicsarchiverap epicsarchiverap.git
     31}}}
     32
     33== Apache Tomcat ==
     34AAを走らせるにはApache Tomcat 7.0.61以降が必要。[http://tomcat.apache.org/download-80.cgi Apache Tomcat配布元]から8.5.16をダウンロードした。
     35
     36== MySQL ==
     37AAがアーカイブするレコードの情報を記録するのに、MySQL 5.1以降が必要。
     38SL6の配布物からMySQL 5.1.73をrpmでインストールした。
     39{{{
     40# yum install mysql mysql-server mysql-devel
     41}}}
     42
     43* 今回はAAを実行するマシンでMySQLサーバも走らせる
     44* MySQLのテーブルはNFSサーバ上に置く
     45* MySQLサーバはAAとは独立したマシンにした方がよかったかもしれない
     46
     47== MySQL クライアント jar ==
     48mysql-connector-javaを[http://dev.mysql.com/downloads/connector/j/ MySQL本家]からダウンロードする。
     49SL6標準のrpmパッケージは依存するライブラリを多数インストールするのでやめておく。
     50
     51== JDK 1.8 ==
     52制御計算機にはすでにインストールしてあるので省略。
     53
     54== zenity ==
     55制御計算機にはSL標準のrpmパッケージがインストールしてあるので省略。
     56
     57== tar ballの展開 ==
     58{{{
     59% mkdir -p ~/archappl/workspace
     60% cd ~/archappl/workspace
     61% tar xf ../download/archappl_v0.0.1_SNAPSHOT_20-September-2016T13-50-17.tar.gz
     62% tar xf ../download/mysql-connector-java-5.1.40.tar.gz
     63}}}
     64
     65= MySQLのセットアップ =
     66== uid, gid ==
     67mysql:mysqlが27:27になっている(mysqlをインストールする際に作られる?)のを、既存のマシンにあわせて38099:38099にする。
     68mysqlが使うディレクトリのownerも変えておく:
     69{{{
     70# chown 38099:38099 /var/lib/mysql
     71# chown 38099:38099 /var/run/mysql
     72}}}
     73
     74== dbを置くディレクトリ ==
     75dbは/svrdbに置く。NFSサーバがexportしているディレクトリを/svrdbにマウントする。
     76{{{
     77jkjds01.ccr.jkcont:/svrdb    /svrdb    nfs  bg,intr,soft,timeo=10,retrans=15,nfsvers=3 0 0
     78}}}
     79/svrdbを掘ってマウントし、パーミッションを設定する。mysqlの起動スクリプトがroot権限でこのディレクトリに書き込もうとするので、NFSサーバも設定しておく。
     80{{{
     81# mkdir /svrdb
     82# mount /svrdb
     83# mkdir /svrdb/mysql5.1/jkjarchiver-ap
     84# chown 38099:38099 /svrdb/mysql5.1/jkjarchiver-ap
     85}}}
     86
     87== /etc/my.cnf ==
     88MySQLの設定ファイルをリポジトリからコピーして使う。
     89{{{
     90[mysqld]
     91#datadir=/var/lib/mysql
     92#socket=/var/lib/mysql/mysql.sock
     93#user=mysql
     94# Disabling symbolic-links is recommended to prevent assorted security risks
     95#symbolic-links=0
     96
     97#datadir=/localdata/mysql
     98#socket=/localdata/mysql/mysql.sock
     99datadir=/svrdb/mysql5.1/jkjarchiver-ap/
     100socket=/var/lib/mysql/mysql.sock
     101user=mysql
     102symbolic-links=0
     103character-set-server = utf8
     104innodb_flush_log_at_trx_commit = 1
     105
     106[mysqld_safe]
     107log-error=/var/log/mysqld.log
     108pid-file=/var/run/mysqld/mysqld.pid
     109}}}
     110
     111== logrotate ==
     112/etc/logrotate.d/mysqld に手順が書いてある。後回し。
     113
     114== mysqlサーバ自動起動の設定 ==
     115{{{
     116# cd /etc/rd.c/ini.d
     117# /sbin/chkconfig  --level 3 mysqld on
     118# /sbin/chkconfig  --level 4 mysqld on
     119# /sbin/chkconfig  --level 5 mysqld on
     120}}}
     121
     122== MySQLサーバの起動 ==
     123dbが存在しない場合は、MySQLサーバの初回起動時に、スクリプトがdbを作ってくれる。
     124{{{
     125# /etc/rc.d/init.d/mysqld start
     126MySQL データベースを初期化中:  Installing MySQL system tables...
     127
     128Filling help tables...
     129OK
     130
     131To start mysqld at boot time you have to copy
     132support-files/mysql.server to the right place for your system
     133
     134PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
     135To do so, start the server, then issue the following commands:
     136
     137/usr/bin/mysqladmin -u root password 'new-password'
     138/usr/bin/mysqladmin -u root -h jkjarchiver-ap.mr.jkcont password 'new-password'
     139
     140Alternatively you can run:
     141/usr/bin/mysql_secure_installation
     142
     143which will also give you the option of removing the test
     144databases and anonymous user created by default.  This is
     145strongly recommended for production servers.
     146
     147See the manual for more instructions.
     148
     149You can start the MySQL daemon with:
     150cd /usr ; /usr/bin/mysqld_safe &
     151
     152You can test the MySQL daemon with mysql-test-run.pl
     153cd /usr/mysql-test ; perl mysql-test-run.pl
     154
     155Please report any problems with the /usr/bin/mysqlbug script!
     156
     157                                                           [  OK  ]
     158mysqld を起動中:                                           [  OK  ]
     159}}}
     160
     161== /usr/bin/mysql_secure_installation ==
     162MySQLの初期設定を行う。質問をよく読む。Yes/Noの質問には全てYで答える。
     163
     164{{{
     165# /usr/bin/mysql_secure_installation
     166
     167
     168
     169
     170NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
     171      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
     172
     173
     174In order to log into MySQL to secure it, we'll need the current
     175password for the root user.  If you've just installed MySQL, and
     176you haven't set the root password yet, the password will be blank,
     177so you should just press enter here.
     178
     179Enter current password for root (enter for none):
     180OK, successfully used password, moving on...
     181
     182Setting the root password ensures that nobody can log into the MySQL
     183root user without the proper authorisation.
     184
     185Set root password? [Y/n] Y
     186New password:
     187Re-enter new password:
     188Password updated successfully!
     189Reloading privilege tables..
     190 ... Success!
     191
     192
     193By default, a MySQL installation has an anonymous user, allowing anyone
     194to log into MySQL without having to have a user account created for
     195them.  This is intended only for testing, and to make the installation
     196go a bit smoother.  You should remove them before moving into a
     197production environment.
     198
     199Remove anonymous users? [Y/n] y
     200 ... Success!
     201
     202Normally, root should only be allowed to connect from 'localhost'.  This
     203ensures that someone cannot guess at the root password from the network.
     204
     205Disallow root login remotely? [Y/n] y
     206 ... Success!
     207
     208By default, MySQL comes with a database named 'test' that anyone can
     209access.  This is also intended only for testing, and should be removed
     210before moving into a production environment.
     211
     212Remove test database and access to it? [Y/n] y
     213 - Dropping test database...
     214 ... Success!
     215 - Removing privileges on test database...
     216 ... Success!
     217
     218Reloading the privilege tables will ensure that all changes made so far
     219will take effect immediately.
     220
     221Reload privilege tables now? [Y/n] y
     222 ... Success!
     223
     224Cleaning up...
     225
     226
     227
     228All done!  If you've completed all of the above steps, your MySQL
     229installation should now be secure.
     230
     231Thanks for using MySQL!
     232}}}
     233
     234== schemaの作成 ==
     235DB(archappl), ユーザー(archappl)とパスワード(archappl)を作る。
     236
     237{{{
     238% mysql -u root -p
     239Enter password:
     240Welcome to the MySQL monitor.  Commands end with ; or \g.
     241Your MySQL connection id is 14
     242Server version: 5.1.73 Source distribution
     243
     244Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
     245
     246Oracle is a registered trademark of Oracle Corporation and/or its
     247affiliates. Other names may be trademarks of their respective
     248owners.
     249
     250Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
     251
     252mysql> CREATE DATABASE IF NOT EXISTS archappl;
     253Query OK, 1 row affected (0.00 sec)
     254
     255mysql> GRANT ALL PRIVILEGES ON archappl.* TO 'archappl'@'localhost' IDENTIFIED BY 'archappl';
     256Query OK, 0 rows affected (0.00 sec)
     257}}}
     258
     259== テーブルの作成 ==
     260AA用のテーブルはAAのインストールスクリプト(後述)が作ってくれる。
     261
     262= Archiver Applianceのインストール =
     263
     264インストールスクリプトを走せると、
     2651. MySQLのテーブル
     2661. Tomcatのデプロイ
     2671. アプライアンスの設定ファイルの作成
     2681. 起動スクリプトの作成
     269をやってくれる
     270
     271== インストール先のディレクトリ ==
     272AAをインストールするディレクトリ(/opt/archappl)をあらかじめ掘っておく
     273{{{
     274# mkdir -p /opt/archappl
     275}}}
     276
     277== ポリシーファイル ==
     278ポリシーファイルは AAにレコードを登録する際に用いられるファイルで、
     279* LTS/MTS/STSの設定
     280* レコードをサンプルする方法(monitor/scan)とサンプリング時間
     281* 値と一緒に保存するHIGH/HIGH/LOW/LOLO等のフィールド
     282等をPythonのdictionaryとして記述する。
     283
     284インストールスクリプトを走らせる前に、ポリシーファイルを用意しておく。雛形が
     285{{{
     286epicsarchiverap.git/src/sitespecific/tests/classpathfiles/policies.py
     287}}}
     288に用意されている。
     289* インストールスクリプトがポリシーファイルの所在を尋ねてくる。存在しないファイルを指定すると、スクリプトの実行に失敗する
     290* 中身は後で書き換えるので、ここでは気にしない
     291* AAのクラスタを組む場合は、各ノードに同じファイルのコピーを置くか、共有ディレクトリに置いておく
     292制御計算機用のポリシーファイルは
     293{{{
     294/jk/dev/operation_app/jkControl/ArchiverAppliance/deploy/policies.py
     295}}}
     296に置いてある
     297
     298=== LTS/MTS/STS ===
     299* STS ... PARTITION_HOUR
     300* MTS ... PARTITION_DAY&hold=5&gather=1
     301* LTS ... PARTITION_MONTH
     302
     303=== sampling method/sampling period ===
     304* 基本的にはMONITORにする
     305* 25Hzで更新されるLIのPVはSCAN 1.0secにする
     306
     307=== metaFields ===
     308HIHI等のメタフィールドは保存しない。pvPolicyDict\["archiveFields"\]は空のarrayにしておく。
     309
     310== インストールスクリプト ==
     311予めインストール先のディレクトリを作っておく。epicsアカウントで書き込めるようにownerを変更しておく:
     312{{{
     313# mkdir -p /opt/archappl
     314# chown epics.epics /opt/archappl
     315}}}
     316
     317AAを展開したディレクトリにあるインストールスクリプトをepicsアカウントで走らせる。
     318スクリプトを走らせると、ダイアログが開いて
     319* DEPLOY_DIR (tomcatを展開するディレクトリ) → /opt/archappl
     320* apache-tomcat-x.y.z.tar.gz の所在
     321* mysql-connector-java-x.y.z-bin.jar の所在
     322* mysqlサーバに接続するためのmysqlコマンドに渡す引き数 → ここでは--user=archappl --password=archappl --database=archappl
     323* ポリシーファイル(policies.py)の所在
     324を尋ねてくる。
     325{{{
     326% cd ~archappl/workspace
     327% install_scripts/single_machine_install.sh
     328This script runs thru a typical install scenario for a single machine
     329You can use this to create a standard multi-instance (one Tomcat for ear WAR) tomcat deployment in a multi machine cluster by setting the ARCHAPPL_APPLIANCES and the ARCHAPPL_MYIDENTITY
     330For installations in a cluster, please do create a valid appliances.xml and export ARCHAPPL_APPLIANCES and ARCHAPPL_MYIDENTITY
     331...
     332...
     333Setting TOMCAT_HOME to the mgmt webapp in /opt/archappl/mgmt
     334Setting TOMCAT_HOME to /opt/archappl/apache-tomcat-8.5.16
     335Calling deploy release with /opt/archappl/deployRelease.sh /home/epics/archappl/workspace
     336Deploying a new release from /home/epics/archappl/workspace onto /opt/archappl
     337/opt/archappl/mgmt/webapps ~/archappl/workspace
     338~/archappl/workspace
     339/opt/archappl/engine/webapps ~/archappl/workspace
     340~/archappl/workspace
     341/opt/archappl/etl/webapps ~/archappl/workspace
     342~/archappl/workspace
     343/opt/archappl/retrieval/webapps ~/archappl/workspace
     344~/archappl/workspace
     345Done deploying a new release from /home/epics/archappl/workspace onto /opt/archappl
     346Do you have a site specific policies.py file?
     347Where's your site specific policies.py file?
     348Setting ARCHAPPL_POLICIES to /home/epics/archappl/policies.py
     349Done with the installation. Please use /opt/archappl/sampleStartup.sh to start and stop the appliance and /opt/archappl/deployRelease.sh to deploy a new release.
     350}}}
     351
     352== アプライアンスの設定 ==
     353appliances.xmlでノードのidentityと各webappが使うURLを設定する
     354* デフォルトでは/opt/archappl/appliances.xmlが使われる
     355 * 起動スクリプトの環境変数でファイル名を指定する
     356* AAのクラスタを組む場合は、各ノードに同じファイルのコピーを置くか、共有ディレクトリに置いておく
     357
     358{{{
     359<appliances>
     360   <appliance>
     361     <identity>appliance0</identity>
     362     <cluster_inetport>jkjarchiver-ap.mr.jkcont:16670</cluster_inetport>
     363     <mgmt_url>http://jkjarchiver-ap.mr.jkcont:17665/mgmt/bpl</mgmt_url>
     364     <engine_url>http://jkjarchiver-ap.mr.jkcont:17666/engine/bpl</engine_url>
     365     <etl_url>http://jkjarchiver-ap.mr.jkcont:17667/etl/bpl</etl_url>
     366     <retrieval_url>http://localhost:17668/retrieval/bpl</retrieval_url>
     367     <data_retrieval_url>http://jkjarchiver-ap.mr.jkcont:17668/retrieval</data_retrieval_url>
     368   </appliance>
     369 </appliances>
     370}}}
     371
     372
     373== プロパティファイル ==
     374archappl.propertiesでAAの動作を設定する。
     375* デフォルトでは各web appのWEB-INF/classes/archappl.propertiesが使われる
     376 * 例えば: /opt/archappl/engine/webapps/engine/WEB-INF/classes/archappl.properties
     377 * 起動スクリプトの環境変数でファイル名を指定する
     378
     379アーカイブエンジンのバッファがあふれるので、プロパティファイルでマージンを大きめにとることにする:
     380{{{
     381...
     382# Increase buffer capacity adjustment in order to avoid buffer overflow in J-PARC MR.
     383org.epics.archiverappliance.config.PVTypeInfo.sampleBufferCapacityAdjustment = 5.0
     384...
     385}}}
     386
     387サンプリング間隔の補正は無効にしておく:
     388{{{
     389...
     390# J-PARC MR
     391org.epics.archiverappliance.engine.epics.scanJitterFactor=1.00
     392...
     393}}}
     394
     395pbファイルのディレクトリの区切りに使う文字を指定する。とりあえずデフォルトのままにしたが、アンダースコア("_")も含めておいた方がよかったかもしれない。
     396{{{
     397org.epics.archiverappliance.config.ConvertPVNameToKey.siteNameSpaceSeparators = [\\:\\-]
     398}}}
     399
     400== TOMCATの設定 ==
     401=== ${TOMCAT_HOME}/conf/server.xml ===
     402* mgmt webappが使うポートを、8080(tomcatのデフォルト)からappliances.xmlで指定したポート番号に合わせて17665にする。
     403{{{
     404...
     405    <!-- A "Connector" represents an endpoint by which requests are received
     406         and responses are returned. Documentation at :
     407         Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
     408         Java AJP  Connector: /docs/config/ajp.html
     409         APR (HTTP/AJP) Connector: /docs/apr.html
     410         Define a non-SSL HTTP/1.1 Connector on port 8080
     411    -->
     412    <Connector port="17665" protocol="HTTP/1.1"
     413               connectionTimeout="20000"
     414               redirectPort="8443" />
     415
     416...
     417}}}
     418* apache httpdとAJPを使った連携をしない場合は、AJP Connectorの設定をコメントアウトしておく:
     419{{{
     420...
     421    <!--<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />-->
     422...
     423}}}
     424* SHUTDOWNコマンドの使うポートは8005のままにしておく。
     425
     426=== ${TOMCAT_HOME}/lib/log4j.properties ===
     427{{{
     428# Set root logger level and its only appender to A1.
     429log4j.rootLogger=ERROR, A1
     430log4j.logger.config.org.epics.archiverappliance=INFO
     431log4j.logger.org.apache.http=ERROR
     432
     433
     434# A1 is set to be a DailyRollingFileAppender
     435log4j.appender.A1=org.apache.log4j.DailyRollingFileAppender
     436log4j.appender.A1.File=arch.log
     437log4j.appender.A1.DatePattern='.'yyyy-MM-dd
     438
     439
     440# A1 uses PatternLayout.
     441log4j.appender.A1.layout=org.apache.log4j.PatternLayout
     442log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
     443}}}
     444
     445=== ${TOMCAT_HOME}/conf/context.xml にMySQLの設定を追加する ===
     446* 'jdbc/archappl'の設定を追加する:
     447{{{
     448...
     449<Context>
     450
     451    <!-- Default set of monitored resources -->
     452    <WatchedResource>WEB-INF/web.xml</WatchedResource>
     453
     454    <!-- Uncomment this to disable session persistence across Tomcat restarts -->
     455    <!--
     456    <Manager pathname="" />
     457    -->
     458
     459    <!-- Uncomment this to enable Comet connection tacking (provides events
     460         on session expiration as well as webapp lifecycle) -->
     461    <!--
     462    <Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
     463    -->
     464
     465    <Resource   name="jdbc/archappl"
     466                auth="Container"
     467                type="javax.sql.DataSource"
     468                factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
     469                username="archappl"
     470                password="archappl"
     471                testWhileIdle="true"
     472                testOnBorrow="true"
     473                testOnReturn="false"
     474                validationQuery="SELECT 1"
     475                validationInterval="30000"
     476                timeBetweenEvictionRunsMillis="30000"
     477                maxActive="10"
     478                minIdle="2"
     479                maxWait="10000"
     480                initialSize="2"
     481                removeAbandonedTimeout="60"
     482                removeAbandoned="true"
     483                logAbandoned="true"
     484                minEvictableIdleTimeMillis="30000"
     485                jmxEnabled="true"
     486                driverClassName="com.mysql.jdbc.Driver"
     487                url="jdbc:mysql://localhost:3306/archappl"
     488                />
     489</Context>
     490}}}
     491
     492== 起動スクリプトの修正 ==
     493インストールスクリプトがAAの起動スクリプトsampleStartup.shを生成するので、環境に合わせて書き換える。
     494
     495=== アプライアンスの設定 ===
     496{{{
     497export ARCHAPPL_APPLIANCES=/jk/dev/operation_app/jkControl/ArchiverAppliance/deploy/appliances.xml
     498export ARCHAPPL_MYIDENTITY="appliance0"
     499}}}
     500
     501=== EPICSの設定 ===
     502EPICS用の環境変数を設定するshスクリプトをsourceする:
     503{{{
     504source /jk/dev/operation_app/jkControl/ArchiverAppliance/deploy/setEPICSEnv.sh
     505}}}
     506
     507{{{
     508export EPICS_CA_ADDR_LIST=...
     509#export EPICS_CA_AUTO_ADDR_LIST=false
     510#export EPICS_CA_SERVER_PORT=5064
     511#export EPICS_CA_REPEATER_PORT=5065
     512
     513export EPICS_TS_MIN_WEST=-540
     514#export EPICS_CA_MAX_ARRAY_BYTES=6000000
     515export EPICS_CA_MAX_ARRAY_BYTES=65536
     516}}}
     517
     518=== ポリシーファイル ===
     519ポリシーファイルは環境変数で指定する。インストールスクリプトを実行した際に指定したファイルを指しているので、運転用のポリシーファイルを指すように書き換える:
     520{{{
     521export ARCHAPPL_POLICIES=/jk/dev/operation_app/jkControl/ArchiverAppliance/deploy/policies.py
     522}}}
     523
     524=== プロパティファイル ===
     525インストールスクリプトが作るAAの起動スクリプトには何も書かれていないが、プロパティファイルも起動スクリプトから環境変数で指定する:
     526{{{
     527export ARCHAPPL_PROPERTIES_FILENAME=/jk/dev/operation_app/jkControl/ArchiverAppliance/deploy/archappl.properties
     528}}}
     529
     530=== ストレージの設定 ===
     531{{{
     532export ARCHAPPL_SHORT_TERM_FOLDER=/localdata/archappl/sts/ArchiverStore
     533export ARCHAPPL_MEDIUM_TERM_FOLDER=/localdata/archappl/mts/ArchiverStore
     534export ARCHAPPL_LONG_TERM_FOLDER=/localdata/archappl/lts/ArchiverStore
     535}}}
     536
     537== データ保存先の作成 ==
     538起動スクリプトでの設定に合うように、データを保存するディレクトリを作る。epicsアカウントで書き込めるようにownerを変更しておく:
     539{{{
     540# mkdir -p /localdata/archappl/lts
     541# mkdir -p /localdata/archappl/mts
     542# mkdir -p /localdata/archappl/sts
     543# chown epics.epics /localdata/archappl
     544# chown epics.epics /localdata/archappl/lts
     545# chown epics.epics /localdata/archappl/mts
     546# chown epics.epics /localdata/archappl/sts
     547}}}
     548
     549= Apache httpdとの連携 =
     550AAの各web appにポート80番でアクセスできるようにするため、jkjarchiver-apにリバースプロキシを立ち上げる。ここではAJPを使わずに、naiiveなhttpプロキシにする:
     551{{{
     552# yum install httpd24-httpd-tools httpd24-httpd
     553}}}
     554
     555* /opt/rh/httpd24/root/etc/httpd/conf/httpd.confには触らないようにする
     556* ドキュメントのディレクトリにあるファイルをconf.dにコピーして適宜書き換える
     557{{{
     558# cd /opt/rh/httpd24/root/etc/httpd/conf.d
     559# cp /opt/rh/httpd24/root/usr/share/doc/httpd24-httpd-2.4.18/httpd-default.conf 00-default.conf
     560# cp /opt/rh/httpd24/root/usr/share/doc/httpd24-httpd-2.4.18/httpd-mpm.conf 00-mpm.conf
     561}}}
     562
     563== 基本的な設定 ==
     564* conf.d/00-default.cont
     565{{{
     566Timeout 600
     567}}}
     568
     569* conf.d/00-mpm.conf
     570{{{
     571<IfModule mpm_prefork_module>
     572...
     573   MaxConnecitonPerChild 2000
     574</ifModule>
     575}}}
     576
     577== リバースプロキシの設定 ==
     578* conf.d/proxy.conf
     579{{{
     580ProxyRequests Off
     581
     582ProxyPass        /mgmt http://localhost:17665/mgmt
     583ProxyPassReverse /mgmt http://localhost:17665/mgmt
     584
     585ProxyPass        /retrieval http://localhost:17668/retrieval
     586ProxyPassReverse /retrieval http://localhost:17668/retrieval
     587
     588<Proxy *>
     589   Order deny,allow
     590   Allow from all
     591</Proxy>
     592}}}
     593
     594== httpd24の自動起動の設定 ==
     595{{{
     596chkconfig --add httpd24-httpd
     597chkconfig --level 3 httpd24-httpd on
     598chkconfig --level 4 httpd24-httpd on
     599chkconfig --level 5 httpd24-httpd on
     600}}}
     601
     602= AAの起動と確認 =
     603* 自動起動/自動停止させる
     604/etc/rc.d/init.dに起動スクリプトを用意し、マシンの起動時/停止時にepicsアカウントでAAが自動的に起動/停止するようにする。
     605
     606インストールスクリプトが作った起動スクリプトをrcスクリプトに書き換えたものが
     607{{{
     608/jk/dev/operation_app/jkControl/ArchiverAppliance/deploy/sampleStartup.sh
     609}}}
     610に置いてある。/etc/rc.d/init.dにコピーし、chkconfigを使って適切にsymlinkを張る:
     611{{{
     612cp /jk/dev/operation_app/jkControl/ArchiverAppliance/deploy/sampleStartup.sh /etc/rc.d/init.d/archappl
     613/sbin/chkconfig --add archappl
     614chkconfig --level 3 archappl on
     615chkconfig --level 4 archappl on
     616chkconfig --level 5 archappl on
     617}}}
     618* 手動で起動する
     619{{{
     620# /etc/rc.d/init.d/archappl start
     621}}}
     622
     623* webブラウザで管理用web appにアクセスする
     624{{{
     625http://jkjarchiver-ap.mr.jkcont:17665/mgmt
     626}}}
     627* http://jkjarchiver-ap.mr.jkcont:17665/mgmt/ui/index.html にforwardされる
     628* 各web appが起動する前にアクセスすると503が返ってきて"数分待て"と表示されるが、数分では起動しない。気長に待て
     629* 各web appが起動する前にアクセスすると503が返ってきて"数分待て"と表示されるが、数分では起動しない。気長に待て
     630* [[wiki:epics/Archiver Appliance 運用メモ|Archiver Appliance 運用メモ]]に続く
     631
     632= 参考 =
     633* [https://slacmshankar.github.io/epicsarchiver_docs/installguide.html Archiver Appliance Install Guide]
     634* [https://slacmshankar.github.io/epicsarchiver_docs/admin.html Archiver Appliance Administration Guide]
     635* [https://slacmshankar.github.io/epicsarchiver_docs/api/mgmt_scriptables.html Business Process Logics for scripting]
     636* [https://github.com/jeonghanlee/epicsarchiverap-sites Site-specific (ESS) EPICS Archiver Appliance Deployment (for CentOS7)]