cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Shuler (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (CASSANDRA-10872) Debian Package does not prompt the user to review the config files; it just replaces them causing trouble (since the daemon starts by default)
Date Thu, 20 Oct 2016 18:23:58 GMT

     [ https://issues.apache.org/jira/browse/CASSANDRA-10872?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Michael Shuler resolved CASSANDRA-10872.
----------------------------------------
    Resolution: Not A Problem

I expect there may have been a dpkg configuration on this original machine that used new package
configs by default.

It is clear that {{dpkg}} understands which are the configuration files (everything under
{{/etc}}, by default) and that an edit of one of the configuration files indeed prompts the
operator for intervention. Closing as not a problem.

{noformat}
mshuler@hana:~$ apt-cache policy cassandra
cassandra:
  Installed: (none)
  Candidate: 2.2.8
  Version table:
     2.2.8 0
        500 http://www.apache.org/dist/cassandra/debian/ 22x/main amd64 Packages
mshuler@hana:~$ sudo apt-get install cassandra
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  cassandra-tools
The following NEW packages will be installed:
  cassandra
0 upgraded, 1 newly installed, 0 to remove and 15 not upgraded.
Need to get 23.6 MB of archives.
After this operation, 32.3 MB of additional disk space will be used.
Get:1 http://www.apache.org/dist/cassandra/debian/ 22x/main cassandra all 2.2.8 [23.6 MB]
Fetched 23.6 MB in 7s (3,143 kB/s)                                                       
                                                                              
Selecting previously unselected package cassandra.
(Reading database ... 171072 files and directories currently installed.)
Preparing to unpack .../cassandra_2.2.8_all.deb ...
Unpacking cassandra (2.2.8) ...
Processing triggers for systemd (215-17+deb8u5) ...
Setting up cassandra (2.2.8) ...
Adding group `cassandra' (GID 125) ...
Done.
vm.max_map_count = 1048575
net.ipv4.tcp_keepalive_time = 300
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
Processing triggers for systemd (215-17+deb8u5) ...
mshuler@hana:~$ dpkg --status cassandra
Package: cassandra
Status: install ok installed
Priority: extra
Section: misc
Installed-Size: 31553
Maintainer: Eric Evans <eevans@apache.org>
Architecture: all
Version: 2.2.8
Replaces: apache-cassandra1
Depends: openjdk-7-jre-headless | java7-runtime, adduser, python (>= 2.7)
Recommends: ntp | time-daemon
Suggests: cassandra-tools
Conflicts: apache-cassandra1
Conffiles:
 /etc/bash_completion.d/nodetool 59a42122e2b996bd00eb6c3abf0b1392
 /etc/cassandra/cassandra-env.sh fb7db933755d7aba621db8fae10ca0e1
 /etc/cassandra/cassandra-rackdc.properties 560a25f2805cc316a2981a50dafd4e6b
 /etc/cassandra/cassandra-topology.properties 5f10b88bcaa0593900d83aa769645af9
 /etc/cassandra/cassandra.yaml 5d7184b2c022bc73eddde4bc005340dc
 /etc/cassandra/commitlog_archiving.properties 844cc7ba84c53ac4ae20103df4450dc8
 /etc/cassandra/logback-tools.xml ed9655b5f87b308128b3d2cd19d1a679
 /etc/cassandra/logback.xml b7615209f6ede3d987f5fa06f183b726
 /etc/cassandra/triggers/README.txt 3ab8b4b7503a307349813a3a969fc4f1
 /etc/default/cassandra 98a0a8e9283cc085b8eddee9da28f778
 /etc/init.d/cassandra 8ade9117ca7880af1c062453912a31eb
 /etc/security/limits.d/cassandra.conf 816e1a79629c0491f93e2caad5bb9827
 /etc/sysctl.d/cassandra.conf 7fabde6fe4a64f152fad7e61b1c6434d
Description: distributed storage system for structured data
 Cassandra is a distributed (peer-to-peer) system for the management
 and storage of structured data.
Homepage: http://cassandra.apache.org
mshuler@hana:~$ 
mshuler@hana:~$ echo edited sources.list for 30x to upgrade
edited sources.list for 30x to upgrade
mshuler@hana:~$ 
mshuler@hana:~$ apt-cache policy cassandra
cassandra:
  Installed: 2.2.8
  Candidate: 3.0.9
  Version table:
     3.0.9 0
        500 http://www.apache.org/dist/cassandra/debian/ 30x/main amd64 Packages
 *** 2.2.8 0
        100 /var/lib/dpkg/status
mshuler@hana:~$ sudo apt-get install cassandra                    
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  cassandra-tools
The following packages will be upgraded:
  cassandra
1 upgraded, 0 newly installed, 0 to remove and 15 not upgraded.
Need to get 24.5 MB of archives.
After this operation, 961 kB of additional disk space will be used.
Get:1 http://www.apache.org/dist/cassandra/debian/ 30x/main cassandra all 3.0.9 [24.5 MB]
Fetched 24.5 MB in 10s (2,342 kB/s)                                                      
                                                                              
Reading changelogs... Done
(Reading database ... 171251 files and directories currently installed.)
Preparing to unpack .../cassandra_3.0.9_all.deb ...
Unpacking cassandra (3.0.9) over (2.2.8) ...
Processing triggers for systemd (215-17+deb8u5) ...
Setting up cassandra (3.0.9) ...
Installing new version of config file /etc/cassandra/cassandra-env.sh ...
Installing new version of config file /etc/cassandra/cassandra.yaml ...
Installing new version of config file /etc/init.d/cassandra ...
vm.max_map_count = 1048575
net.ipv4.tcp_keepalive_time = 300
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
Processing triggers for systemd (215-17+deb8u5) ...
mshuler@hana:~$ 
mshuler@hana:~$ echo since no configs were edited, config file replacements are expected for
defaults
since no configs were edited, config file replacements are expected for defaults
mshuler@hana:~$ 
mshuler@hana:~$ dpkg --status cassandra                                                  
           
Package: cassandra
Status: install ok installed
Priority: extra
Section: misc
Installed-Size: 32491
Maintainer: Eric Evans <eevans@apache.org>
Architecture: all
Version: 3.0.9
Replaces: apache-cassandra1
Depends: openjdk-8-jre-headless | java8-runtime, adduser, python (>= 2.7)
Recommends: ntp | time-daemon
Suggests: cassandra-tools
Conflicts: apache-cassandra1
Conffiles:
 /etc/cassandra/cassandra-env.sh 1c70212dc68079356276f6109a910ff1
 /etc/cassandra/cassandra-rackdc.properties 560a25f2805cc316a2981a50dafd4e6b
 /etc/cassandra/cassandra-topology.properties 5f10b88bcaa0593900d83aa769645af9
 /etc/cassandra/cassandra.yaml 74bec6525e07fbfab217b4b4d69adcf4
 /etc/cassandra/commitlog_archiving.properties 844cc7ba84c53ac4ae20103df4450dc8
 /etc/cassandra/jvm.options 0c11158d183014b4716fb73ab65c7a5b
 /etc/cassandra/logback-tools.xml ed9655b5f87b308128b3d2cd19d1a679
 /etc/cassandra/logback.xml b7615209f6ede3d987f5fa06f183b726
 /etc/cassandra/triggers/README.txt 3ab8b4b7503a307349813a3a969fc4f1
 /etc/default/cassandra 98a0a8e9283cc085b8eddee9da28f778
 /etc/init.d/cassandra f088f1623ed01ef1affc4a4755d85474
 /etc/security/limits.d/cassandra.conf 816e1a79629c0491f93e2caad5bb9827
 /etc/sysctl.d/cassandra.conf 7fabde6fe4a64f152fad7e61b1c6434d
 /etc/bash_completion.d/nodetool 59a42122e2b996bd00eb6c3abf0b1392 obsolete
Description: distributed storage system for structured data
 Cassandra is a distributed (peer-to-peer) system for the management
 and storage of structured data.
Homepage: http://cassandra.apache.org
mshuler@hana:~$ 
mshuler@hana:~$ cqlsh
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.0.9 | CQL spec 3.4.0 | Native protocol v4]
Use HELP for help.
cassandra@cqlsh> 
mshuler@hana:~$ 
mshuler@hana:~$ sudo service cassandra stop
mshuler@hana:~$ 
mshuler@hana:~$ echo edit cassandra.yaml..
edit cassandra.yaml..
mshuler@hana:~$ 
mshuler@hana:~$ echo ..and remove all previous data
..and remove all previous data
mshuler@hana:~$ 
mshuler@hana:~$ sudo sed -i 's/Test Cluster/Prod Cluster/' /etc/cassandra/cassandra.yaml 
mshuler@hana:~$ sudo rm -r /var/lib/cassandra/
commitlog/         data/              hints/             .oracle_jre_usage/ saved_caches/
     
mshuler@hana:~$ sudo rm -r /var/lib/cassandra/*
mshuler@hana:~$ 
mshuler@hana:~$ sudo service cassandra start
mshuler@hana:~$ 
mshuler@hana:~$ cqlsh
Connected to Prod Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.0.9 | CQL spec 3.4.0 | Native protocol v4]
Use HELP for help.
cassandra@cqlsh> 
mshuler@hana:~$ 
mshuler@hana:~$ echo OK, now we upgrade to 3.9
OK, now we upgrade to 3.9
mshuler@hana:~$ 
mshuler@hana:~$ apt-cache policy cassandra
cassandra:
  Installed: 3.0.9
  Candidate: 3.9
  Version table:
     3.9 0
        500 http://www.apache.org/dist/cassandra/debian/ 39x/main amd64 Packages
 *** 3.0.9 0
        100 /var/lib/dpkg/status
mshuler@hana:~$ sudo apt-get install cassandra
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  cassandra-tools
The following packages will be upgraded:
  cassandra
1 upgraded, 0 newly installed, 0 to remove and 15 not upgraded.
Need to get 28.7 MB of archives.
After this operation, 5,062 kB of additional disk space will be used.
Get:1 http://www.apache.org/dist/cassandra/debian/ 39x/main cassandra all 3.9 [28.7 MB]
Fetched 28.7 MB in 11s (2,468 kB/s)                                                      
                                                                              
Reading changelogs... Done
(Reading database ... 171251 files and directories currently installed.)
Preparing to unpack .../archives/cassandra_3.9_all.deb ...
Unpacking cassandra (3.9) over (3.0.9) ...
Processing triggers for systemd (215-17+deb8u5) ...
Setting up cassandra (3.9) ...
Installing new version of config file /etc/cassandra/cassandra-env.sh ...

Configuration file '/etc/cassandra/cassandra.yaml'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** cassandra.yaml (Y/I/N/O/D/Z) [default=N] ? d

Configuration file '/etc/cassandra/cassandra.yaml'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** cassandra.yaml (Y/I/N/O/D/Z) [default=N] ? 
Installing new version of config file /etc/cassandra/jvm.options ...
vm.max_map_count = 1048575
net.ipv4.tcp_keepalive_time = 300
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
mshuler@hana:~$ 
mshuler@hana:~$ echo as expected, we were prompted for conffile differing from the default
installed with 3.0.9
as expected, we were prompted for conffile differing from the default installed with 3.0.9
mshuler@hana:~$ 
mshuler@hana:~$ echo the operator can look at a diff, keep the old one, etc.
the operator can look at a diff, keep the old one, etc.
mshuler@hana:~$ 
mshuler@hana:~$ ls -l /etc/cassandra/cassandra.yaml*
-rw-r--r-- 1 root root 45556 Oct 20 13:14 /etc/cassandra/cassandra.yaml
-rw-r--r-- 1 root root 51739 Sep 26 10:05 /etc/cassandra/cassandra.yaml.dpkg-dist
{noformat}

> Debian Package does not prompt the user to review the config files; it just replaces
them causing trouble (since the daemon starts by default)
> ----------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-10872
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-10872
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Packaging
>         Environment: Ubuntu 12.04, Cassandra 2.0.16 -> 2.0.17
>            Reporter: Vasilis
>            Assignee: Michael Shuler
>            Priority: Critical
>              Labels: debian, packaging
>             Fix For: 2.1.x, 2.2.x, 3.0.x, 3.x
>
>
> We run Cassandra 2.0.16 on Ubuntu 12.04 and were trying to upgrade to 2.0.17 due to CASSANDRA-9662.
The problem is that during the upgrade the we were not prompted how to handle cassandra-env.sh
and cassandra-rackdc.properties. 
> The output from the upgrade:
> {panel}
> ...
> Setting up cassandra (2.0.17) ...
> Installing new version of config file /etc/cassandra/cassandra-env.sh ...
> Installing new version of config file /etc/cassandra/cassandra-rackdc.properties ...
> vm.max_map_count = 1048575
> net.ipv4.tcp_keepalive_time = 300
> ...
> {panel}
> This meant that the nodes started automatically after the install with the wrong DC name.

> I don't think that these config files should have been replaced without the admin being
asked; this doesn't appear to comply with standard Debian packages.
> Secondly if CASSANDRA-2356 was implemented the problem would not be as severe; i.e. it
would be possible to workaround this issue. Whereas currently, there is no way to prevent
the node when upgraded from starting in the wrong DC.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message