Jump to content

[Ubuntu] Server Help


Recommended Posts

Veretos

Question #2

Answer: http://getmangos.eu/community/viewtopic.php?id=4579

Tested, working

simple

apt-get install gdb

create a file restart.sh in the /opt/mangos directory or where you have the bin, etc, directories of mangos compilated, give execute permission

#!/bin/bash

###############
# About: Auto restart mangos-worldd on crash & generate crash log
###############
# 1. Compile MaNGOS with parameter: --with-debug-info
# 2. Put auto_restarter.sh into compiled mangos directory (where folders: bin/, lib/, etc/)
# 3. (Only once): chmod +x auto_restarter.sh
# 4. Usage: ./auto_restarter.sh -c etc/mangosd.conf
# p.s. Make sure you have "gdb" installed.
###############

# config:
# path to mangos-worldd binary
daemon=./bin/mangos-worldd
# system
export LD_LIBRARY_PATH=.:lib:$LD_LIBRARY_PATH

if [ "`ulimit -c`" -eq 0 ]; then
  ulimit -c unlimited
fi

while true
do
  MANGOS=`ps -el | grep mangos-worldd`
  $daemon $*
  if [ -z "$MANGOS" ]; then
     gdb $daemon core.* --batch --eval-command="bt ful" > crash.log
     dte=`date +%F_%H-%M-%S`
     mkdir crash_$dte
     mv crash.log crash_$dte/
     mv log/Server.log crash_$dte/
     mv core.* crash_$dte/
  fi
  sleep 2
done

you can run the file by ./restart.sh or "screen -A -m -d -S mangosd /opt/mangos/restart.sh"

if chose screen method you can view or terminate the mangos by "screen -r mangosd" then CTRL C or if you only want watch you can exit with CTRL A + D and mangos is still runing in the screen named mangosd

Hope this will help you as help me :)

Link to comment
Share on other sites

  • 40 years later...

Hi, everyone

I have recently moved from windows server 2008 onto ubuntu server. I have read all the tutorials on this forum however I have few additional questions.

1) How to compile mangos on 64 bit on Ubuntu (Correctly)

2) Where do I find the crashdumps. I have the following enabled during configuration state: --with-debug-info

Link to comment
Share on other sites

In my case:

dir=/opt/mangos
rm -rf objdir/
autoreconf --install --force
automake --add-missing
automake src/bindings/ScriptDev2/Makefile
mkdir objdir
cd objdir/
../configure --prefix=$dir --sysconfdir=$dir/etc --enable-cli --enable-ra --datadir=$dir --disable-builtin-ace
make
mkdir $dir
mkdir $dir
make install
make clean

You can also use this configure line

../configure CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O3 -m64 -pipe -msse4.2 -DFD_SETSIZE=4096 -fno-delete-null-pointer-checks -fno-strength-reduce -fno-strict-aliasing -frename-registers" CXXFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O3 -m64 -pipe -msse4.2 -DFD_SETSIZE=4096 -fno-delete-null-pointer-checks -fno-strength-reduce -fno-strict-aliasing -frename-registers" --prefix=$dir --sysconfdir=$dir/etc --enable-cli --enable-ra --datadir=$dir --disable-builtin-ace

Change the dir=/opt/mangos directory to your desired path

You must have installed ACE_wrapper for use " --disable-builtin-ace" if you havent ACE instaled, then remove that

You must have all the required libraries...

Here you have a nice tutorial, and is the same for mangos:

http://www.trinitycore.info/index.php?title=Installing_TrinityCore_on_recent_Linux-based_systems

I recomend you to remove the disable builtin ace for the begining and when is working try to use the external ACE in your system

For Q #2 i will like an answer too ;) i dont know how to do it... but isnt with configure flag, you must use another way to start the server with external program that capture the output of mangos binary

Link to comment
Share on other sites

Btw... i have Ubuntu x64 10.04 LTS installed yesterday, and i have some kind of delay in the server, my players say they have "lag" or "delay" in BGs... someone have idea of what can be the reason ??

Is not hardware problem, is a good server with 8gb of memory and only 100 players online

ACE 5.8.2 installed...

Link to comment
Share on other sites

Yes SataII... is strange, with centos x32 i didnt have this problem... just with my new ubuntu installation... (Same hardware)

But i have a lot more stability in ubuntu...

Is strange becouse the read write SQL process is only on logon, save or moving into new map zone, but in BGs ?? seems like bad library, or something like that... i really dont know wtf is wrong... my mysql my.cnf file is the same as my old centos installation (wihout "lag")

Link to comment
Share on other sites

Maybe... is a fresh install

No conection problem

--- 192.168.1.1 ping statistics ---
9365664 packets transmitted, 9365663 received, 0% packet loss, time 1838730ms
rtt min/avg/max/mdev = 0.058/0.181/16.662/0.071 ms, pipe 2, ipg/ewma 0.196/0.175 ms

No procesor problem

Tasks: 135 total,   1 running, 134 sleeping,   0 stopped,   0 zombie
Cpu(s):  5.4%us,  1.6%sy,  0.0%ni, 79.1%id, 13.2%wa,  0.3%hi,  0.4%si,  0.0%st
Mem:   8194292k total,  5645328k used,  2548964k free,   164664k buffers
Swap:  6384632k total,        0k used,  6384632k free,  1898144k cached

Services

  [*] apache2                     Start/stop apache2 web server                                                                                          │
    │    [*] grub-common                 Record successful boot for GRUB                                                                                        │
    │    [*] mysql                       MySQL database server binaries                                                                                         │
    │    [*] pppd-dns                    Restore resolv.conf if the system crashed.                                                                             │
    │    [*] smbd                        SMB/CIFS file, print, and login server for Unix                                                                        │
    │    [*] unattended-upgrades         Check if unattended upgrades are being applied                                                                         │
    │    [ ] apparmor                    AppArmor initialization                                                                                                │
    │    [ ] apport                      automatically generate crash reports for debugging                                                                     │
    │    [ ] atd                         Delayed job execution and batch processing                                                                             │
    │    [ ] console-setup               console font and keymap setup program                                                                                  │
    │    [ ] cron                        process scheduling daemon                                                                                              │
    │    [ ] dmesg                       enhanced multi-threaded syslogd                                                                                        │
    │    [ ] failsafe-x                  X Window System (X.Org) infrastructure                                                                                 │
    │    [ ] hostname                    utility to set/show the host name or domain name                                                                       │
    │    [ ] hwclock                     Miscellaneous system utilities                                                                                         │
    │    [ ] hwclock-save                Miscellaneous system utilities                                                                                         │
    │    [ ] irqbalance                  Daemon to balance interrupts for SMP systems                                                                           │
    │    [ ] module-init-tools           tools for managing Linux kernel modules                                                                                │
    │    [ ] network-interface           high level tools to configure network interfaces                                                                       │
    │    [ ] network-interface-security  high level tools to configure network interfaces                                                                       │
    │    [ ] nmbd                        SMB/CIFS file, print, and login server for Unix                                                                        │
    │    [ ] ondemand                    Set the CPU Frequency Scaling governor to "ondemand"                                                                   │
    │    [ ] plymouth                    graphical boot animation and logger - main package                                                                     │
    │    [ ] plymouth-log                graphical boot animation and logger - main package                                                                     │
    │    [ ] plymouth-splash             graphical boot animation and logger - main package                                                                     │
    │    [ ] plymouth-stop               graphical boot animation and logger - main package                                                                     │
    │    [ ] postfix                     start and stop the Postfix Mail Transport Agent                                                                        │
    │    [ ] procps                      /proc file system utilities                                                                                            │
    │    [ ] rsync                       fast remote file copy program daemon                                                                                   │
    │    [ ] rsyslog                     enhanced multi-threaded syslogd                                                                                        │
    │    [ ] ssh                         OpenBSD Secure Shell server                                                                                            │
    │    [ ] udev                        rule-based device node and kernel event manager                                                                        │
    │    [ ] udev-finish                 rule-based device node and kernel event manager                                                                        │
    │    [ ] udevmonitor                 rule-based device node and kernel event manager                                                                        │
    │    [ ] udevtrigger                 rule-based device node and kernel event manager                                                                        │
    │    [ ] ufw                         program for managing a Netfilter firewall                                                                              │
    │    [ ] winbind                     start Winbind daemon                                                                                                   │
    │    [ ] x11-common                  X Window System (X.Org) infrastructure         

Myconf

#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
# 
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# [url]http://dev.mysql.com/doc/mysql/en/server-system-variables.html[/url]

# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port        = 3306
socket        = /var/run/mysqld/mysqld.sock

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket        = /var/run/mysqld/mysqld.sock
nice        = 0

[mysqld]
#
# * Basic Settings
#

#
# * IMPORTANT
#   If you make changes to these settings and your system uses apparmor, you may
#   also need to also adjust /etc/apparmor.d/usr.sbin.mysqld.
#

user        = mysql
socket        = /var/run/mysqld/mysqld.sock
port        = 3306
basedir        = /usr
datadir        = /var/lib/mysql
tmpdir        = /tmp
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address        = 0.0.0.0
#
# * Fine Tuning
#
key_buffer        = 16M
max_allowed_packet    = 16M
thread_stack        = 192K
thread_cache_size       = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover         = BACKUP
max_connections        = 80
table_cache            = 1000
#thread_concurrency     = 10
#
# * Query Cache Configuration
#
query_cache_type=1
query_cache_limit    = 2498560
query_cache_size        = 4997120
query_cache_min_res_unit=1024
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file        = /var/log/mysql/mysql.log
#general_log             = 1

log_error                = /var/log/mysql/error.log

# Here you can see queries with especially long duration
#log_slow_queries    = /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
#       other settings you may need to change.
#server-id        = 1
#log_bin            = /var/log/mysql/mysql-bin.log
expire_logs_days    = 10
max_binlog_size         = 100M
#binlog_do_db        = include_database_name
#binlog_ignore_db    = include_database_name
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem



[mysqldump]
quick
quote-names
max_allowed_packet    = 16M

[mysql]
#no-auto-rehash    # faster start of mysql but no tab completition

[isamchk]
key_buffer        = 16M
key_buffer_size=21506

#
# * IMPORTANT: Additional settings that can override those from this file!
#   The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/

I compiled the same source i haved in centos...

Maybe ACE_wrappers 5.8.2 ?? i will try using included ace in sources... maybe is that.. i dont know... my player says the "delay" problem is in BG and instances, but my cpu is in 5 or 6% and i have a lot o free ram memory

Link to comment
Share on other sites

Sata II test with hdparm

hdparm -Tt /dev/sda1

/dev/sda1:
Timing cached reads:   3262 MB in  2.00 seconds = 1631.04 MB/sec
Timing buffered disk reads:  360 MB in  3.00 seconds = 119.91 MB/sec

MMMM maybe that is my problem, in another server with centos i have this results

hdparm -Tt /dev/sda1

/dev/sda1:
Timing cached reads:   4748 MB in  2.00 seconds = 2374.12 MB/sec
Timing buffered disk reads:  100 MB in  0.90 seconds = 110.95 MB/sec

wOot :S

Link to comment
Share on other sites

That is significantly higher for CentOS. Wonder what they do differently from Ubuntu.

i dont know but is the same HDD... Samsung HD161GJ in both machines... same MB, and same proc... the only diference is the SO Centos 5.5 x64 vs Ubuntu 10.04 x64

But my problem is only in BG, Arena and Instances... really strange

Already tried with included ACE and External ACE 5.8.2... same result

Kero, RSA or Stcore same result... i only changed the linux... :(

Link to comment
Share on other sites

Thanks for replies.

I was wondering if someone could explain why we disable build in ACE?

kero99 had told me that without build in ACE the server is more stable, he has a lot of experience with mangos, like rsa, selector, insider42 and others...

is good to read the comments in git repacks even translate russian :)

Link to comment
Share on other sites

It may be due to ext4 strange database regressions. Ext4 is currently not the best filesystem for a database, ext3 performs about 3 times faster, ext2 about 5 times (similar to XFS/JFS).

It is possible that some other Ubuntu crap got in the way, like graphical composite manager (ie. super-nice visual UI effects, ...) which could drain CPU power a lot (no, that one 79% CPU idle "top" output doesn't mean anything).

Try using "uptime" command to measure your "load average".

Link to comment
Share on other sites

well the hdd fs is a good reason, and yes i have ext4 format :S

Not graphical interface for me, just terminal... all x11 are disabled or better say not installed

I just restarted the server (new NIC, just trying) i will try uptime in a few hours to have better info, right now: 17:14:19 up 9 min, 2 users, load average: 1.14, 0.92, 0.48

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use