Skip to content

Commit 5fd10e4

Browse files
committed
ok
2 parents f9fa0f9 + 401a7f1 commit 5fd10e4

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

Notes.md

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -58,26 +58,22 @@ sudo systemctl enable couchdb
5858

5959
### Ubuntu
6060

61-
```
62-
sudo apt-get install apache2 -y #安装apache
63-
sudo systemctl start apache2
64-
sudo systemctl enable apache2
65-
66-
67-
echo "deb https://apache.bintray.com/couchdb-deb xenial main" \ | sudo tee -a /etc/apt/sources.list #添加CouchDB的官方存储库
68-
curl -L https://couchdb.apache.org/repo/bintray-pubkey.asc \ | sudo apt-key add - #对添加的存储库进行签名
69-
sudo apt-get update -y #更新存储库
70-
sudo apt-get install couchdb -y #安装couchdb
71-
72-
73-
选择配置为一个独立或群集节点
74-
输入绑定地址:0.0.0.0
75-
输入密码:
76-
确认密码:
77-
sudo systemctl start couchdb
78-
sudo systemctl enable couchdb
79-
80-
61+
```shell
62+
# 添加签名证书
63+
sudo apt update && sudo apt install -y curl apt-transport-https gnupg
64+
curl https://couchdb.apache.org/repo/keys.asc | gpg --dearmor | sudo tee /usr/share/keyrings/couchdb-archive-keyring.gpg >/dev/null 2>&1
65+
source /etc/os-release
66+
echo "deb [signed-by=/usr/share/keyrings/couchdb-archive-keyring.gpg] https://apache.jfrog.io/artifactory/couchdb-deb/ ${VERSION_CODENAME} main" | sudo tee /etc/apt/sources.list.d/couchdb.list >/dev/null
67+
68+
# 通过设置 debcouf-set-selection来绕过安装CouchDB过程中出现的交互,
69+
# 同时设置DEBIAN_FRONTEND=noninteractive选项来避免交互
70+
echo "couchdb couchdb/mode select none" | debconf-set-selections
71+
apt update
72+
DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes couchdb
73+
74+
# 由于绕过了交互,所以会出现couchdb正常启动。
75+
# 会导致后面的systemctl restart couchdb命令失败,所以将/opt/couchdb/etc/local.ini配置文件中的最后一行关于设置admin用户的行的注释去掉
76+
sed -i '95s/;//g' /opt/couchdb/etc/local.ini
8177
```
8278

8379

@@ -171,4 +167,4 @@ cdbcli
171167

172168
## 日志
173169

174-
* 2020-05-13 完成CentOS安装研究
170+
* 2020-05-13 完成CentOS安装研究

roles/couchdb/tasks/Debian.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
# pre-installation
22
- name: Import repository
33
shell: |
4-
apt-cache install -y curl apt-transport-https gnupg
4+
apt update && sudo apt install -y curl apt-transport-https gnupg
55
curl https://couchdb.apache.org/repo/keys.asc | gpg --dearmor | sudo tee /usr/share/keyrings/couchdb-archive-keyring.gpg >/dev/null 2>&1
66
source /etc/os-release
7-
echo "deb [signed-by=/usr/share/keyrings/couchdb-archive-keyring.gpg] https://apache.jfrog.io/artifactory/couchdb-deb/ ${VERSION_CODENAME} main" | sudo tee /etc/apt/sources.list.d/couchdb.list >/dev/null
8-
apt update
9-
apt-cache install -y couchdb
10-
7+
echo "deb [signed-by=/usr/share/keyrings/couchdb-archive-keyring.gpg] https://apache.jfrog.io/artifactory/couchdb-deb/ {{ansible_distribution_release}} main" | sudo tee /etc/apt/sources.list.d/couchdb.list >/dev/null
8+
ignore_errors: yes
119

12-
10+
# install couchdb
11+
- name: Install CouchDB
12+
shell: |
13+
echo "couchdb couchdb/mode select none" | debconf-set-selections
14+
apt update
15+
DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes couchdb
16+
ignore_errors: yes

0 commit comments

Comments
 (0)