![CLI에 대한 자동 예 응답을 기대합니다.](https://linux55.com/image/128178/CLI%EC%97%90%20%EB%8C%80%ED%95%9C%20%EC%9E%90%EB%8F%99%20%EC%98%88%20%EC%9D%91%EB%8B%B5%EC%9D%84%20%EA%B8%B0%EB%8C%80%ED%95%A9%EB%8B%88%EB%8B%A4..png)
bash 스크립트에서 명령을 실행할 때 ambari-server upgrade
업그레이드 중에 문제가 발생합니다.
이미 Ambari 서버 데이터베이스를 백업했습니다 [y/n] (y)?
yes
그래서 우리는 문제가 발생할 때 전송될 것으로 예상되는 스크립트를 사용하여 해당 프로세스를 자동화 하려고 합니다 .
ambari-server upgrade
기대치를 자동화하는 방법을 제안해주세요
ambari-server upgrade
Using python /usr/bin/python
Upgrading ambari-server
INFO: Upgrade Ambari Server
INFO: Updating Ambari Server properties in ambari.properties
...
WARNING: Can not find ambari.properties.rpmsave file from
previous version, skipping import of settings
INFO: Updating Ambari Server properties in ambari-env.sh ...
INFO: Can not find ambari-env.sh.rpmsave file from previous
version, skipping restore of environment settings. ambari-env.sh may not
include any user customization.
INFO: Fixing database objects owner
Ambari Server configured for Embedded Postgres. Confirm you
have made a backup of the Ambari Server database [y/n] (y)?
INFO: Upgrading database schema
INFO: Return code from schema upgrade command, retcode = 0
INFO: Console output from schema upgrade command:
INFO: {"lzo_enabled":"false"}
INFO: Schema upgrade completedAdjusting ambari-server permissions and ownership...
Ambari Server 'upgrade' completed successfully.
답변1
yes
입력을 스크립트로 파이프할 수 있습니다 .
yes | ambari-server upgrade
그러면 모든 프롬프트에 응답하게 됩니다 y
.