How to run yugabyte-db yugastore application locally?

微笑、不失礼 提交于 2020-01-16 10:33:00

问题


I am using yugabyte-db-1.3.0 and am trying to run yugabyte e-commerce example application, yugastore locally on CentOS7 by following instructions in its README.md, as follows:

a) downloaded and extracted application, yugastore to /var/www/html/yugastore
b) ./bin/yb-ctl start
c) cd /var/www/html/yugastore
c) yum install -y nodejs
d) npm install cassandra-driver
e) npm install redis
f) npm install async
g) ./bin/yb-ctl setup_redis
h) npm install
i) npm install --save core-js@^3
j) npm start

I am getting error, as follows:

[root@srvr0 yugastore]# npm start

> yugastore@0.0.0 start /var/www/html/yugastore
> supervisor ./bin/www


Running node-supervisor with
  program './bin/www'
  --watch '.'
  --extensions 'node,js,/bin/www'
  --exec 'node'

Starting child process with 'node ./bin/www'
Watching directory '/var/www/html/yugastore' for changes.
Press rs for restarting the process.
DB host: 127.0.0.1
/var/www/html/yugastore/ui/build/index.html
Error: ENOENT: no such file or directory, stat '/var/www/html/yugastore/ui/build/index.html'
    at Error (native)
GET /yugastore/ui/build/index.html 404 58.690 ms - 143

Please help me in resolving the issue.

Update1:

Much Thanks to Mr. Dorian
Got some deprecation warnings, as I am using older CentOS7. Just managed to bring up the application with the following steps:

cd ~
rm -rf /opt/yugabyte
mkdir -p /opt/yugabyte
mkdir -p /opt/yugabyte/data
cd /tmp
wget https://downloads.yugabyte.com/yugabyte-1.3.0.0-linux.tar.gz
tar -xvzf /tmp/yugabyte/yugabyte-1.3.0.0-linux.tar.gz -C /opt/yugabyte
cd /opt/yugabyte/yugabyte-1.3.0.0
/opt/yugabyte/yugabyte-1.3.0.0/bin/post_install.sh
/opt/yugabyte/yugabyte-1.3.0.0/bin/yb-ctl --data_dir "/opt/yugabyte/data" destroy
/opt/yugabyte/yugabyte-1.3.0.0/bin/yb-ctl --data_dir "/opt/yugabyte/data" create
/opt/yugabyte/yugabyte-1.3.0.0/bin/yb-ctl --data_dir "/opt/yugabyte/data" stop
/opt/yugabyte/yugabyte-1.3.0.0/bin/yb-ctl --data_dir "/opt/yugabyte/data" start
/opt/yugabyte/yugabyte-1.3.0.0/bin/yb-ctl --data_dir "/opt/yugabyte/data" setup_redis

cd ~
rm -rf /var/www/html/yugastore
cd /tmp
git clone https://github.com/yugabyte/yugastore
cd /tmp/yugastore
tar -cvzf /tmp/yugastore.tar.gz .
mkdir -p /var/www/html/yugastore
tar -xvzf /tmp/yugastore.tar.gz -C /var/www/html/yugastore

cd /var/www/html/yugastore
npm install cassandra-driver
npm install redis
npm install async
npm install
npm install --save core-js@^3
node models/yugabyte/db_init.js
npm start

###In another terminal:
cd /var/www/html/yugastore/ui
npm install
npm start

回答1:


You are using a very old version of YugabyteDB. 2.0.10 is latest as of Jan 9 2020.

And looks like you have a path mismatch.Can you verify that the files are there and the build finished correctly ?

Download & install (https://download.yugabyte.com)the db:

wget https://downloads.yugabyte.com/yugabyte-2.0.10.0-linux.tar.gz
tar xvfz yugabyte-2.0.10.0-linux.tar.gz && cd yugabyte-2.0.10.0/
./bin/post_install.sh
./bin/yb-ctl create
./bin/yb-ctl setup_redis

Download and install yugastore: (https://github.com/yugabyte/yugastore#run-locally)

git clone https://github.com/yugabyte/yugastore
cd yugastore
node models/yugabyte/db_init.js
npm start

in another shell:

cd yugastore/ui
npm install # First time only
npm start

A new tab will be opened with the website.



来源:https://stackoverflow.com/questions/59659395/how-to-run-yugabyte-db-yugastore-application-locally

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!