gpt4 book ai didi

python - Ambari 服务器设置 : OSError: [Errno 2] No such file or directory

转载 作者:可可西里 更新时间:2023-11-01 15:05:35 26 4
gpt4 key购买 nike

我正在尝试使用本教程在我的 EC2 实例上设置 Hadoop。当我收到此错误时,我正在尝试设置 ambari 服务器:

[root@ip-xxx-xxx-xxx-xxx ec2-user]# ambari-server setup
Using python /usr/bin/python2.6
Setup ambari-server
Checking SELinux...
WARNING: Could not run /usr/sbin/sestatus: OK
Ambari-server daemon is configured to run under user 'root'. Change this setting [y/n] (n)?
Adjusting ambari-server permissions and ownership...
Checking iptables...
Checking JDK...
JCE Policy archive already exists, using /var/lib/ambari-server/resources/jce_policy-6.zip
Completing setup...
Configuring database...
Enter advanced database configuration [y/n] (n)?
Default properties detected. Using built-in database.
Checking PostgreSQL...
Configuring local database...
Connecting to the database. Attempt 1...
Configuring PostgreSQL...
Traceback (most recent call last):
File "/usr/sbin/ambari-server.py", line 4242, in <module>
main()
File "/usr/sbin/ambari-server.py", line 4061, in main
setup(options)
File "/usr/sbin/ambari-server.py", line 2129, in setup
retcode = configure_postgres()
File "/usr/sbin/ambari-server.py", line 863, in configure_postgres
configure_pg_hba_postgres_user()
File "/usr/sbin/ambari-server.py", line 841, in configure_pg_hba_postgres_user
for line in fileinput.input(PG_HBA_CONF_FILE, inplace=1):
File "/usr/lib64/python2.6/fileinput.py", line 253, in next
line = self.readline()
File "/usr/lib64/python2.6/fileinput.py", line 322, in readline
os.rename(self._filename, self._backupfilename)
OSError: [Errno 2] No such file or directory

我查过这个,显然 os.rename 只是重命名一个文件,当这个错误发生时,这是因为我试图重命名的文件不存在。但是我不知道它想要重命名什么文件,并且 readline 函数将 self 作为其参数,因此问题可能不会在函数中出现。我对 Python 了解不多,但由于程序做的太多,我不知道在哪里修复它。

最佳答案

不幸的是,还不能评论问题,所以在这里提出建议:请发布命令输出:

rpm -qa | grep ambari 服务器

cat/etc/*release

另外最好知道哪个 postgres 版本可用

rpm -qa | grep postgres

我猜这与python版本有关,但现在只是猜测......

关于python - Ambari 服务器设置 : OSError: [Errno 2] No such file or directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29742079/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com