ZooKeeper 3.4.10

表題がリリースされているようだ。

■ 環境

  • ZooKeeper 3.4.10

■ release

Apache ZooKeeper – Release
http://zookeeper.apache.org/releases.html

まだHomebrewやDockerでは対応されていない。

$ brew info zookeeper
zookeeper: stable 3.4.9 (bottled), HEAD
Centralized server for distributed coordination of services
https://zookeeper.apache.org/
/usr/local/Cellar/zookeeper/3.4.9 (238 files, 18.2MB) *
  Poured from bottle on 2016-11-09 at 16:19:12
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/zookeeper.rb
==> Requirements
Optional: python ✔
==> Options
--with-perl
     Build Perl bindings
--with-python
     Build with python support
--HEAD
     Install HEAD version
==> Caveats
To have launchd start zookeeper now and restart at login:
  brew services start zookeeper
Or, if you don't want/need a background service you can just run:
  zkServer start
$

続いてDockerHubで見てみる。

library/zookeeper – Docker Hub
https://hub.docker.com/_/zookeeper/

Tags“を見ても、まだ”3.4.9“が最新の状態である。ソースコンパイルするのも良いのだが、さっと試すにはやっぱりこれらのどっちかがあると楽なんだよな。というわけで少し待ってみる。

以上。

■ 関連

ZooKeeper 3.4.10 on Homebrew

package upgrade

Ubuntuにおいて表題をする。

■ 環境

  • Ubuntu 16.04

■ ssh login

ログインした時に下記のメッセージが表示された。

$ ssh host-001
Welcome to Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-64-generic x86_64)

* Documentation:  https://help.ubuntu.com
* Management:     https://landscape.canonical.com
* Support:        https://ubuntu.com/advantage

  Get cloud support with Ubuntu Advantage Cloud Guest:
http://www.ubuntu.com/business/services/cloud

36 packages can be updated.
21 updates are security updates.


Last login: Thu Mar 30 19:05:45 2017 from XX.XX.XX.XX
ubuntu@host-001:~$

というわけでパッケージをアップデートしたい。RHEL系Linuxであれば`yum update`で済むのであるが、Ubuntuでは少々動きが違うようだ。

$ sudo apt-get update
$ sudo apt-get upgrade

`update`は`apt-get`ではパッケージリスト(?)を更新するだけ。パッケージを全て`yum update`みたいなことをするには`upgrade`である。

これで終わりかと思いきや、ログインした時にまた下記のメッセージが。

$ ssh host-001
Welcome to Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-64-generic x86_64)

* Documentation:  https://help.ubuntu.com
* Management:     https://landscape.canonical.com
* Support:        https://ubuntu.com/advantage

  Get cloud support with Ubuntu Advantage Cloud Guest:
http://www.ubuntu.com/business/services/cloud

7 packages can be updated.
7 updates are security updates.


*** System restart required ***
Last login: Thu Mar 30 19:10:46 2017 from XX.XX.XX.XX
ubuntu@host-001:~$

消えない7packages…。しかも”security updates“と来たものだから気になる。というわけで調べてみると、”kernel“系のパッケージは`upgrade`では更新されないとのこと。下記で更新。

$ sudo apt-get dist-upgrade

これで消えてくれた。

以上。

apt-cache policy

Ubuntuにおいて表題のコマンドについて。

■ 環境

  • Ubuntu 16.04

■ apt-cache

普段使う`apt-cache`のサブコマンドは下記ばかりである。

$ sudo apt-cache search

インストールしたいものを探す時に使用している。でもこれだとversionがわからないので、”show“を使ったりもする。

$ sudo apt-cache show nginx
Package: nginx
Priority: optional
Section: web
Installed-Size: 37
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Kartik Mistry <kartik@debian.org>
Architecture: all
Version: 1.10.0-0ubuntu0.16.04.4
  :
$

versionもこれだと記載されているのだが、情報が多すぎて見づらいと感じていた。という時に知ったのが”policy“である。

$ sudo apt-cache policy nginx
nginx:
  インストールされているバージョン: 1.10.0-0ubuntu0.16.04.4
  候補:               1.10.0-0ubuntu0.16.04.4
  バージョンテーブル:
*** 1.10.0-0ubuntu0.16.04.4 500
        500 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
        100 /var/lib/dpkg/status
     1.9.15-0ubuntu1 500
        500 http://ap-northeast-1.ec2.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
$

インストールしたいパッケージのversion等、自身が欲しい情報が記載されているのでこれで十分である。

以上。

Ubuntuのログイン時間を知りたい

表題の通り。とある複数人がアクセスするサーバに、SSHでログインした時間等を取得したい。単なるメモである。

■ 環境

  • Ubuntu 16.04

■ auth.log

どうやら`/var/log/auth.log`に記載されるようである。例えば下記のような感じのログが取得できる。

Mar 28 19:10:44 ip-XX-XX-XX-XX sshd[9284]: Accepted publickey for ubuntu from XX.XX.XX.XX port 43794 ssh2: RSA SHA256:XXxx0XxXXXXXXXX
Mar 28 19:10:51 ip-XX-XX-XX-XX sshd[9242]: Received disconnect from XX.XX.XX.XX port 43794:11: disconnected by user

ここから取得できそうである。

from XX.XX.XX.XX“のように記載されるIPと”port XXXXX“で一致したものが一つの接続と捉えることができそうだ。

このログ自体は`logrotate`の下記のファイルでrotateしてくれている。

/etc/logrotate.d/rsyslog

下記設定が適用されている。

{
     rotate 4
     weekly
     missingok
     notifempty
     compress
     delaycompress
     sharedscripts
     postrotate
          invoke-rc.d rsyslog rotate > /dev/null
     endscript
}

以上。

debパッケージの展開

表題の通り。debパッケージをインストールはせずに展開して中身を確認したい。

■ 環境

  • Ubuntu 16.04

■ deb

展開するには下記コマンドで可能である。例として”nginx-core“のdebパッケージを展開してみる。

$ ar vx nginx-core_1.10.0-0ubuntu0.16.04.4_amd64.deb
x - debian-binary
x - control.tar.gz
x - data.tar.xz
$

3つのファイルが展開された。さらに展開してみる。

$ tar Jxvf data.tar.xz
./
./usr/
./usr/sbin/
./usr/sbin/nginx
./usr/share/
./usr/share/lintian/
./usr/share/lintian/overrides/
./usr/share/lintian/overrides/nginx-core
./usr/share/doc/
./usr/share/doc/nginx-core/
./usr/share/doc/nginx-core/changelog.Debian.gz
./usr/share/doc/nginx-core/copyright
$

これて目的のファイルを探すことができそうである。

ちなみに`ar`は”binutils“パッケージに入っているようである。

$ which ar
/usr/bin/ar
$
$ dpkg -S /usr/bin/ar
binutils: /usr/bin/ar
$

以上。

■ 関連