# Elasticsearch search migration issues from 1.5.2 to 2.3.3

**URL:** <https://discuss.elastic.co/t/elasticsearch-search-migration-issues-from-1-5-2-to-2-3-3/51897>\
**Category:** Elasticsearch\
**Created:** [June 6, 2016, 5:50am UTC](https://discuss.elastic.co/t/elasticsearch-search-migration-issues-from-1-5-2-to-2-3-3/51897 "2016-06-06T05:50:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![gayathri](https://avatars.discourse-cdn.com/v4/letter/g/838e76/32.png) [@gayathri](https://discuss.elastic.co/u/gayathri)\
**Post date:** [June 6, 2016, 5:50am UTC](https://discuss.elastic.co/t/elasticsearch-search-migration-issues-from-1-5-2-to-2-3-3/51897/1 "2016-06-06T05:50:07Z")

</div>

Hi Team,

**Facing restart issues when migrating elasticsearch version from 1.5.2 to 2.3.3**  
**getting below error on executing " service elasticsearch restart" as root;**

[ERROR][bootstrap] Exception  
java.lang.RuntimeException: don't run elasticsearch as root.  
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:93)  
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:144)  
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:270)  
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)

**tried the command as user, but getting below error:**

Failed to restart elasticsearch.service: Interactive authentication required.  
[FAILED]

**PFB, script for service command:**

#!/bin/sh

# 

# elasticsearch

# 

# chkconfig: 2345 80 20

# description: Starts and stops a single elasticsearch instance on this system

# 

### BEGIN INIT INFO

# Provides: Elasticsearch

# Required-Start: $network $named

# Required-Stop: $network $named

# Default-Start: 2 3 4 5

# Default-Stop: 0 1 6

# Short-Description: This service manages the elasticsearch daemon

# Description: Elasticsearch is a very scalable, schema-free and high-performance search solution supporting multi-tenancy and near realtime search.

### END INIT INFO

# 

# init.d / servicectl compatibility (openSUSE)

# 

if [-f /etc/rc.status]; then  
. /etc/rc.status  
rc\_reset  
fi

# 

# Source function library.

# 

if [-f /etc/rc.d/init.d/functions]; then  
. /etc/rc.d/init.d/functions  
fi

exec="/opt/elasticsearch/elasticsearch-2.3.3/bin/elasticsearch"  
prog="elasticsearch"  
pidfile=/var/run/elasticsearch/${prog}.pid

[-e /etc/sysconfig/$prog] && . /etc/sysconfig/$prog

export ES\_USER=root  
export ES\_group=root  
export ES\_HEAP\_SIZE  
export ES\_HEAP\_NEWSIZE  
export ES\_DIRECT\_SIZE  
export ES\_JAVA\_OPTS  
export JAVA\_HOME=/usr/java/default

lockfile=/var/lock/subsys/$prog

# backwards compatibility for old config sysconfig files, pre 0.90.1

if [-n $USER] && [-z $ES\_USER] ; then  
ES\_USER=$USER  
fi

checkJava() {  
if [-x "$JAVA\_HOME/bin/java"]; then  
JAVA="$JAVA\_HOME/bin/java"  
else  
JAVA=`which java`  
fi

```
if [! -x "$JAVA"]; then
    echo "Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME"
    exit 1
fi

```

}

start() {  
checkJava  
[-x $exec] || exit 5  
[-f $CONF\_FILE] || exit 6  
if [-n "$MAX\_LOCKED\_MEMORY" -a -z "$ES\_HEAP\_SIZE"]; then  
echo "MAX\_LOCKED\_MEMORY is set - ES\_HEAP\_SIZE must also be set"  
return 7  
fi  
if [-n "$MAX\_OPEN\_FILES"]; then  
ulimit -n $MAX\_OPEN\_FILES  
fi  
if [-n "$MAX\_LOCKED\_MEMORY"]; then  
ulimit -l $MAX\_LOCKED\_MEMORY  
fi  
if [-n "$MAX\_MAP\_COUNT"]; then  
sysctl -q -w vm.max\_map\_count=$MAX\_MAP\_COUNT  
fi  
if [-n "$WORK\_DIR"]; then  
mkdir -p "$WORK\_DIR"  
chown "$ES\_USER":"$ES\_GROUP" "$WORK\_DIR"  
fi  
echo -n $"Starting $prog: "  
# if not running, start it up here, usually something like "daemon $exec"  
daemon --user $ES\_USER --pidfile $pidfile $exec -p $pidfile -d -Des.default.path.home=$ES\_HOME -Des.default.path.logs=$LOG\_DIR -Des.default.path.data=$DATA\_DIR -Des.default.path.work=$WORK\_DIR -Des.default.path.conf=$CONF\_DIR  
retval=$?  
echo  
[$retval -eq 0] && touch $lockfile  
return $retval  
}

stop() {  
echo -n $"Stopping $prog: "  
# stop it here, often "killproc $prog"  
killproc -p $pidfile -d 20 $prog  
retval=$?  
echo  
[$retval -eq 0] && rm -f $lockfile  
return $retval  
}

restart() {  
stop  
start  
}

reload() {  
restart  
}

force\_reload() {  
restart  
}

rh\_status() {  
# run checks to determine if the service is running or use generic status  
status -p $pidfile $prog  
}

rh\_status\_q() {  
rh\_status \>/dev/null 2\>&1  
}

case "$1" in  
start)  
rh\_status\_q && exit 0  
$1  
;;  
stop)  
rh\_status\_q || exit 0  
$1  
;;  
restart)  
$1  
;;  
reload)  
rh\_status\_q || exit 7  
$1  
;;  
force-reload)  
force\_reload  
;;  
status)  
rh\_status  
;;  
condrestart|try-restart)  
rh\_status\_q || exit 0  
restart  
;;  
\*)  
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"  
exit 2  
esac  
exit $?

**command: "/opt/elasticsearch/elasticsearch-2.3.3/bin/elasticsearch" is working for me . But i don't think it will retain across the sessions....**

Could you please assist?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 6, 2016, 6:04am UTC](https://discuss.elastic.co/t/elasticsearch-search-migration-issues-from-1-5-2-to-2-3-3/51897/2 "2016-06-06T06:04:44Z")

</div>

Why not use the deb/rpm packages and the init scripts in those?

---

<div class="post-metadata">

**Author:** ![gayathri](https://avatars.discourse-cdn.com/v4/letter/g/838e76/32.png) [@gayathri](https://discuss.elastic.co/u/gayathri)\
**Post date:** [June 6, 2016, 6:28am UTC](https://discuss.elastic.co/t/elasticsearch-search-migration-issues-from-1-5-2-to-2-3-3/51897/3 "2016-06-06T06:28:06Z")

</div>

Hi,

I am new to this. please let me know the location where we can put the init scripts. We could not find deb/rpm package.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 6, 2016, 6:51am UTC](https://discuss.elastic.co/t/elasticsearch-search-migration-issues-from-1-5-2-to-2-3-3/51897/4 "2016-06-06T06:51:19Z")

</div>

[https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-repositories.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-repositories.html)

---

<div class="post-metadata">

**Author:** ![gayathri](https://avatars.discourse-cdn.com/v4/letter/g/838e76/32.png) [@gayathri](https://discuss.elastic.co/u/gayathri)\
**Post date:** [June 16, 2016, 7:31am UTC](https://discuss.elastic.co/t/elasticsearch-search-migration-issues-from-1-5-2-to-2-3-3/51897/5 "2016-06-16T07:31:00Z")

</div>

OK, Thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 10:43pm UTC](https://discuss.elastic.co/t/elasticsearch-search-migration-issues-from-1-5-2-to-2-3-3/51897/6 "2017-07-05T22:43:27Z")

</div>


