Scenario:
Installed the CouchBase Server and faced the following issue:
IP address seems to have changed. Unable to listen on 'ns_1@169.254.20.219'
Got it resolved by following the steps on couchbase docs Handling IP Addresses
So, my file C:\Program Files\Couchbase\Server\bin\service_register.bat
set NS_BIN=%~dp0
set NS_ROOT=%NS_BIN%..
set NS_ERTS=%NS_BIN%erlang\erts-5.8.3\bin
pushd "%NS_ROOT%"
for /f "tokens=1* delims=" %%a in ('cmd /q/c "type bin\ipaddr.out"') do set IP_ADDR=%%a
set NS_NAME=ns_1@192.168.3.53
if not "%1"=="" set NS_NAME=%1
pushd "%NS_ROOT%"
"%NS_ERTS%\erlsrv.exe" add CouchbaseServer -stopaction "ns_bootstrap:stop()." -name %NS_NAME% -InternalServiceName CouchbaseServer -onfail restart -workdir "%NS_ROOT%" -args "+A 16 -setcookie nocookie -ns_server config_path \\\".\\etc\\couchbase\\static_config\\\" -kernel inet_dist_listen_min 21100 inet_dist_listen_max 21299 -run ns_bootstrap override_resolver -ns_server restart_script \\\".\\bin\\service_reregister.bat\\\" -- %2 %3 %4 %5 %6 %7 %8 %9"
popd
set serviceId=""
for /f "tokens=2 delims==" %%s in ('sc GetKeyName CouchbaseServer') do set serviceId=%%s
sc description %serviceId% "Couchbase Server Service"
I started using it with Node.JS and was able to store data, etc..
Issue: My IP address is dynamic and If I follow the same steps to fix the same issue i.e. 'IP address seems to have changed. Unable to listen on 'ns_1@192.168.3.53' and change it to new IP address say 192.168.3.58. Then I am able to fix the issue. But I am losing all configs. So, the server starts asking all setup (from creating admin's account), ultimately my database and data is getting lost.
Question: How can I get back my old database when IP address was 192.168.3.53 and why it dumps all the things when IP is changed in service_register.bat?
Advance Thanks
I haven't tested but procedure here: http://www.couchbase.com/docs/couchbase-manual-1.8/couchbase-backup-restore-restore.html#couchbase-backup-restore-prevstate-same should allow you to get back your data.
I.e. when node detects it's out of cluster, it will reset itself. But it will leave data files intact until you try to set it up again or join it to cluster. It was done exactly for cases when failover was accidental or for issues like yours.