Need to change IPs of a SciDB cluster


#1

Our 12 node SciDB cluster has been moved to a new location. As a consequence of the move, all of the nodes were re-IPed, which was a surprise to me. I’d like to bring these SciDB instances back online. Is it as simple as modifying the IP addresses in config.ini? Or do I need to change something else as well?

Thanks,
Lisa


#2

Hi Lisa!

Yes… it is for reasons like this we recommend folks use hostnames instead of IPs.

If you need to keep the data, you’ll have to do some Postgres surgery. Postgres has a database dedicated to storing your cluster’s catalog. It is named the same as your SciDB installation (the string that goes after “scidb.py startall”). That database contains a table called “instance” with the ip addresses / host names. Here’s an example:

$ sudo -u postgres psql
psql (8.4.20)
Type "help" for help.

postgres=# \c mydb
psql (8.4.20)
You are now connected to database "mydb".
mydb=# select * from instance
mydb-# ;
 instance_id |   host    | port |        online_since        |                        path                        
-------------+-----------+------+----------------------------+----------------------------------------------------
           3 | 127.0.0.1 | 1242 | 2015-09-19 02:56:36.163693 | /home/apoliakov/workspace/15.7/stage/DB-mydb/000/3
           2 | 127.0.0.1 | 1241 | 2015-09-19 02:56:36.177369 | /home/apoliakov/workspace/15.7/stage/DB-mydb/000/2
           0 | 127.0.0.1 | 1239 | 2015-09-19 02:56:36.207    | /home/apoliakov/workspace/15.7/stage/DB-mydb/000/0
           1 | 127.0.0.1 | 1240 | 2015-09-19 02:56:36.271183 | /home/apoliakov/workspace/15.7/stage/DB-mydb/000/1
(4 rows)

You’ll need to carefully update the postgres table like this:

mydb=# update instance set host='127.0.0.2' where instance_id = 2 or instance_id=3;
UPDATE 2
mydb=# select * from instance                                                      
;
 instance_id |   host    | port |        online_since        |                        path                        
-------------+-----------+------+----------------------------+----------------------------------------------------
           3 | 127.0.0.2 | 1242 | 2015-09-19 02:56:36.163693 | /home/apoliakov/workspace/15.7/stage/DB-mydb/000/3
           2 | 127.0.0.2 | 1241 | 2015-09-19 02:56:36.177369 | /home/apoliakov/workspace/15.7/stage/DB-mydb/000/2
           0 | 127.0.0.1 | 1239 | 2015-09-19 02:56:36.207    | /home/apoliakov/workspace/15.7/stage/DB-mydb/000/0
           1 | 127.0.0.1 | 1240 | 2015-09-19 02:56:36.271183 | /home/apoliakov/workspace/15.7/stage/DB-mydb/000/1
(4 rows)

So the procedure would be

  1. scidb.py stopall mydb
  2. update postgres to put in new ip addresses
  3. change the config.ini file
  4. restart and check the data

Obviously if data retention doesn’t matter you can simply reinit. This help? Let us know.


#3

Hi Alex,
That did it, thanks very much! I took the opportunity to switch to hostnames so I’ll hopefully never have to do this again :wink:.

Bye,
Lisa