LoginSignup
0
1

More than 5 years have passed since last update.

CentOS 7にCouchDB v. 2.3.1をインストール~Fauxtonでの初期設定(シングル構成)

Posted at

CouchDBのインストール

yumでインストールできます。

まず、以下のファイルを作り、以下の内容を書き込みます。
/etc/yum.repos.d/bintray-apache-couchdb-rpm.repo

[bintray--apache-couchdb-rpm]
name=bintray--apache-couchdb-rpm
baseurl=http://apache.bintray.com/couchdb-rpm/el$releasever/$basearch/
gpgcheck=0
repo_gpgcheck=0
enabled=1

その後、yum installでインストールできます。

$ sudo yum -y install epel-release && sudo yum install couchdb

Fauxtonでの初期設定を行う

初期状態ではCouchDBは127.0.0.1にバインドされているため、例えばリモートのサーバ上にインストールした場合はGUIの画面を覗くことができません。
まずは設定ファイルを編集して、外部からでもアクセスできるようにします。

設定ファイルはデフォルトでは

/opt/couchdb/etc/local.ini

にあるはずです。
ここにあるIPアドレスとポートの設定を変更します。

変更前

[chttpd]
;port = 5984
;bind_address = 127.0.0.1
; Options for the MochiWeb HTTP server.
;server_options = [{backlog, 128}, {acceptor_pool_size, 16}]
; For more socket options, consult Erlang's module 'inet' man page.
;socket_options = [{sndbuf, 262144}, {nodelay, true}]

変更後

[chttpd]
port = 5984
bind_address = 0.0.0.0
; Options for the MochiWeb HTTP server.
;server_options = [{backlog, 128}, {acceptor_pool_size, 16}]
; For more socket options, consult Erlang's module 'inet' man page.
;socket_options = [{sndbuf, 262144}, {nodelay, true}]

次にCentOSでポートを開放します。
デフォルトでは5984を使用するので以下のコマンドで5984を開放します。

sudo firewall-cmd --zone=public --add-port=5984/tcp

設定を永続化したい場合は以下のコマンドを使用します。

firewall-cmd --zone=public --add-port=5984/tcp --permanent

以下のコマンドを使って設定が反映されているかを確認します。

$ firewall-cmd --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: ens33
  sources: 
  services: ssh dhcpv6-client
  ports: 5984/tcp
  protocols: 
  masquerade: no
  forward-ports: 
  source-ports: 
  icmp-blocks: 
  rich rules: 

ここまでくればブラウザからFauxtonにアクセスできるはずです。

http://IPアドレス:5984/_utils
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1