BOM を削除して、CRLF を LF に変換する例 $ nkf -Lu --oc=UTF-8 utf8_bom_crlf.csv > utf8_lf.csv 参考 【メモ】コマンドでのBOMの追加・削除・確認 - Qiita 文字コード/改行コード変換コマンド nkf メモ - Qiita 【 nkf 】コマンド――文字コードと改行コードを変換する:Linux基本コマンドTips(51) - @IT
注意事項 US East (N. Virginia) Region (us-east-1) で証明書を作成する。 手順 マネジメントコンソールで ACM にアクセスする。 [証明書のプロビジョニング]-[今すぐ始める] をクリック。 [パブリック証明書のリクエスト] を選択。 ドメイン名を入力する。 [DNS の検証]を選択。 [確定とリクエスト] をクリック。 [続行] をクリック。 [Route 53 でのレコードの作成] をクリック、Route 53 にレコードを作成する。 しばらくすると、[状況]が「発行済み」になる。 参考 パブリック証明書のリクエスト - AWS Certificate Manager
あえてオールドクラシックなコマンドで。 export LANG=C # vmstat nohup vmstat 5|awk '{print strftime("%Y-%m-%d %H:%M:%S"), $0}{fflush()}'> vmstat_20200826.log & # mpstat nohup mpstat -P ALL 5 > mpstat_20200826.log & # iostat nohup iostat -dx 5|awk '{print strftime("%Y-%m-%d %H:%M:%S"), $0}{fflush()}'> iostat_20200826.log & # top top 1 # プロセッサ別に表示 f # 表示設定モードへ b # Parent Process Pid j # Last used cpu (SMP) l # CPU Time
VSCode の Remote - SSH 拡張機能をインストールして、VSCode から EC2 上のファイルを直接編集できるようにした手順。 インストール VSCode を起動する 左メニューの [Extensions] をクリックし、"remote" で検索し、Remote SSH を選択。 [Install] をクリックしてインストール。 インストールが完了すると、左メニューに [Remote Explolrer] アイコンが表示される。 設定 左メニューの [Remote Explolrer] をクリック。 [SSH TARGETS] の歯車アイコンをクリック。 設定ファイル(macOS の場合、/Users/<ユーザー名>/.ssh/config など)を選択 EC2の接続情報を追記。 Host ec2-dev User ec2-user Port 22 Hostname ec
sar をテキストに出力して加工する。 export LANG=C ls *.dat|while read LINE do ARR=(${LINE//_/ }) sar -u -f ${LINE}|perl -slane '/(\d{2}\/\d{2}\/\d{2})/ and $d=$1;if($#F==7 and !/%user/){printf(qq/%s\t%s\t%s\n/,$node,$d,join(qq/\t/,@F))}' -- -node=${ARR[0]} >> sar-u.tsv sar -r -f ${LINE}|perl -slane '/(\d{2}\/\d{2}\/\d{2})/ and $d=$1;if($#F==7 and !/kbmemfree/){printf(qq/%s\t%s\t%s\n/,$node,$d,join(qq/\t/,@F))}' -
データベース、OS、パフォーマンスを勉強したい人におすすめの入門編の書籍・資料(一部入門編でないものも含んでいます)。 絵で見てわかるOS/ストレージ/ネットワーク 新装版 作者:木村 達也,西田 光志,鳥嶋 一孝,田中 彰人,小田 圭二出版社/メーカー: 翔泳社発売日: 2019/09/13メディア: 単行本(ソフトカバー)Systems Performance: Enterprise and the Cloud 作者:Brendan Gregg出版社/メーカー: Prentice Hall発売日: 2013/10/26メディア: ペーパーバック絵で見てわかるOracleの仕組み (DB Magazine SELECTION) 作者:小田 圭二出版社/メーカー: 翔泳社発売日: 2006/06/21メディア: 単行本絵で見てわかるシステムパフォーマンスの仕組み 作者:小田 圭二,榑松 谷
手順 java のバージョンを切り替える $ sudo update-alternatives --config java There are 2 programs which provide 'java'. Selection Command ----------------------------------------------- * 1 /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java + 2 /usr/lib/jvm/jre-1.8.0-openjdk.x86_64/bin/java Enter to keep the current selection[+], or type selection number: javac のバージョンを切り替える $ sudo update-alternatives --config javac
pgbench で PostgreSQL に半永久的に負荷をかけ続ける手順をメモ。 スクリプト pgbench_infinite_loop.sh #!/bin/bash export LANG=C export PGPASSWORD=<パスワード> ENDPOINT=<ホスト名> BASE_NAME=$(basename $0) STEM="${BASE_NAME%.*}" DATE=`date '+%Y-%m-%d-%H%M%S'` while : do pgbench -n -r -c 8 -j 8 -t 100000 -U awsuser -h ${ENDPOINT} -d mydb >> ${STEM}-${DATE}.log 2>/dev/null done pgbench をインストール $ sudo yum -y install postgresql $ sudo yum -
たしか、4年くらい前にデータベース系のイベントで瀬島さんと横道さんと話しているときにそういうものを作っているとちらっと聞いて気になっていたので、ブログ見たときに sysload は「あの時、聞いたやつだ」と思い出した。 はるか昔kernel 2.6 の頃、Load Average が低めに出てしまうというバグがありました。 当時、弊社では Load Average を監視項目の一つにしていたため、これには大いに困りました。 また、その頃、私は resource monitoring に力を入れていたのですが、以前 blog でも書かせていただいた通り、MySQLのサーバ一台あたり200以上のmetricを収集していたため、「多すぎてどれを見ていいかわからない」といった声が社内から上がっていました。 そういった諸々の問題を解決するため、6年くらい前、私はあれこれ思案して、新しい metric
SHOW ENGINE INNODB STATUS の History list length が MySQL インスタンス全体の UNDO ページ数 undo log entries がトランザクション毎のUNDOレコード数 で、History list length が大きいとMySQLインスタンス全体での UNDO のサイズが大きくなりロールバックにかかる時間が長くなっており、undo log entries が大きいトランザクションが UNDO ページを大量に使っている犯人だと類推できる。undo log entries は insert/update/delete などを行った行数(未コミット)でサイズではない。 MariaDB 5.5.27以降10未満(XtraDB)では Information Schema の INNODB_UNDO_LOGS. SIZE で undo lo
バイナリログを一覧表示する % mysql -h aurora01.******.ap-northeast-1.rds.amazonaws.com -u awsuser -p 5.6.10-log awsuser: [mydb] 01:27> show binary logs; +----------------------------+------------+ | Log_name | File_size | +----------------------------+------------+ | mysql-bin-changelog.000165 | 134218106 | | mysql-bin-changelog.000166 | 134218041 | | mysql-bin-changelog.000167 | 134218041 | (中略) | mysql-bin-c
7. macOSやWindowsでLinuxバイナリを動かすプログラムを作った話 (ぬるぽへ) で聞いた Noah をインストールして使ってみた。 Noahとは ハイパーバイザ技術を用いたクロスOSなLinuxバイナリ互換プラットフォームの構築 佐伯 学哉・西脇 友一 ー Noah : Hypervisor-Based Darwin Subsystem for Linux ー Noah NoahはmacOS上でLinuxアプリケーションをそのまま動作させるアプリケーションです。ハイパーバイザを用いた新しい手法で、従来のバイナリ互換技術よりも安全かつ高速なLinuxエミュレーションを実現。Noahを使えば、apt-getやLinux向けgcc、それにあなたがこれから作る新しいLinuxアプリケーションが、そのままmacOSで動作します。 もう移植を待つ必要も、する必要もありません。 Noah
sysbench をインストールして MySQL のベンチマークをとる手順をメモ。 インストール $ curl -s https://packagecloud.io/install/repositories/akopytov/sysbench/script.rpm.sh | sudo bash $ sudo yum -y install sysbench mysql ベンチマーク 初期データロード $ sysbench /usr/share/sysbench/oltp_read_write.lua \ --db-driver=mysql \ --table-size=100000 \ --mysql-host=aurora01.*********.ap-northeast-1.rds.amazonaws.com \ --mysql-user=awsuser \ --mysql-passwo
MySQLのバイナリログはメディアリカバリに使うもので、ディスク障害などの際に mysqldump でエクスポートしておいたデータをインポートしてバイナリログでロールフォーワードする。Oracle Database で言うと、 インポートがリストアで、バイナリログでのロールフォーワードがアーカイブログとREDOログを使ったロールフォーワードに当たる。Oracle Database が物理的なブロックレベルで行う宇野に対して、MySQL は論理的にSQLベースで行う点が異なる。 InnoDBログはインスタンスダウンした時にクラッシュリカバリでロールフォーワードに使われる(ロールバックにはUNDOログが使われる)。Oracle Database がREDOログでロールフォーワードしてUNDO表領域のロールバックセグメントでロールバックするのと同じ。 MySQLのココにギョッとした! - オラク
vmstat: Support for timestamps with '-t' & fix for '-wd' From now the vmstat can append a timestamp to each line in the VMSTAT and DISKSTAT mode. You can achieve that with the '-t' switch. The '-w' switch now works in the DISKSTAT mode too. vmstat: Support for timestamps with '-t' & fix for '-wd' (4fcd56bf) · Commits · procps-ng / procps · GitLab これ以降 vmstat は -t オプションでタイムスタンプを表示できるようになっている。 $ vms
nethogs はネットワークの top コマンド的なもので通信量の多いプロセスをランキング表示して、秒間通信量も見ることができる。 インストール sudo yum -y install gcc-c++ libpcap-devel.x86_64 libpcap.x86_64 ncurses* git clone https://github.com/raboof/nethogs cd nethogs make sudo make install 使ってみる sudo /usr/local/sbin/nethogs 参考 NetHogs is a small 'net top' tool. Instead of breaking the traffic down per protocol or per subnet, like most tools do, it groups bandwid
MySQL でオプティマイザトレース(Oracle Database でいう 10053 トレース)を取得する方法。 mysql> SET optimizer_trace="enabled=on"; mysql> SET optimizer_trace_max_mem_size = 1048576; mysql> select 1; mysql> select * from information_schema.optimizer_trace\G *************************** 1. row *************************** QUERY: select 1 TRACE: { "steps": [ { "join_preparation": { "select#": 1, "steps": [ { "expanded_query": "/* se
macOS で Linux の strace のようにシステムコールトレースを取得したい場合は、dtruss で同等のことができる。 実行例 % sudo dtruss -deflo sudo -u $(id -u -n) sleep 1 PID/THRD RELATIVE ELAPSD CPU SYSCALL(args) = return 83868/0x3967d6: 1084 30 27 open("/dev/dtracehelper\0", 0x2, 0x7FFF5DA57840) = 3 0 83868/0x3967d6: 1382 298 296 ioctl(0x3, 0x80086804, 0x7FFF5DA577C8) = 0 0 83868/0x3967d6: 1387 5 4 close(0x3) = 0 0 83868/0x3967d6: 1440 1 0 threa
パラメータ SQL_MODE ルーク!MySQLではkamipo TRADITIONALを使え! | おそらくはそれさえも平凡な日々 MySQL で NOT NULL 制約のある列に複数行インサートするとその型のデフォルト値が入る - ablog TX_ISOLATION トランザクション分離レベルは Oracle のデフォルトは READ COMMITTED、MySQL のデフォルトは REPEATABLE READ 。*1 前提 MySQL 5.6 参考 MySQLのココにギョッとした! - オラクルエンジニアがMySQLを触って感じたこと from Ryota Watabe バックアップと障害復旧から考えるOracle Database, MySQL, PostgreSQLの違い from Ryota Watabe *1:マスターとリードレプリカについて追記予定
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く