-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial manage/config changes for CouchDB 3.1.2 #1088
Conversation
126966d
to
58b6846
Compare
a1346fd
to
af332a4
Compare
af332a4
to
ea8a7a0
Compare
de5263e
to
d8403f6
Compare
57f7b31
to
ef86015
Compare
couchdb/manage
Outdated
echo "Stopping CouchDB service..." | ||
for couch_pid in $(ps aux | grep couch | grep -v grep | awk '{print $2}'); do | ||
echo " killing CouchDB process... ${pid}" | ||
kill -9 $couch_pid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For my own reference, this logic to kill the couchdb process in my private VM does not work. It fails and it exits the script, thus never starting CouchDB. Here is the relevant terminal output:
+ sudo -H -u $u bashs -lc '/data/srv/current/config/couchdb/manage stop '\''I did read documentation'\'''
Stopping CouchDB service...
killing CouchDB process...
/data/srv/current/config/couchdb/manage: line 229: kill: (11496) - Operation not permitted
killing CouchDB process...
/data/cfg/admin/InstallDev: line 89: 11496 Killed sudo -H -u $u bashs -lc "$cmd"
5407c13
to
c6e2132
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alan, I made few suggestions:
- there is a pattern of using
http://$USERPASS@localhost:5984
, therefore it is better to define it once and use across the code. For instance, if it was already there then you don't need to change so many places. - you should replace all hard-coded couch credentials in all files since you'll push these files into github and we should avoid leakage of credentials (even for our backends)
- usage of perl is not required but leads to increase size of RPMs, therefore I suggest to replace it with sed.
Regarding security measurements, according to Couch docs we can define group members via simple PUT HTTP request:
Here, we create new users for
|
1bb8025
to
bc0c6ea
Compare
bc0c6ea
to
99e51b8
Compare
ad980f7
to
009f360
Compare
f8c133c
to
1b9c19a
Compare
@muhammadimranfarooqi Imran, as discussed today, I separated the frontend changes (and a TODO monitoring.ini) in this PR: #1151 Could you please review and merge this one? |
fix couch test creds define single node second iteration over the manage and local.ini Add default.ini configuration file Update CouchDB status function to use new API copy the default.ini under wmagentpy3 directory; update wmagent deploy script update couch local.ini according to wmagent secrets update manage and local.ini for central couch more changes to the couchdb manage and local.ini Remake CouchDB stop function CouchDB deployment should default to couchdb31 package fix couchdb/manage status function and log path export COUCHDB_INI_FILES configuration and hmac files Update manage to use credentials; fix ini files and status check fix hmac path fix manage sysboot and stop_couch fix once again the stop method remove no longer valid couchdb start options use user/pass everywhere in the CouchDB manage script Use default creds for the ServerMonitor ping test Disable MSOutput and MSUnmerged fix disabling of MSOutput and MSUnmerged Fix CouchDB stop function Support CouchDB 3.x HTTP Headers required by Proxy Authentication Make CouchDB http headers lower case update location to where headers are defined in the frontend Set CouchDB to use Proxy Authentication mechanism apply Valentins suggestions more fixes to couchdb auth use double quotes remove user/pass from wma local.ini Update CouchDB monitoring.ini remove no longer needed cms-based configurations remove uuid from wmagentpy3 local.ini configuration file Make copy of wmagentpy3 CouchDB configuration files under the tier0 project increase replication timeout fix start couchdb to append to logs more tier0 changes replace current by $cfgversion for tier0 deploy script reorganize CouchDB local.ini files rollback changes to workqueue/monitoring and cmsauth change setting to access databases allow all_dbs to be listed by anyone Tweak agent replication timeout and checkpoint interval
2f3a52a
to
6ede6d0
Compare
All right! I think I resolved all the questions and concerns in this PR, other than the migration from perl to sed that goes beyond the scope of these changes. @muhammadimranfarooqi I have all these things tested in my VM and from my side they are ready to go. Note that it does not require any changes to the frontends! Regarding testbed deployment, please do not proceed with it because we will have to run the first upgrade together. Actions need to be taken to migrate the databases to a CouchDB 3.x format. It would be great to have it merged sooner though. |
Fixes dmwm/WMCore#10829
Let me try to document all the changes and why they have been made:
couchdb/default.ini
,wmagentpy3/default.ini
andtier0/default.ini
configuration file is required to start up CouchDB. This is a blind copy of what is provided by CouchDB itself.local.ini
configuration file contains our specific CouchDB configuration, overriding whatever is in thedefault.ini
chttpd/authentication_handlers
define the Proxy Authentication mechanismcouchdb/single_node
defined to true to get the admin users automatically created during deployment, in addition to some system-like databasesmanage
script required a few changes, like:couchdb -p
,couchdb -a
,couchdb -o
,couchdb -e
andcouchdb -b
no longer exist, removed!couchdb -A
has been replaced bycouchdb -couch_ini
start
andstop
codestatus
now uses the_up
unathenticated endpointcouchdb/monitoring.ini
needs to use user/pass (set up during couchdb deployment)wmagentpy3/deploy
position CouchDB config files under thecouchdb
configuration directorywmagentpy3/local.ini
defines 2 accounts, the admin one and unittest users. The unittest user will be disabled when CouchDB gets deployed in production. These accounts are automatically created during start up.wmagentpy3/manage
is a mess and it makes our CI jenkins hard to deal with.manage
script operations, read credentials fromcouch_creds
file.max_replication_retry_count
to infinity for WMAgent/Tier0 backendconnection_timeout
to 300 secs (I've seen timeouts in testbed replications!)In addition to that, it also includes:
reqmgr2ms/manage
such that MSOutput and MSUnmerged do not get started in our VMs (MongoDB setup is broken).TODO: Imran, we need to define a file for the Couch credentials under /data/auth/couchdb. We can discuss this over Mattermost.