如何在本地运行yugabyte-db yugastore应用程序? [英] How to run yugabyte-db yugastore application locally?

查看:118
本文介绍了如何在本地运行yugabyte-db yugastore应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用yugabyte-db-1.3.0,并尝试按照其README.md中的说明在CentOS7上本地运行yugabyte电子商务示例应用程序yugastore,如下所示:

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

请帮助我解决问题.

Update1:​​

Update1:

非常感谢Dorian先生
当我使用较旧的CentOS7时,出现了一些弃用警告.只需执行以下步骤即可启动该应用程序:

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

推荐答案

您使用的是YugabyteDB的非常旧的版本. 2.0.10 是2020年1月9日的最新信息.

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 ?

下载&安装( https://download.yugabyte.com)数据库:

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

下载并安装yugastore :( https://github.com/yugabyte/yugastore#run -本地)

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

在另一个外壳中:

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

网站将打开一个新标签.

A new tab will be opened with the website.

这篇关于如何在本地运行yugabyte-db yugastore应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆