Skip to content

Commit

Permalink
Initial manage/config changes for CouchDB 3.1.1
Browse files Browse the repository at this point in the history
fix couch test creds

define single node
  • Loading branch information
amaltaro committed Aug 31, 2021
1 parent b93d0f1 commit 58b6846
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 40 deletions.
60 changes: 24 additions & 36 deletions wmagentpy3/local.ini
Original file line number Diff line number Diff line change
@@ -1,61 +1,45 @@
; CouchDB Configuration Settings

; Custom settings should be made in this file. They will override settings
; in default.ini, but unlike changes made to default.ini, this file won't be
; overwritten on server upgrade.

[couchdb]
;max_document_size = 4294967296 ; bytes
database_dir = deploy_project_root/couchdb/database
view_index_dir = deploy_project_root/couchdb/database
uri_file = deploy_project_root/couchdb/logs/couch.uri
uuid = 652fb71bc6c32121e0752325a4973eb3
database_dir = /home/dmwm/unittestdeploy/wmagent/1.5.2.pre3-comp/install/couchdb/database
view_index_dir = /home/dmwm/unittestdeploy/wmagent/1.5.2.pre3-comp/install/couchdb/database
uri_file = /home/dmwm/unittestdeploy/wmagent/1.5.2.pre3-comp/install/couchdb/logs/couch.uri
os_process_timeout = 1000000



[httpd]
port = 5984
bind_address = 0.0.0.0
; single node is only for test purposes, otherwise it will work just like CouchDB 1.x
; for now, define it in the default config such that _users, _replicator and _global_changes databases are automatically created
single_node=true

[log]
level = info
file = deploy_project_root/couchdb/logs/couch.log

[couch_httpd_auth]
;secret = replace this with a real secret
file = /home/dmwm/unittestdeploy/wmagent/1.5.2.pre3-comp/install/couchdb/logs/couch.log


[update_notification]
;unique notifier name=/full/path/to/exe -with "cmd line arg"

; To create an admin account uncomment the '[admins]' section below and add a
; line in the format 'username = password'. When you next start CouchDB, it
; will change the password to a hash (so that your passwords don't linger
; around in plain-text files). You can add more admin accounts with more
; 'username = password' lines. Don't forget to restart CouchDB after
; changing this.
[admins]
;admin = mysecretpassword
[chttpd]
port = 6994
bind_address = 127.0.0.1

[ssl]
;cert_file = deploy_project_root/couchdb/certs/cert.pem
;key_file = deploy_project_root/couchdb/certs/key.pem
;cacert_file = deploy_project_root/couchdb/certs/cert.pem
enable = true
cert_file = /home/dmwm/unittestdeploy/wmagent/1.5.2.pre3-comp/install/couchdb/certs/cert.pem
key_file = /home/dmwm/unittestdeploy/wmagent/1.5.2.pre3-comp/install/couchdb/certs/key.pem
cacert_file = /home/dmwm/unittestdeploy/wmagent/1.5.2.pre3-comp/install/couchdb/certs/cert.pem
ssl_certificate_max_depth = 10
verify_ssl_certificates = false

[replicator]
;cert_file = deploy_project_root/couchdb/certs/cert.pem
;key_file = deploy_project_root/couchdb/certs/key.pem
;cacert_file = deploy_project_root/couchdb/certs/cert.pem
cert_file = /home/dmwm/unittestdeploy/wmagent/1.5.2.pre3-comp/install/couchdb/certs/cert.pem
key_file = /home/dmwm/unittestdeploy/wmagent/1.5.2.pre3-comp/install/couchdb/certs/key.pem
cacert_file = /home/dmwm/unittestdeploy/wmagent/1.5.2.pre3-comp/install/couchdb/certs/cert.pem
ssl_certificate_max_depth = 10
verify_ssl_certificates = false
; checkpoint setup: 10 minutes interval
use_checkpoints = true
checkpoint_interval = 600000
; performance setup (still to be evaluated in the production nodes)
worker_processes = 4
http_connections = 10
worker_batch_size = 2000
max_replication_retry_count = infinity
socket_options = [{keepalive, true}, {nodelay, true}]

[compactions]
Expand All @@ -66,3 +50,7 @@ _default = [{db_fragmentation, "70%"}, {view_fragmentation, "60%"}, {from, "20:0
check_interval = 3600
; ~200 MB
min_file_size = 209715200

[admins]
admin = myadminpasswd
unittestagent = passwd
14 changes: 10 additions & 4 deletions wmagentpy3/manage
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,8 @@ db_prompt(){
#
init_couch_pre(){
echo "Initialising CouchDB on $COUCH_HOST:$COUCH_PORT..."
echo " With installation directory: $INSTALL_COUCH"
echo " With configuration directory: $CONFIG_COUCH"
mkdir -p $INSTALL_COUCH/logs
mkdir -p $INSTALL_COUCH/database
perl -p -i -e "s{deploy_project_root/couchdb}{$INSTALL_COUCH}" $CONFIG_COUCH/local.ini
Expand Down Expand Up @@ -502,10 +504,13 @@ start_couch(){
echo "CouchDB has not been initialised... running pre initialisation";
init_couch_pre;
fi
couchdb -b -a $CONFIG_COUCH/local.ini \
echo -n "Which couchdb: "
which couchdb
echo " With installation directory: $INSTALL_COUCH"
echo " With configuration directory: $CONFIG_COUCH"
nohup couchdb -b -a $CONFIG_COUCH/local.ini \
-p $INSTALL_COUCH/logs/couchdb.pid \
-e $INSTALL_COUCH/logs/stderr.log \
-o /dev/null
&> $INSTALL_COUCH/logs/couch_nohup.log &
if [ $COUCH_INIT_DONE -eq 0 ]; then
echo "CouchDB has not been initialised... running post initialisation"
init_couch_post;
Expand All @@ -517,7 +522,8 @@ start_couch(){
#
stop_couch(){
echo "stopping couch...";
couchdb -d -p $INSTALL_COUCH/logs/couchdb.pid;
ps aux | grep couchdb | awk '{print $2}' | xargs kill -9 || true
# couchdb -d -p $INSTALL_COUCH/logs/couchdb.pid;
}

clean_couch(){
Expand Down

0 comments on commit 58b6846

Please sign in to comment.