sudo vi /etc/network/if-up.d/mtu
以下の内容をファイルに書き込む。
#!/bin/sh
/sbin/ifconfig eth0 mtu 1345
ファイルが出来ている事を確認。
ls -al /etc/network/if-up.d/
ファイルの中身があっている事を確認。
more /etc/network/if-up.d/mtu
再起動
sudo shutdown -fr now
設定値が反映されている事を確認。
ifconfig
sudo vi /etc/network/if-up.d/mtu
#!/bin/sh
/sbin/ifconfig eth0 mtu 1345
ls -al /etc/network/if-up.d/
more /etc/network/if-up.d/mtu
sudo shutdown -fr now
ifconfig
sudo apt-get install gcc受信側
wget http://ftp.uni-koeln.de/net/performance/ttcp/ttcp.tar.gz
tar xzf ttcp.tar.gz
cd ttcp
cc -o ttcp ttcp.c
./ttcp -r -s >>/deb/null送信側
./ttcp -t -s ${受信側IP} >>/deb/null
Windows版での-sなし → Linux版での-sあり
Windows版での-sあり → Linux版での-sなし
NFS: short packet in readdir reply!というErrorが出ていた。気になったので調べて見ると
Kernel version: 2.4.13 (up and smp), Trond's seekdir patch, ext3 patch
Hardware: P4 1700 (1 and 2), 2 GB RAM.
Compiled with RedHat 7.1 gcc (2.96-85)
nfs-Server: HP-UX 10.20
Without the nfs patch I had a lot of trouble with Irix servers - now Irix,
NetApp, Aix, Linux... nfs- servers are fine, but connecting to a HP server
leads to statements like this in the syslog:
NFS: short packet in readdir reply!
Even worse: Accessing one particular directory (using ls, find etc) leads
to a segmentation fault in the accessing process. The machine stays up and
running, but some other processes (without relationship to nfs mount) die a
sudden death as well.
There is nothing special about the directory on the nfs server.
There is no problem with Linux 2.2.14-5.0smp. I can check with other 2.4
versions if necessary. The problem is independent of the nfs version.
Kernel version: 2.4.13 (up and smp), Trond's seekdir patch, ext3 patch
Hardware: P4 1700 (1 and 2), 2 GB RAM.
Compiled with RedHat 7.1 gcc (2.96-85)
nfs-Server: HP-UX 10.20
Patch未適用下のIrixサーバで多数の問題に遭遇した。
Irix、NetApp、Aix、Linux、NFS-Server等は正常に動作しているが、HPのサーバへ接続しようとするとシステムログにこの様な文言が残っている。
NFS: short packet in readdir reply!
酷い時には、とあるDirectoryにAccessするとそのAccessをしたProcessがSegmentation Faultを起こしてしまう。
サーバ自体は問題なく動いているが、NFSマウントとは無関係な他のProcessまでもが同じように突然死んでしまう。
問題を起こしたDirectoryやNFSServerに対して特に変わった事はやっていない。
私は2.2.14-5smp利用下ではこの問題に遭遇しなかった。もし必要であれば他の2.4kernelでも試す事は出来る。
That particular Oops should already be fixed in 2.4.14.
そのバグは2.4.14kernelで直ってるぜ!
Thanks, I've tried 2.4.15pre5 (+ seekdir patch) now and could not
reproduce the Ooops with the HP nfs server. But still: The Kernel
complains about: "NFS: short packet in readdir reply!" when I access
any directory provided by a HP-UX 10.20 nfs-server (using nfs2 |
nfs3). I dont' notice any strange behaviour other than that, though.
But a new problem emerged: Copying from a linux (2.4.13 | 2.4.15pre5)
nfs-client onto an AIX nfs-server doesn't work. About 800kb are copied
then the cp command just hangs. Syslog says:
Nov 16 11:51:12 capc20 kernel: nfs: server caes04 not responding, still trying
This problem only occures with nfs3, and not with nfs2.
2.4.15pre5 (seekdir修正適用)環境で試してみたら、この問題は起きなかった。
気持ち悪い事にそれでもHP-UXでNFS2/3を使ったNFS-ServerDirectoryにAccessした際の「NFS: short packet in readdir reply!」というエラーログは消えなかった。
なお別のErrorが発生した。
NFS ClientであるLinux(2.4.13 | 2.4.15pre5)からAIXのnfs-serverへ接続すると動かない。例えば800KBのファイルをコピーするとハングアップしてしまい、シスログには下記の様なErrorが残っている。
Nov 16 11:51:12 capc20 kernel: nfs: server caes04 not responding, still trying
このErrorはNFS3を使った時に起き、NFS2を使うと起きない。
何かそう難しくない修正方法を知っているなら教えて欲しい。
vi /etc/yum.repos.d/zabbix-jp.repo
[zabbix-jp]で追加完了。
name=ZABBIX-JP
baseurl=http://www.zabbix.jp/rpms/rhel5/$basearch/
gpgcheck=0
enabled=1
yum install zabbix-agentで入る。
vi /etc/zabbix/zabbix_agent.conf
vi /etc/zabbix/zabbix_agentd.conf
Zabbixの基本概念
ホスト・・・監視対象の事
アイテム・・・監視対象項目の事
sudo apt-get install zabbix-server-mysqlInstall途中でMySQLのRootのPassword、Zabbix用のPasswordの設置を要求されるので適宜設置する。
sudo apt-get install zabbix-agent
sudo apt-get install zabbix-frontend-phpここでもMySQLのPasswordが聞かれるので適宜入力。これで基本は終わり。
sudo echo date.timezone=Asia/Tokyo >> /etc/php5/apache2/php.iniこれで終了。
sudo echo max_execution_time=300 >> /etc/php5/apache2/php.ini
sudo chown www-data:www-data /etc/zabbix/dbconfig.php
sudo chown zabbix:zabbix /etc/zabbix/zabbix_*.conf
sudo chmod 666 /etc/zabbix/dbconfig.php
sudo chmod 666 /etc/zabbix/zabbix_*.conf (Agentでも必要)
sudo mkdir /var/run/zabbix-agent (Agentで必要)
sudo mkdir /var/run/zabbix-server
sudo chown zabbix:zabbix /var/run/zabbix-* (Agentでも必要)
sudo chmod 775 /var/run/zabbix-* (Agentでも必要)
sudo echo zabbix_agent 10050/tcp >> /etc/services (Agentで必要)
sudo echo zabbix_trap 10051/tcp >> /etc/services
sudo /etc/init.d/apatch2 restart
http://${いれた鯖のIP}/zabbix/で画面にAccess出来る。初期ID/Passはadmin/zabbix。
sudo vi /etc/zabbix/zabbix_agent.conf
sudo vi /etc/zabbix/zabbix_agentd.conf
sudo vi /etc/zabbix/zabbix_server.conf
sudo vi /etc/init.d/zabbix-serverで設定ファイルを開いてしたの赤字で書いてある部分を追加する。
PID=/var/run/zabbix-server/$NAME.pid続いてAgentの方
DIR=`/usr/bin/dirname "$PID"`
test -f $DAEMON || exit 0
@@ -21,6 +22,10 @@
case "$1" in
start)
rm -f $PID
if [ ! -d "$DIR" ]; then
/bin/mkdir -p "$DIR"
/bin/chown -R zabbix:zabbix "$DIR"
fi
echo "Starting $DESC: $NAME"
sudo vi /etc/init.d/zabbix-agentで起動スクリプトを開いて赤文字の部分を追加する。
PID=/var/run/zabbix-agent/$NAME.pidこれでUbuntuを再起動すればZabbixも起動する様になるはず。
DIR=`/usr/bin/dirname "$PID"`
test -f $DAEMON || exit 0
@@ -21,6 +22,10 @@
case "$1" in
start)
rm -f $PID
if [ ! -d "$DIR" ]; then
/bin/mkdir -p "$DIR"
/bin/chown -R zabbix:zabbix "$DIR"
fi
echo "Starting $DESC: $NAME" >;&2
sudo apt-get install nginxと打ってみた。
/etc/nginx/sites-available/default
sudo apt-get install sun-java6-jdk (Sun Java JDKの場合)で基本インストール終了。ec2-api-toolsは「/usr/lib/ec2-api-tools」に入るっぽい。
sudo apt-get install openjdk-6-jdk (OpenJDKの場合)
apt-get install ec2-api-toools
export JAVA_HOME=/usr
export EC2_HOME=/usr/lib
ec2verこのコマンドを投げて、「1.3-34128 2009-03-01」みたいな値が帰ってくればOK。
mkdir /home/yutuki/ec2以上で設置完了。
// FTPでも何でも良いのでここに暗号鍵二つをUpする。
export EC2_PRIVATE_KEY=/home/yutuki/ec2/pk-XXX.pem
export EC2_CERT=/home/yutuki/ec2/cert-XXX.pem
ec2-describe-instancesこのコマンドを投げると自分のAccountで現在動かしているInstanceのListが表示される。
Ubuntu 9.04 (Jaunty Jackalope) has been released today bringing OpenNebula
Ubuntu 9.04 (Jaunty Jackalope) has been released today bringing highly interesting new features, specially in the Cloud Computing and Virtualization area. The new Ubuntu server distribution includes OpenNebula, so providing the technology required to build private and hybrid clouds.
apt-get install opennebula
sudo vi /etc/udev/rules.d/70-persistent-net.rules
Do I need an AWS account to use SCALR?
Yes, you do need to have an AWS account.
Where do I get my AWS account ID?
It can be found in "Your AWS Profile" page inside http://aws-portal.amazon.com, find an "Account Number" field.
What is "farm"?
Farm is a set of instances that are serving one or more applications. Typical farm consists of one or more www instances, two or more app instances and one or more mysql instances.
What is "role"?
Role is AMI that is built for specific task. Currently Scalr comes with the following pre-built "shared" roles:
• www - frontend web servers that are proxying HTTP requests to all instances of app role. It can also serve static files with minimal overhead.
• app - instances originally running Apache
• mysql - MySQL master or slave instances.
• base - a clean AMI that can be used to create new roles.
You can also create your own roles based on existing "shared" ones.
What is "application"?
Application is basically a website that is running on a farm.
How do I get my domain DNS zone updated when farm is reconfigured?
Just set nameservers for your domain to ns1.scalr.net, ns2.scalr.net and ns3.scalr.net. Scalr will take care of the rest.
Does Scalr configure virtual hosts on app instances?
Not yet, if you are going to host more than one application of one farm, you are responsible for this.
How MySQL replication work?
Scalr takes care about MySQL replication and re-configuration. Instances of mysql role can become master or slave dynamically, if any of mysql instances suddenly crash.
OK, I created application, built and launched a farm. Now what?
Upload your application on app instances.
Where do I place my files? What are default directories?
/var/www for app
/var/www/nginx-default for www (you won't place anything here in most cases)
How do I SSH into my instance?
Go to the list of farms and click on Private key -> Download. Use this private key with OpenSSH client (-i switch) or Putty to authenticate on all instances in this farm.
How do I use downloaded private key in Putty?
Follow this manual
How "Synchronize to all" feature works?
Say you've made changes to files on some instance. Now you want to save them on all instances in this role, so they will not be lost upon instance crash and on newly created instances. You find the instance in the list and click "Synchronize to all".
• Scalr rebundles this instance
• Scalr terminates old instances one-by-one and replaces them with new ones.
Does Scalr take care about synchronizing my content between my instances for www and app roles?
No, but you can either take care of this by yourself (a simple rsync script will do the job) or use "Synchronize to all" feature.
Can I use Scalr and other tools like Elasticfox simultaneously to control my instances?
You are strongly advised to not do any changes on your instances, EBS volumes, Elastic IPs etc outside Scalr. Scalr is unable to track these changes in most cases and you can end up with unexpected behavior. Good example is assign of Elastic IP to an instance via Elasticfox.
What are "Min LA" and "Max LA" settings for roles?
LA is a common abbreviation for "Load Average". You can read more on this in this Wikipedia article . Scalr scales your role based on average LA on all instances for last 15 minutes. If LA grows higher than Max LA, new instance is started.If LA fails lower than Min LA, one instance is terminated.
What are Min Instances and Max Instances?
Scalr will keep a number of running instances of particular role between Min and Max, regardless of LA limits.
Will my farms/instances be stopped if I unsubscribe?
No, but you will no longer be able to control them from Scalr web interface and they will not be monitored anymore.
How HTTP requests are spreaded across all www instances?
Scalr assigns public IP addresses of all www instances to your application domain name. This is called DNS round-robin. Different visitors/requests will go on different www instances.
What software is running on www role instances?
nginx.
Can I add my existing AMI/instance into Scalr?
For now you can only use Scalr's "base" role AMI to create your custom one. A next version of scalr will allow you to "scalrize" any AMI.
How do I create my custom role/AMI out of "base" one?
Include a base role when starting a new farm. Go to a base AMI and use "Synchronize to all" option. You will be asked for a new role name. The new AMI will be owned by you.
I made changes on instance, clicked "Synchronize to all" and now it won't be recognized by Scalr or MySQL snaphsot not working or it hangs in "Synchronizing…..." state.
Make sure that you did not mess essential scalr programs on your instance.
Four things that you should never do when customizing your instance:
1. Deleting/disabling snmpd and snmptrapd
2. Disabling PermitRootLogin or PubkeyAuthentication, changing Port in sshd_config
3. Removing scalr public key from /root/.ssh/authorized_keys
4. Delete the following packages or invalidate their dependencies: ec2tools, s3cmd
I want to run apt-get upgrade on an instance of my custom role. Is there any essential software on scalr AMI that I must keep intact?
Make sure that SNMPd is running after the upgrade. Some important dirs that must not be touched: /etc/aws, /usr/local/aws. Finally, be careful when modifying /etc/rc.local.
My application uses file-based sessions. What if my visitor's requests will be proxied to a different app instances?
This wont happen. Nginx is configured to keep visitors bundled to a specific backend server (based on his IP, User-Agent etc).
What if I need to edit my DNS zone?
You can do that in Applications->View->Edit DNS zone.
How do I know IP adresses of all farm instances from any particular instance?
Scalr stores them in /etc/aws/hosts/ folder. For example
ls /etc/aws/hosts/www
will list all internal IPs of www instances. You can also access them as subdomains int-ROLENAME.domain.
How do I know external IP adresses of my roles?
You can use ext-ROLENAME.domain
How do I connect to MySQL servers from my application?
Like with any master-slave replication, it is important that your application writes only on master and reads from any. This is because slaves are only reading changes from master.
Here is a simple PHP code that will list your mysql master host (to write on) and all mysql hosts (to read from):
$mysql_masters = (array)@glob("/etc/aws/hosts/mysql-master/*");
$mysql_master_host = basename($mysql_masters[0]);
$mysql_all = (array) @glob("/etc/aws/hosts/mysql/*");
$mysql_all_hosts = array();
foreach ((array)$mysql_all as $h) {
array_push($mysql_all_hosts, basename($h));
}
Another, even simpler way is to use int-rolename.yourdomain dynamic hostnames that resolve to internal IP adresses. Say, you have launched application my.com. MySQL master in this case will be accessible as int-mysql-master.my.com and one random mysql instance will be int-mysql.my.com
How do I reconfigure nginx?
Edit /etc/nginx/nginx.conf and issue "killall -HUP nginx" command.
My application tracks IP adresses of visitors. nginx substitutes visitor IP with it's own IP. How do I know client IP address?
nginx passes IPs in X-Real-IP HTTP header. Modify your application to use this header instead, or set up mod_rpaf Apache module (no code modifications will be needed in this case).
What OS is running on instances?
Ubuntu 7.04 GNU/Linux
How do I cancel my account?
Just cancel your PayPal subscription. You account will remain active until due date.
Error Type: LoadXML
Description: Incorrect XML
/var/log/apache2
vi /etc/apache2/sites-available/default
AllowOverride None
↓
AllowOverride All
cd /etc/apache2/mods-enabled
ln -s ../mods-available/rewrite.load
/etc/init.d/apache2 restart
apt-get install php5-dev
wget -P /usr/local/src http://www.zlib.net/zlib-1.2.3.tar.gz
cd /usr/local/src
tar xzf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure --prefix=/usr/local
make
make install
apt-get install libcurl4-gnutls-dev
pecl install pecl_http
echo extension=http.so >> /etc/php5/apache2/php.ini
sudo /etc/init.d/apache2 restart
WWW Role・・・LoadBalancerの役割。Nginxを搭載。
App Role・・・APServerの役割。Apacheを搭載。
DB Role・・・DBServerの役割。MySQLを搭載。
Base Role・・・独自Role構築用
Client
Load Balancer/WWW Server・・・(Nginx)
Application Server・・・(Apache)
Database Server・・・(MySQL)