在 2012-09-12三的 04:53 -0400,Alex Jia写道:
> Hi all,
> As subject, basically, I used contrib/install-autotest-server.sh to
> automatically
> build a autotest server, because the script needs to create an 'autotest'
> account,
> I ran contrib/install-autotest-server.sh as root then got the following error:
>
> <snip>
>
> 15:11:22 INFO | Setting up the database schemas
> 15:11:23 INFO | Re-starting MySQL server
> Job failed. See system logs and 'systemctl status' for details.
> 15:11:23 INFO | Building the web rpc client (may take up to 10 minutes)
> 15:11:26 ERROR| The following clients failed: autotest.TkoClient
> autotest.AfeClient
> autotest.EmbeddedSpreadsheetClient
> autotest.EmbeddedTkoClient
> 15:11:26 INFO | Import the base tests and profilers
> Traceback (most recent call last):
> File "/usr/local/autotest/utils/test_importer.py", line 597, in <module>
> main(sys.argv)
> File "/usr/local/autotest/utils/test_importer.py", line 576, in main
> options.add_experimental)
> File "/usr/local/autotest/utils/test_importer.py", line 81, in update_all
> autotest_dir=autotest_dir)
> File "/usr/local/autotest/utils/test_importer.py", line 225, in
> update_tests_in_db
> path=test.replace(autotest_dir, '').lstrip('/'))[0]
> File "/usr/lib/python2.7/site-packages/django/db/models/manager.py", line
> 135, in get_or_create
> return self.get_query_set().get_or_create(**kwargs)
> File "/usr/lib/python2.7/site-packages/django/db/models/query.py", line
> 378, in get_or_create
> return self.get(**lookup), False
> File "/usr/lib/python2.7/site-packages/django/db/models/query.py", line
> 344, in get
> num = len(clone)
> File "/usr/lib/python2.7/site-packages/django/db/models/query.py", line 82,
> in __len__
> self._result_cache = list(self.iterator())
> File "/usr/lib/python2.7/site-packages/django/db/models/query.py", line
> 273, in iterator
> for row in compiler.results_iter():
> File "/usr/lib/python2.7/site-packages/django/db/models/sql/compiler.py",
> line 680, in results_iter
> for rows in self.execute_sql(MULTI):
> File "/usr/lib/python2.7/site-packages/django/db/models/sql/compiler.py",
> line 734, in execute_sql
> cursor = self.connection.cursor()
> File "/usr/lib/python2.7/site-packages/django/db/backends/__init__.py",
> line 252, in cursor
> cursor = util.CursorWrapper(self._cursor(), self)
> File "/usr/lib/python2.7/site-packages/django/db/backends/mysql/base.py",
> line 322, in _cursor
> self.connection = Database.connect(**kwargs)
> File "/usr/lib64/python2.7/site-packages/MySQLdb/__init__.py", line 81, in
> Connect
> return Connection(*args, **kwargs)
> File "/usr/lib64/python2.7/site-packages/MySQLdb/connections.py", line 187,
> in __init__
> super(Connection, self).__init__(*args, **kwargs2)
> _mysql_exceptions.OperationalError: (2002, "Can't connect to local MySQL
> server through socket '/var/lib/mysql/mysql.sock' (2)")
> 15:11:27 INFO | Restarting web server
> Restarting httpd (via systemctl): [ OK ]
> 15:11:27 INFO | Installing/starting scheduler
> ln -s '/etc/systemd/system/autotestd.service'
> '/etc/systemd/system/multi-user.target.wants/autotestd.service'
> 15:11:28 INFO | autotestd.service - Autotest scheduler Loaded: loaded
> (/etc/systemd/system/autotestd.service; enabled) Active: active (running)
> since Wed, 12 Sep 2012 15:11:28 +0800; 61ms ago Main PID: 13397
> (autotest-schedu) CGroup: name=systemd:/system/autotestd.service └ 13397
> /usr/bin/python -u /usr/local/autotest/scheduler/a...
> 15:11:28 INFO | Finished installing autotest server 0.14.1-559-gb50e at: Wed
> Sep 12 15:11:28 CST 2012
> 15:11:28 INFO | You can access your server on http://10.66.82.148/afe
>
> </snip>
>
>
> WRT above error message, there are 2 questions, the one is mysql error
> "(2002, "Can't connect to local MySQL server
> through socket '/var/lib/mysql/mysql.sock' (2)")"; moreover, the mysql error
> will results in defunct 'autotest-schedu',
> and the other one is "You can access your server on http://10.66.82.148/afe",
> in fact, this link isn't available.
I have faced this problem before.
You need to check your mysql service
maybe you need to reinstall your mysql,
I think you can't find the /etc/init.d/mysqld
Make sure your mysql service can be start
Thanks
Mike
>
> # ps -ef|grep autotest
> autotest 13397 1 0 15:11 ? 00:00:00 /usr/bin/python -u
> /usr/local/autotest/scheduler/autotest-scheduler-watcher
> autotest 16366 1 0 16:07 ? 00:00:00 /bin/mountpoint -q
> /sys/fs/cgroup/systemd
> autotest 16562 13397 1 16:10 ? 00:00:00 [autotest-schedu] <defunct>
> root 16572 1897 0 16:10 pts/2 00:00:00 grep --color=auto autotest
>
> # pstree -p autotest
> autotest-schedu(13397)───autotest-schedu(16803)
>
> mountpoint(16366)
>
> # ps wu -p 13397
> USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
> autotest 13397 0.0 0.0 352292 37124 ? Ss 15:11 0:01
> /usr/bin/python -u /usr/local/autotest/scheduler/autotest-scheduler-watcher
>
>
> Q1: mysql error
> Mysql default don't allow run mysqld as root due to security reason, but the
> script need to create an 'autotest' account
> with root privilege, if you run mysqld as root, you will see this error
> "Security" section of the manual to find out
> how to run mysqld as root!
>
> Notes, Need we to allow run mysqld as root?
>
>
> Q2:
> I think we need to improve script contrib/install-autotest-server.sh, if some
> critical
> errors happened, the programming should exit and raise expected error
> information.
>
>
> Another question is about "server configuration for the KVM test", the
> following link
> points out we should change "serve_packages_from_autoserv: True" to
> "serve_packages_from_autoserv: False"
> in global_config.ini, but it seems the script
> contrib/install-autotest-server.sh hasn't
> do this, if so, when should we change it? after completing git clone?
> manually modify it?
>
> https://github.com/autotest/autotest/wiki/KVMAutotest-GetStartedServer
>
>
> I'm sorry to raise many questions in here, but it indeed confuses me now, any
> advise or
> solution will be welcomed! Thanks in advance.
>
>
_______________________________________________
Autotest-kernel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/autotest-kernel