Bonjour,
je penses finalement le prendre plus tôt (dès que j'aurais eu confirmation à mes questions ici, et que j'aurais assez pris en main le débian 6 que j'ai en virtual host.
J'aimerais donc vous poser quelques questions :
J'ai remarqué que l'offre de chez OVH est passé à 16 Go RAM, 2x 2TO en RAID SOFT 0/1, et donc, il devient plus de 4x plus performant que celui chez Ikoula, pour la moitié du prix.
Je penses donc prendre chez OVH le SuperPlan-BestOf 2011, sous Débian 6 Squeeze.
Toutefois, en testant en local, je remarque que certaines choses dont j'aurais besoin sur le serveur ne fonctionne pas, sur ma vh.
Par exemple, le sudo me dit que cette commande n'existe pas, alors que quand j' apt-get install sudo, il dit qu'il est déjà à jour.
J'ai tenté sur un compte n'ayant aucun privilège, et cela fait pareil.
Comment cela se fait-il ?
Ensuite, j'ai observé que le init.d permet de lancer des programmes au démarrage du serveur. j'ai donc cherché un script, et je suis tombé sur ceci:
#!/bin/bash
# /etc/init.d/minecraft
### BEGIN INIT INFO
# Provides: minecraft
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Minecraft server
# Description: Init script for minecraft/bukkit server, with rolling logs and use of ramdisk for less lag.
### END INIT INFO
### Based on http://www.minecraftwiki.net/wiki/Server_startup_script
### REQUIERMENTS
# screen, rsync
### SETUP
## There is a couple of things that need to be setup before using this
## initscript, I'm using Ubuntu server 10.10 so if are to just follow along.
#
## Move or symlink the script to /etc/init.d/minecraft
#
## Rename your world dir to diskworld and symlink the ramdisk in instead.
#
# cd ~/minecraft
# mv world diskworld
# ln -s /dev/shm/world world
#
## Create the log directory
#
# mkdir logs
#
### Setup cron
#
# sudo crontab -e
#
# m h dom mon dow command
# 02 05 * * * /etc/init.d/minecraft backup
# 55 04 * * * /etc/init.d/minecraft log-roll
# */10 * * * * /etc/init.d/minecraft to-disk
#
### SETTINGS
# Name of server.jar file
SERVICE='craftbukkit-0.0.1-SNAPSHOT.jar'
# User that should run the server
USERNAME="v"
# Path to minecraft directory excluding the last ex: /home/v/mine
MCPATH='/home/v/mine'
CPU_COUNT=2
# Change the values of -Xmx###M and -Xms###M to how mutch ram you want to give to the
# server, remeber that the world will stored in you ram, so subtract your
# world size from values.
INVOCATION="java -Xmx760M -Xms760M -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalPacing -XX:ParallelGCThreads=$CPU_COUNT -XX:+AggressiveOpts -jar $SERVICE nogui"
# Where the world backups should go
BACKUPPATH='/home/v/minebak'
# Where the logs are copied when running log-roll
LOGPATH="${MCPATH}/logs"
# Where the world is located on the disk
WORLDSTORAGE='/home/v/mine/diskworld'
#Path to the the mounted ramdisk default in ubuntu: /dev/shm
RAMDISK='/dev/shm'
ME=`whoami`
as_user() {
if [ $ME == $USERNAME ] ; then
bash -c "$1"
else
su - $USERNAME -c "$1"
fi
}
mc_start() {
if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
then
echo "Tried to start but $SERVICE was already running!"
else
echo "$SERVICE was not running... starting."
# rsync -tr $MCPATH/world-disc /dev/shm/
cd $MCPATH
as_user "cd $MCPATH && screen -dmS minecraft $INVOCATION"
sleep 7
if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
then
echo "$SERVICE is now running."
else
echo "Could not start $SERVICE."
fi
fi
}
mc_saveoff() {
if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
then
echo "$SERVICE is running... suspending saves"
# as_user "screen -p 0 -S minecraft -X eval 'stuff \"say Backing up world.\"\015'"
as_user "screen -p 0 -S minecraft -X eval 'stuff \"save-off\"\015'"
as_user "screen -p 0 -S minecraft -X eval 'stuff \"save-all\"\015'"
sync
sleep 10
else
echo "$SERVICE was not running. Not suspending saves."
fi
}
mc_saveon() {
if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
then
echo "$SERVICE is running... re-enabling saves"
as_user "screen -p 0 -S minecraft -X eval 'stuff \"save-on\"\015'"
# as_user "screen -p 0 -S minecraft -X eval 'stuff \"say World backup complete. \"\015'"
else
echo "$SERVICE was not running. Not resuming saves."
fi
}
mc_stop() {
if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
then
echo "$SERVICE is running... stopping."
as_user "screen -p 0 -S minecraft -X eval 'stuff \"save-all\"\015'"
sleep 10
as_user "screen -p 0 -S minecraft -X eval 'stuff \"stop\"\015'"
sleep 7
else
echo "$SERVICE was not running."
fi
if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
then
echo "$SERVICE could not be shut down... still running."
else
echo "$SERVICE is shut down."
fi
}
log_roll() {
mc_stop
DATE=`date "+%Y-%m-%d"`
mv $MCPATH/server.log $MCPATH/logs/server-$DATE.log
gzip $MCPATH/logs/server-$DATE.log
mc_start
}
mc_world_backup() {
echo "Backing up minecraft world"
if [ -e $BACKUPPATH/world_`date "+%Y.%m.%d"`.tar.bz2 ]
then
for i in 1 2 3 4 5 6
do
if [ -e $BACKUPPATH/world_`date "+%Y.%m.%d"`-$i.tar.bz2 ]
then
continue
else
as_user "cd $MCPATH && tar -cjf $BACKUPPATH/world_`date "+%Y.%m.%d"`-$i.tar.bz2 world"
break
fi
done
else
as_user "cd $MCPATH && tar -cjf $BACKUPPATH/world_`date "+%Y.%m.%d"`.tar.bz2 world"
echo "Backed up world"
fi
}
to_ram() {
if [ -L $MCPATH/world ]
then
as_user "rsync -rvt $WORLDSTORAGE/ $RAMDISK/world"
fi
}
to_disk() {
as_user "rsync -rvt $MCPATH/world/ $WORLDSTORAGE"
}
case "$1" in
start)
# Starts the server
to_ram
mc_start
;;
stop)
# Stops the server
as_user "screen -p 0 -S minecraft -X eval 'stuff \"say SERVER SHUTTING DOWN!\"\015'"
mc_stop
to_disk
;;
restart)
# Restarts the server
as_user "screen -p 0 -S minecraft -X eval 'stuff \"say SERVER REBOOT IN 10 SECONDS.\"\015'"
mc_stop
mc_start
;;
backup)
# Backups world
as_user "screen -p 0 -S minecraft -X eval 'stuff \"say Backing up world.\"\015'"
mc_saveoff
mc_world_backup
mc_saveon
as_user "screen -p 0 -S minecraft -X eval 'stuff \"say Backup complete.\"\015'"
;;
to-disk)
# Writes from the ramdisk to disk, in case the server crashes.
# Using ramdisk speeds things up alot, especially if you allow
# teleportation on the server.
mc_saveoff
to_disk
mc_saveon
;;
connected)
# Lists connected users
as_user "screen -p 0 -S minecraft -X eval 'stuff list\015'"
sleep 3s
tac $MCPATH/server.log | grep -m 1 "Connected"
;;
log-roll)
# Moves and Gzips the logfile, a big log file slows down the
# server ALOT (what was notch thinking?)
as_user "screen -p 0 -S minecraft -X eval 'stuff \"say SERVER REBOOT IN 10 SECONDS.\"\015'"
mc_stop
log_roll
mc_start
;;
status)
# Shows server status
if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
then
echo "$SERVICE is running."
else
echo "$SERVICE is not running."
fi
;;
*)
echo "Usage: /etc/init.d/minecraft {start|stop|backup|log-roll|to-disk|connected|status|restart}"
exit 1
;;
esac
exit 0
en suivant les instructions marquées ici: https://github.com/A...readme.markdown
Il requiert Rsync, paquet que j'ai donc installé. Mais malgré tout, il me déclare toujours ceci:Could not start craftbukkit-0.0.1-SNAPSHOT.jar.
Je suppose donc que c'est un problème de paramétrage... Car en lançant mon minecraft.sh (voir code plus bas),
il s'exécute correctement. J'ai pourtant adapté le code et suivi les instructions comme marqué sur le site.
Comment remédier à ce problème ?
J'ai également remarqué que le serveur était en RAID SOFT 0/1. cela m'inquiète, cela veut il dire qu'il est de base en raid 1 ou en raid 0 ?
Car si un disque meurt, je n'ai pas envie de tout perdre.
Et pour finir, si jamais j'ai un soucis, serez-vous disposés à m'aider ? Car pour moi, l'univers Linux est encore très nouveau.
Merci de vos futures réponses,
Cordialement,
Aenoa.
Code du minecraft.sh :
#!/bin/sh
BINDIR="\$(dirname "\$(readlink -fn "\$0")")"
cd "\$BINDIR"
java -Xincgc -Xmx1G -jar craftbukkit-0.0.1-SNAPSHOT.jar
Edit:
J'ai trouvé cet hébergeur, moins chère et avec une offre quasi-identique, un proc plus puissant... Qu'en pensez-vous ?
http://www.online.ne...-pro-r210.xhtml
Mais également celui ci :
http://www.kimsufi.com/fr/ks/ (kimsufi 24G)
Ce message a été modifié par Aenoa - 28 mai 2011 - 12:52.