Cacti web interface not available

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
lunelson
Posts: 5
Joined: Thu Mar 02, 2006 11:32 am

Cacti web interface not available

Post by lunelson »

When I go to the cacti web site I can log in, then I get a message that says "Can't open file: 'host.MYI' (errno: 145)". No idea what could have brought this on; I haven't made any config changes lately and the server seems to be in good health.

I'm running cacti 0.8.6h with the plugin architecture and a couple of plugins. Let me know if there's any other info I should provide. Thanks, anybody, for your help.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

You have MySQL dataabase problems.

Try: mysqlcheck --auto-repair --databases cacti
lunelson
Posts: 5
Joined: Thu Mar 02, 2006 11:32 am

Post by lunelson »

That appears to have done the trick. Thanks for the quick and effective response!

Any idea what would have caused this in the first place?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

disk corruption or possibly a hard shutdown of the server...
rik
Posts: 38
Joined: Mon Nov 22, 2004 5:15 am
Location: Zuerich; Switzerland
Contact:

same

Post by rik »

hello i have the same problem.

my system:

freebsd 6.0
mysql-server-4.1.15
mysql-client-4.1.15
cacti-0.8.6h
cactid-0.8.6.g
plugin-architecture
thold-plugin
weathermap-plugin (Howard Jones)
update-plugin
monitor-plugin
networktools-plugin

1266 graphs
694 hosts
5 min poller time


but i have a raid 5 system so a disk error seems to me a bit wierd.

and i did not have a hard shutdown.

the database is still running and i corrected the problem with:

Code: Select all

myisamchk -r ../../host.MYI
root@CH0235018# myisamchk -r /var/db/mysql/cacti/host.MYI
- recovering (with sort) MyISAM-table '/var/db/mysql/cacti/host.MYI'
Data records: 700
- Fixing index 1
Data records: 694
but after 5 minutes running without any problem the problem came up again.



it is the third time this happens to me.

do you have any idea?

thx
rik
Posts: 38
Joined: Mon Nov 22, 2004 5:15 am
Location: Zuerich; Switzerland
Contact:

Post by rik »

this problem comes up again....

almost every month, i don't know why...

has anyone a idea to solve it?

thank you very much.

rik
danbeck
Posts: 30
Joined: Tue Jun 20, 2006 12:08 pm
Location: Huntsville, Alabama
Contact:

Re: same

Post by danbeck »

rik wrote: the database is still running and i corrected the problem with:

Code: Select all

myisamchk -r ../../host.MYI
root@CH0235018# myisamchk -r /var/db/mysql/cacti/host.MYI
- recovering (with sort) MyISAM-table '/var/db/mysql/cacti/host.MYI'
Data records: 700
- Fixing index 1
Data records: 694
but after 5 minutes running without any problem the problem came up again.
Never run myisamchk with the server running, unless you lock the tables first. On a running MySQL server, if you want to repair a table that hasn't been marked as crashed, you can use the optimize command:

Code: Select all

mysql> optimize table TABLENAME;
Table corruption can be caused by several different issues, the most likely being MySQL daemon crashes or physical server crashes. Check your mysqld.err log (it my be named something different on your machine) for crash reports or any oddities that may be happening. Having RAID 5 on a machine doesn't insulate you from any of these things, it just keeps a physical hard drive failure from destroying your system. You could still have file system level issues or operating system issues that have nothing to do with hardware.

In any case, it's a fact of life that mysiam tables are easily corrupted and have to be constantly babysat. Especially if there is constant writing being done to the table. You might consider converting the table formats to InnoDB format, a less likely to crash format that supports row locking and scales much, much better for large installations. The downside is that for what you gain in reliability and scalability, you sacrifice somewhat in speed. Of course, on modern hardware, this is greatly minimized.
-Daniel

[url=http://dealnews.com/developers/cacti/memcached.html]memcached Template[/url] - Version 1.0

[url=http://dealnews.com/developers/]dealnews.com/developers[/url] - Useful scripts and Cacti templates.
[url=http://dealnews.com/]dealnews.com[/url] - How to go broke saving money.
rik
Posts: 38
Joined: Mon Nov 22, 2004 5:15 am
Location: Zuerich; Switzerland
Contact:

:solved:

Post by rik »

First of all thank you for your quick answer.

You are absolutly right i runned myisamchk without locking it or shutting down the mysql-server.

i mentioned the raid just because of the possible harddisk-error as a reason for the problem.

nor the os neither the mysql-service stopped when the error accured, so like you said it must be because of unstable table type myisam.

i think i will just live with that and shutdown the server correct this table once a week with a script.

thanks
danbeck
Posts: 30
Joined: Tue Jun 20, 2006 12:08 pm
Location: Huntsville, Alabama
Contact:

Re: :solved:

Post by danbeck »

rik wrote:First of all thank you for your quick answer.

You are absolutly right i runned myisamchk without locking it or shutting down the mysql-server.

i mentioned the raid just because of the possible harddisk-error as a reason for the problem.

nor the os neither the mysql-service stopped when the error accured, so like you said it must be because of unstable table type myisam.

i think i will just live with that and shutdown the server correct this table once a week with a script.

thanks
A mysql server will restart itself in the event of a crash; they usually will not permanently go away. You should really examine the mysqld error logs to see if the server is crashing or you are getting other errors concerning your tables.

Although, the myisam table type is succeptible to corruption, it should not be happening out of the blue without some specific external factors causing the problem.

Also, like I said, unless the table itself is being marked as "crashed", you can just use the OPTIMIZE sql statement to fix most index errors while the server is running. Hence, an automated script can do this at some regular interval for you.
-Daniel

[url=http://dealnews.com/developers/cacti/memcached.html]memcached Template[/url] - Version 1.0

[url=http://dealnews.com/developers/]dealnews.com/developers[/url] - Useful scripts and Cacti templates.
[url=http://dealnews.com/]dealnews.com[/url] - How to go broke saving money.
rik
Posts: 38
Joined: Mon Nov 22, 2004 5:15 am
Location: Zuerich; Switzerland
Contact:

Post by rik »

oh... ok

i will check the error log as soon as i'm back from holiday..... ;-)

thank you very much.

greetz
rik
Posts: 38
Joined: Mon Nov 22, 2004 5:15 am
Location: Zuerich; Switzerland
Contact:

mysql db crash

Post by rik »

hello

i have checked the log file and yes you where right the database does restarting every 5 Min. (my polling is done every 5 Min.)

the message in the log is the following:

Code: Select all


060717 12:05:00  mysqld restarted
060717 12:05:01  InnoDB: Started; log sequence number 0 43654
/usr/local/libexec/mysqld: ready for connections.
Version: '4.1.15'  socket: '/tmp/mysql.sock'  port: 3306  FreeBSD port: mysql-server-4.1.15
mysqld got signal 10;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.

key_buffer_size=16777216
read_buffer_size=258048
max_used_connections=68
max_connections=100
threads_connected=22
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = 92783 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

060717 12:10:01  mysqld restarted
060717 12:10:01  InnoDB: Started; log sequence number 0 43654
/usr/local/libexec/mysqld: ready for connections.
Version: '4.1.15'  socket: '/tmp/mysql.sock'  port: 3306  FreeBSD port: mysql-server-4.1.15
as i am no crack in mysql... maybe someone has some ideas how i can find out what the problem could be.

my my.cnf looks like:

Code: Select all

[client]
#password       = your_password
port            = 3306
socket          = /tmp/mysql.sock

# The MySQL server
[mysqld]
port            = 3306
socket          = /tmp/mysql.sock
skip-locking
key_buffer = 16M
max_allowed_packet = 1M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M

#skip-networking

#log-bin

server-id       = 1
#server-id       = 2

#master-host     =   <hostname>
#master-user     =   <username>
#master-password =   <password>
#master-port     =  <port>
#log-bin

#tmpdir         = /tmp/
#log-update     = /path-to-dedicated-directory/hostname

#bdb_cache_size = 4M
#bdb_max_lock = 10000

# Uncomment the following if you are using InnoDB tables
innodb_data_home_dir = /var/db/mysql/
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = /var/db/mysql/
innodb_log_arch_dir = /var/db/mysql/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
innodb_buffer_pool_size = 16M
innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 5M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
#safe-updates

[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout
thank you
rik
Posts: 38
Joined: Mon Nov 22, 2004 5:15 am
Location: Zuerich; Switzerland
Contact:

::solved::

Post by rik »

I changed the my.cnf to the following and :D it works now.

Code: Select all

[client]
#password       = your_password
port            = 3306
socket          = /tmp/mysql.sock

# The MySQL server
[mysqld]
port            = 3306
socket          = /tmp/mysql.sock
skip-locking
max_connections = 800
max_connect_errors = 10
key_buffer = 36M
max_allowed_packet = 16M
table_cache = 1024
sort_buffer_size = 512K
thread_cache_size = 286
interactive_timeout = 25
wait_timeout = 1800
connect_timeout = 10
net_buffer_length = 8K
join_buffer_size = 2M
read_buffer_size = 2M
sort_buffer_size = 3M
query_cache_limit = 1M
query_cache_size = 16M
query_cache_type = 1
tmp_table_size = 16M
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 64M

#skip-networking

#log-bin

server-id       = 1
#server-id       = 2

#master-host     =   <hostname>
#master-user     =   <username>
#master-password =   <password>
#master-port     =  <port>
#log-bin

#tmpdir         = /tmp/
#log-update     = /path-to-dedicated-directory/hostname

#bdb_cache_size = 4M
#bdb_max_lock = 10000

# Uncomment the following if you are using InnoDB tables
innodb_data_home_dir = /var/db/mysql/
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = /var/db/mysql/
innodb_log_arch_dir = /var/db/mysql/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
innodb_buffer_pool_size = 16M
innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 5M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
#safe-updates

[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 64M
sort_buffer_size = 64M
read_buffer = 16M
write_buffer = 16M

[mysqlhotcopy]
interactive-timeout
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest