KurzonDax / nZEDbetter

An improved usenet indexer
nzedbetter.org
GNU General Public License v3.0
11 stars 4 forks source link

Percona not starting. #69

Open evil666 opened 10 years ago

evil666 commented 10 years ago

After using the Easy Install script it seems Percona is actually not starting. Your documentation says that just incase it does not start use sudo tail -f /var/lib/mysql/mysql-error.log and to look for [Note] /usr/sbin/mysqld: ready for connections.

My log shows the following: 2014-01-30 19:46:38 26053 [Note] /usr/sbin/mysqld: ready for connections. Version: '5.6.15-63.0-log' socket: '/var/lib/mysql/mysql.sock' port: 3306 Percona Server (GPL), Release 63.0

I decided to see if it could be restarted manually and received the following: test@ubuntu:~$ sqlstop

test@ubuntu:~$ sqlstart

I went ahead and restarted the entire project using the Hard Installation method. Percona installed fine, manually restarted fine and ran fine up until I copied and created the my.cnf file. Once this was created based off your recommend settings, Percona would start to act up like the Easy Installation method. Service could not be stopped or started properly. This also prevents phpmyadmin from being installed, think its because the Percona (mysql) is not started.

Please look into this and let me know if I did something wrong or something needs to be changed.

Testing was done on: Vmware on an Alienware Laptop 16 gigs of ram i7. Ubuntu 13.10 up to date via apt.

Really hope you continue on this project cause its quite nice.

KurzonDax commented 10 years ago

Weird. In your first log example, it looks like Percona did actually start:

Version: '5.6.15-63.0-log' socket: '/var/lib/mysql/mysql.sock' port: 3306 Percona Server (GPL), Release 63.0

Most likely the reason it's not stopping or restarting manually has to do with the user that mysqladmin is using. Actually, it's the password that's causing the problem. In your /etc/mysql directory, there should be a file named debian.cnf that we need to grab the right password from. You can view it using:

sudo cat /etc/mysql/debian.cnf | grep password

The output should look something like the following, but the actual password you see will be different. When Pecona gets installed, this password gets randomly generated.

password = bd4SxpSbS2oACIr1
password = bd4SxpSbS2oACIr1

Make note of the password, then enter the following from a command prompt. Obviously you'll need to substitute the password in the line below with the one you obtained from the debian.cnf file above.

mysql -u root -p -e "SET PASSWORD FOR 'debian-sys-maint'@'localhost' = PASSWORD('bd4SxpSbS2oACIr1');"

I'm fairly certain this is a bug in the setup.sh shell script that I need to fix. Just haven't had a lot of time to mess with it. Been mostly focused on trying to get the MusicBrainz integration going.

As an FYI, the current release version (v0.6) of nZEDbetter has several bugs that I've squashed in the next release. Probably the most annoying is that it will create duplicates of the same release file. Hope to have the next version completed in the next couple of weeks, but it's been slow going here lately.

Also, the hard installation instructions are not quite up to date. The shell script from the easy install should get you going though, and is a better way to go since it builds the my.cnf file for you, among other things.

Good luck and let me know if this works for you.

evil666 commented 10 years ago

Running mysql -u root -p -e "SET PASSWORD FOR 'debian-sys-maint'@'localhost' = PASSWORD('bd4SxpSbS2oACIr1');" with the appropriate password from debian.cnf it's asking for a password once I hit enter. Since root is used in the command above I can only assume you have to enter the mysql root account password, which I did. However still when trying to restart service or reboot server.... I still get the same situation as initially reported.

On Thu, Jan 30, 2014 at 9:01 PM, KurzonDax notifications@github.com wrote:

Weird. In your first log example, it looks like Percona did actually start:

Version: '5.6.15-63.0-log' socket: '/var/lib/mysql/mysql.sock' port: 3306 Percona Server (GPL), Release 63.0

Most likely the reason it's not stopping or restarting manually has to do with the user that mysqladmin is using. Actually, it's the password that's causing the problem. In your /etc/mysql directory, there should be a file named debian.cnf that we need to grab the right password from. You can view it using:

sudo cat /etc/mysql/debian.cnf | grep password

The output should look something like the following, but the actual password you see will be different. When Pecona gets installed, this password gets randomly generated.

password = bd4SxpSbS2oACIr1 password = bd4SxpSbS2oACIr1

Make note of the password, then enter the following from a command prompt. Obviously you'll need to substitute the password in the line below with the one you obtained from the debian.cnf file above.

mysql -u root -p -e "SET PASSWORD FOR 'debian-sys-maint'@'localhost' = PASSWORD('bd4SxpSbS2oACIr1');"

I'm fairly certain this is a bug in the setup.sh shell script that I need to fix. Just haven't had a lot of time to mess with it. Been mostly focused on trying to get the MusicBrainz integration going.

As an FYI, the current release version (v0.6) of nZEDbetter has several bugs that I've squashed in the next release. Probably the most annoying is that it will create duplicates of the same release file. Hope to have the next version completed in the next couple of weeks, but it's been slow going here lately.

Also, the hard installation instructions are not quite up to date. The shell script from the easy install should get you going though, and is a better way to go since it builds the my.cnf file for you, among other things.

Good luck and let me know if this works for you.

Reply to this email directly or view it on GitHubhttps://github.com/KurzonDax/nZEDbetter/issues/69#issuecomment-33758093 .

KurzonDax commented 10 years ago

I should have mentioned that the mysql command would prompt for a password. You guessed correctly that it is the mysql (Percona) root password.

When you ran the mysql command from above, did you get any error messages? Specifically anything about it being unable to establish a connection? After you entered your root password, it should have just put you back at a command prompt with no messages at all. If it did, that means Percona is running correctly. I'm sort of wondering if somehow there may be two instances of it though. It's unlikely, but I suppose I could see that happening if you ran the setup.sh script and then tried to do a manual install.

What happens when you do the following? It's going to ask you for a password, which should be your mysql root password

mysqladmin status -u root -p

You should see a response that looks sort of like this:

Uptime: 349128 Threads: 24 Questions: 554026320 Slow queries: 128953 Opens: 12469 Flush tables: 9 Open tables: 681 Queries per second avg: 1586.885

Obviously, yours won't have the same numbers in it that mine does. If you don't get anything like what I've show above, paste a copy of your my.cnf file when you get a minute.

By the way, since you're running in a VM environment, you might consider switching to Xubuntu instead of the normal Ubuntu distro. Of the lighterweight Ubuntu type distributions, Xubunutu is my personal favorite because it doesn't have the bloated Unity desktop that eats up RAM and in a VM environment, CPU time. Any of the lighter ditros should work fine, I've just had really good success with Xubuntu, and it's actually what I run on my main indexing box.

One other question for you, how much RAM are you assigning to the virtual machine?

evil666 commented 10 years ago

Sorry I didn't respond earlier.

"When you ran the mysql command from above, did you get any error messages? Specifically anything about it being unable to establish a connection? After you entered your root password, it should have just put you back at a command prompt with no messages at all." <--- this is correct it just sent me back to command prompt.

This is what i get when i run mysqladmin status -u root -p

test@ubuntu:~$ mysqladmin status -u root -p Enter password: Uptime: 156 Threads: 1 Questions: 2 Slow queries: 0 Opens: 70 Flush tables: 1 Open tables: 63 Queries per second avg: 0.012

I'm currently using Ubuntu Server which has no UI. I have assigned 8 gigs temporarily. I have a total of 16. This was just a test environment before launching it on a rack of mine.

Still service refuses to restart even though I ran that command above that says its running. Its like Ubuntu doesn't know its running.

Also installing phpmyadmin is a complete failure. An error occurred while installing the database: "ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) "

When installing OS I made sure mysql was not installed because your script installs this branch.

evil666 commented 10 years ago

Weird Just install Xubuntu just for the hell of it and I get the same issues. Top and PS AUX show mysql running. Here is my my.cnf generated

[mysql]

CLIENT

port = 3306 socket = /var/lib/mysql/mysql.sock

[mysqladmin] port = 3306 socket = /var/lib/mysql/mysql.sock

[mysqldump] port = 3306 socket = /var/lib/mysql/mysql.sock

[mysqld]

GENERAL

user = mysql default-storage-engine = InnoDB socket = /var/lib/mysql/mysql.sock pid-file = /var/lib/mysql/mysql.pid

MyISAM

key-buffer-size = 1M myisam-recover = FORCE,BACKUP

SAFETY

max-allowed-packet = 16M max-connect-errors = 1000000 innodb = FORCE transaction_isolation = READ-COMMITTED binlog_format = ROW thread_stack = 512K

DATA STORAGE

datadir = /var/lib/mysql/

BINARY LOGGING

log-bin = /var/lib/mysql/mysql-bin expire-logs-days = 3 sync-binlog = 1

CACHES AND LIMITS

tmp-table-size = 24M max-heap-table-size = 24M query-cache-type = 1 query-cache-size = 16M query_cache_limit = 4M max-connections = 90 thread-cache-size = 50 open-files-limit = 65535 table-definition-cache = 1024 table-open-cache = 1024

INNODB

innodb-flush-method = O_DIRECT innodb-log-files-in-group = 2 innodb-log-file-size = 512M innodb-flush-log-at-trx-commit = 2 innodb-file-per-table = 1 innodb-buffer-pool-size = 2G innodb_buffer_pool_instances = 2

LOGGING

log-error = /var/lib/mysql/mysql-error.log log-queries-not-using-indexes = 1 slow-query-log = 1 long_query_time = 5 slow-query-log-file = /var/lib/mysql/mysql-slow.log

Extra Params

join_buffer_size = 16M sort_buffer_size = 16M innodb_lock_wait_timeout = 300 read_rnd_buffer_size = 4M max_prepared_stmt_count = 120000

KurzonDax commented 10 years ago

Hey man, I apologize. I had been promising my son I'd spend some time with him, so I'm just now seeing your replies above.

To be honest, I've done very little testing on the server version of Ubuntu. I'll set up a VM tonight with it and run the install script to see if I can reproduce the problem.

I suspect the issue is actually with just stopping the service, which can also be done with

mysqladmin -u root -p shutdown

If the mysqld process is running already, then attempting to start it again will fail via sudo service mysql start (which is what sqlstart is an alias for). It seems to me I might have run in to this once before, but I can't remember beyond the debian-sys-maint password being wrong what would have caused it.

Let me mess around with it some tonight and see what I can come up with.

KurzonDax commented 10 years ago

Oh damn!!! I can't believe I didn't think of this earlier. Here's the issue:

The base my.cnf file that is used to create the final my.cnf in your /etc/mysql directory began as a generic file generated by Percona's online configuration wizard on their web site. What's semi-strange about that wizard is that it asserts that the socket file should be at /var/lib/mysql/mysql.sock

By default, however, the debian.cnf file which get's used when you run "service mysql stop" points to /var/run/mysqld/mysqld.sock. So basically, when you try to stop the service, it's looking for the socket file in the wrong place, and therefore failing.

The fix is easy: You can manually edit the /etc/mysql/debian.cnf file:

sudo nano /etc/mysql/debian.cnf

and change BOTH lines that start with 'socket=' to the following:

socket = /var/lib/mysql/mysql.sock

I will fix the setup script so this doesn't happen in the future. I also caught a couple of other issues with the setup that occurs when running on a server distro. Someone else had mentioned them to me, but I had forgotten to go back and look to see what was happening. I'll try to get those fixed tonight as well.

evil666 commented 10 years ago

I haven't work on this for a while. Went ahead and installed Ubuntu Desktops and Xubuntu Desktops for testing purposes. Checked out the debian.cnf and the socket is correct "socket = /var/lib/mysql/mysql.sock". Everything starts properly. However going through the wizard I receive the following error: ERROR! Unable to connect to database server. Please be sure that you have the correct information for the host name, socket, and/or port. SQL Error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)

I typed the same password that was used during install.

Attempted to install phpmyadmin to verify that mysql is running properly. Received the following: An error occurred while installing the database: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

evil666 commented 10 years ago

Fresh install with nothing on it but using this script.

image

I'm thinking this is a vmware issue. Ill install on physical device later on tonight. If it is ill delete my posts.

theman480 commented 10 years ago

Its not a vmware issue. I tested on a fresh ubuntu desktop 13.10 and fresh server 13.10 and i have the same error. (ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2))

evil666 commented 10 years ago

Yeah fresh install of Ubuntu Desktop 13.10, updated on a rack server and still getting the same error. FML

KurzonDax commented 10 years ago

EDIT: Fixed a typo in a path.

First, all, let me sincerely apologize for the delays in getting back to you. I have had to unexpectedly spend the last two months traveling every week for work, so I have had practically no time to spend on this project. Unfortunately, it's not looking like the travel is going to ease in the immediate future, but I hope to be back working on nZEDbetter again as soon as possible.

@theman480 Although the error message is similar, to the one @evil666 is getting, it's not exactly the same. In your case, it is looking for the socket to be at '/var/run/mysqld/mysqld.sock'. That is the default that MySQL uses when nothing is specified. If the setup script was used to install everything initially, the correct path of the socket should be /var/lib//mysql/mysql.sock

There are a couple of things you can do:

First. Edit /etc/mysql/my.cnf and validate that all entries related to socket look like this:

socket                          = /var/lib/mysql/mysql.sock

Next, edit /etc/mysql/debian.cnf. This file has a socket line in it as well. Make sure it is pointing to the same path as identified above.

You'll need to restart Percona if you made any changes.

sudo service mysql restart

@evil666 Your issue may be similar, but it is hard to tell. The error message you're seeing in the screen shot basically means that nZEDbetter/PHP is looking to the right place for the socket, but it's getting a permission denied error. The first place to start would be checking the permissions on the socket file itself. If you do a ls -l on the /var/lib/mysql directory, you should see a line (amongst the others) that looks something like:

srwxrwxrwx  1 mysql mysql          0 Mar 20 07:09 mysql.sock=

Obviously, the date/time may be different. What is most important is the permissions at the beginning. Does everyone have full read/write/execute?

theman480 commented 10 years ago

I tried on a fresh Ubuntu 13.10 desktop everything is fine with the script, but i have the same error as evil666 on the database setup.

ERROR! Unable to connect to database server. Please be sure that you have the correct information for the host name, socket, and/or port. SQL Error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

I tried :

Giving full permissions to the /var/lib/mysql and /etc/mysql/ :

total 110636 -rwxrwxrwx 1 mysql mysql 56 Mar 24 11:21 auto.cnf -rwxrwxrwx 1 root root 0 Mar 24 11:20 debian-5.6.flag -rwxrwxrwx 1 mysql mysql 12582912 Mar 24 11:24 ibdata1 -rwxrwxrwx 1 mysql mysql 50331648 Mar 24 11:24 ib_logfile0 -rwxrwxrwx 1 mysql mysql 50331648 Mar 24 11:20 ib_logfile1 drwxrwxrwx 2 mysql mysql 4096 Mar 24 11:21 mysql -rwxrwxrwx 1 mysql mysql 0 Mar 24 11:24 mysql-bin.index -rwxrwxrwx 1 mysql root 4905 Mar 24 11:24 mysql-error.log -rwxrwxrwx 1 root root 11 Mar 24 11:21 mysql_upgrade_info -rwxrwxrwx 1 mysql root 12845 Mar 24 11:24 nZED.err drwxrwxrwx 2 mysql mysql 4096 Mar 24 11:21 performance_schema drwxrwxrwx 2 mysql mysql 4096 Mar 24 11:20 test)

Then i restarted mysql and i have the following error:

root@nZED:~# service mysql restart

KurzonDax commented 10 years ago

Yeah, making the /etc/mysql and /var/lib/mysql directories writable by all is not good. The my.cnf file will get ignored as a safety precaution if it is writable by anyone other than owner.

These should be the permissions:

For /var/lib/mysql:
drwxr-xr-x  3 mysql         mysql             4096 Mar 20 07:09 mysql/

For /etc/mysql
drwxr-xr-x   3 root           root               4096 Mar 20 06:53 mysql/

Did you get a chance to double check the my.cnf and debian.cnf file to make sure the socket path is set correctly in both? You will have to use sudo to edit the files (after you've restored the permissions).

Also, when the setup script asks for your desired password for the MySQL root user, are you providing a password, or leaving it blank?

theman480 commented 10 years ago

Yes i checked the socket path is right on both files, i just installed with the script and i have not changed nothing after the installation.

I tried mysql -root -p and then i fill out with the percona password and i have the same error:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

Really strange :S

KurzonDax commented 10 years ago

Can you execute the following line from terminal and reply back with the output?

ps aux | grep [m]ysqld
theman480 commented 10 years ago

Here is :

ps aux | grep [m]ysqld root 30534 0.0 0.0 4440 744 ? S 13:23 0:00 /bin/sh /usr/bin/mysqld_safe mysql 30601 0.1 45.0 1139820 455396 ? Sl 13:23 0:04 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --log-error=/var/lib/mysql/nZEDbetter.err --pid-file=/var/lib/mysql/nZEDbetter.pid

Pinholic commented 10 years ago

Can confirm there is a problem with the script. Have just tried to install on ubuntu 13.10 desktop and get the same error as evil666 :-(

alexricher commented 10 years ago

Same here... Just tried to insatll nZEDbetter, all seems to have gone well during the script installation (except at one point, I did get an error:


Installing libmp3lame

Compiling and installing opus

Compiling and installing libvpx

./setup.sh: line 341: cd: libvpx: No such file or directory Compiling and installing ffmpeg This will take several minutes.


Then, I've accessed the web installation and got stuck on the same error as mentioned above:

ERROR! Unable to connect to database server. Please be sure that you have the correct information for the host name, socket, and/or port. SQL Error: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)

I've tried what was suggested on the page but nothing seemed to have solved it... :'(

Any other suggestions?

Pinholic commented 10 years ago

I think this project is probably abandoned :( No activity for quite a while. Shame as when it was running it was a good indexer. Not had it working for a while now being a linux novice so I can't really help you much. You could try nzedb if you haven't already.