2017-01-01から1年間の記事一覧

postgres クエリ停止

Postgreプロセスの確認方法 以下のSQLを実行すればOK。 SELECT procpid, start, now() - start AS lap, current_query FROM (SELECT backendid, pg_stat_get_backend_pid(S.backendid) AS procpid, pg_stat_get_backend_activity_start(S.backendid) AS star…

NFS

NFSの稼働状況確認 - mikedaの日記 NFS FreeBSD FreeBSD 9.0 解説シリーズ その 1: NFS Improved https://www.allbsd.org/~hrs/diary/201107.html#d2103 NFS OSX -o resvporthttps://thornelabs.net/2013/10/15/operation-not-permitted-mounting-nfs-share-…

メール sendmail Gmail 再送

メールキュー sendmail tips relay先の冗長化とか再送間隔とか。 - Qiita キューを再送する通常の運用でメールがキューにたまってしまうのは、送信先のメールサーバーがダウンしている状況だ。送信先のメールサーバーが復旧すれば、リトライ間隔に従って順次…

rsync 並列実行

find xargs find ${source_dir} -mindepth 1 -maxdepth 1 | xargs -P 24 -I {} rsync --archive --perms --owner --group --xattrs --acls --recursive --delete --compress --log-file=<logfile_path> -quiet -e ssh {} <destination_user>@<destination_instance>:<destination_dir> ファイルのコピー時にRSYNCが遅くなる ex. find </destination_dir></destination_instance></destination_user></logfile_path>…

munin rrdcached

http://munin-monitoring.org/wiki/rrdcachedhttp://munin.jp/wiki/rrdcachedhttps://www.tumfatig.net/20150731/enabling-rrdcached-for-munin-on-openbsd/http://pocketstudio.jp/log3/2013/07/31/bring_back_io_with_munin_and_rrdcached/https://github.…

munin グラフを非表示にする

[localhost] address 127.0.0.1 use_node_name yes ... sensors_temp.graph no hddtemp_smartctl.graph no 最後の2行は、既存の sensors_temp プラグインと、 hddtemp_smartctl プラグインのグラフを表示しなくするための設定です。 これらのグラフのデータ…

munin graph_data_size

http://munin-monitoring.org/wiki/format-graph_data_size In this format the original values normal/huge can be translated :normal meaning custom 2d, 30m for 9d, 2h for 45d, 1d for 450d huge meaning custom 400d normalだと、hour=5分精度(5分*1…

bind

http://park12.wakwak.com/~eslab/pcmemo/linux/bind/bind2.htmlhttps://futuremix.org/2010/03/bind-named-checkconf-error-check-command お名前.com セカンダリDNS(Slave) https://help.onamae.com/app/answers/detail/a_id/7872 ACL ONAMAE { 210.172.…

お名前.com セカンダリDNS(Slave)

https://help.onamae.com/app/answers/detail/a_id/7872 ACL ONAMAE { 210.172.129.81; 163.44.76.202; }; のように記述、 zone では allow-transfer { ONAMAE; }; http://www.fens.net/modules/wiki/?dialy%2F2016-11-25 also-notify https://serverfault.c…

NFS crossmnt crossmount

https://unix.stackexchange.com/questions/26377/cross-mounting-nfs-shares-on-linux-servers

php 7.1

pecl memcache https://github.com/websupport-sk/pecl-memcachehttps://github.com/websupport-sk/pecl-memcache/releases 4.0.5.2https://gist.github.com/Niteshvgupta/1832ce29dee460b64d5384e4f585e7ab pecl geoip GeoIP v. 111 with PHP7 supporthttps…

munin plugin php-fpm

https://github.com/tjstein/php5-fpm-munin-pluginsApache Prefork+mod_phpからEvent+PHP-FPMへの切り替えた記録(CentOS7) - YOMON8.NET

AWS RDS mysql

デフォルトのパラメータグループは、パラメータの変更ができないため、値を変更したい場合はパラメータグループの付け替えが必要となります。 パラメータグループの付け替えは、RDSの再起動が必要となるため、動的パラメータを変更するときも再起動が必要と…

osx リカバリ

http://qiita.com/chino_tweet/items/5e1b430ef227dc28c038 これまでは、電源を入れた直後に cmd + R を押し続けて起動することで、現在インストールしているバージョンのmacOSを再インストール。option + cmd + R を押し続けて起動することで、Mac購入時に…

Linux swap

RHEL6.4(kernel 2.6.32-303)以降、vm.swappiness=0 にすると OOM Killer が発動しやすくなるので、1 にしましょうという話を見かけるのでメモ。詳しくは後日調べる予定。RHEL6.4(kernel 2.6.32-303)以降の vm.swappiness=0 と OOM Killer の関係 - ablog htt…

bash-completion

sshのhost名を自動補完させる - QiitaFreeBSD sudo pkg install bash-completion $ vi .bashrc [[ $PS1 && -f /usr/local/share/bash-completion/bash_completion.sh ]] && \ source /usr/local/share/bash-completion/bash_completion.sh if [ -f $(brew --…

Apache umask

# echo 'umask 2' > /usr/local/etc/apache22/envvars.d/umask.env # /usr/local/etc/rc.d/apache22 restart https://forums.freebsd.org/threads/24035/

varnish 認証

Varnish 4 ではシークレットファイルの扱いが変わっている V3 のように -S オプションを指定しなかった場合、シークレットファイル $PREFIX/var/varnish/hostname/_.secret を自動的に作成して認証に利用する。varnishの管理インターフェースの認証について…

varnish 管理

Varnish Administration Console (VAC) Cluster Management https://www.varnish-software.com/vac VaaS - Cluster Management https://github.com/allegro/vaas Vaban Cluster Management https://github.com/martensson/vabanhttps://varnish-cache.org/ex…

WordPress ステージング 本番 環境 同期

GMO WP Cloud -> Z.com WPZ.com WP https://hosting.z.com/jp/service/wp/改良されたステージング環境の利用方法!Z.com WordPressサーバー 本番環境サイトとステージング環境サイト間のサイトコピーは、本番環境サイトのダッシュボード上 に設置してあるオ…

FreeBSD camcontrol

さて本題ですが、今風のFreeBSDはHDD管理は基本的に camcontrol で全部OK。 デバイスの指定はデバイス名(ada0とかda0)でもいけるができない場合はデバイスIDを使うべし。FreeBSD HDDの取り外し方法 | サーバいじくり雑記

freebsd iotop

To monitor processes by I/O instead of CPU, on Linux we have “iotop”. iotop does not exist on FreeBSD. We can use iostat or top like this. ~# top -m io -o total ~# iostat -w 1 http://blog.arainho.me/freebsd/top/io/2016/02/10/monitor-io-in-…

Postgres backup

データベース毎にバックアップファイルを分けるPostgres バックアップスクリプト version 1.1 http://sonic64.com/2003-04-17.html # Get all DB name TARGET_DB=`psql -l -P format=unaligned -P fieldsep=, -P tuples_only |perl -F, -lane "if (@F[0] ne …

postgres リストア時の ERROR: duplicate key value violates unique constraint "pg_largeobject_metadata_oid_index"

ERROR: duplicate key value violates unique constraint "pg_largeobject_metadata_oid_index" DETAIL: Key (oid)=(xxxxx) already exists. ALTER LARGE OBJECT In one of my odoo database, I ran this SQL query in PGAdmin III to delete the largeobjec…

aws クレジット

EFS File System Size (GiB) Baseline Aggregate Throughput (MiB/s) Burst Aggregate Throughput (MiB/s) Maximum Burst Duration (Min/Day) % of Time File System Can Burst (Per Day) 10 0.5 100 7.2 0.5%http://docs.aws.amazon.com/efs/latest/ug/perf…

nginx リバースプロキシ KeepAlive

https://ma.ttias.be/enable-keepalive-connections-in-nginx-upstream-proxy-configurations/ 前提条件として Nginx > 1.1.4 が必要。http://qiita.com/toritori0318/items/a85d0b1efbd3ea1fc950 http://blog.nomadscafe.jp/2012/02/nginx-11x-httpupstream…

pgpool

http://www.pgpool.net/pgpool-web/contrib_docs/watchdog_master_slave/ja.html failover.sh を promote に書き換える https://hnakamur.github.io/blog/2016/09/15/experiment-postgresql-active-standby-using-pgpool-ii/ listen_addresses FreeBSD 11.0-…

apache コンテントネゴシエーション

https://httpd.apache.org/docs/current/ja/content-negotiation.html

ansible private network address

gather_facts: yes tasks: - debug: var=ansible_all_ipv4_addresses - set_fact: man_ip: "{{ item }}" with_items: ansible_all_ipv4_addresses when: "item.startswith('10.')" - debug: var=man_ip http://stackoverflow.com/questions/34730239/how-to-…

ansible facts

Ansible 2.5 から facts は ansible_facts.* という名前空間配下でも参照可能 https://tekunabe.hatenablog.jp/entry/2018/05/04/ansible_facts_namespace