Java Scalardb QA应用程序无法正确使用Azure Cosmos DB
我尝试用Azure Cosmos DB启动scalardb后端。Spring引导应用程序显示为已启动。但是我无法使用端口8090访问QA后端应用程序。端口8090未列在侦听端口中Java Scalardb QA应用程序无法正确使用Azure Cosmos DB,java,azure,spring-boot,azure-cosmosdb,scalardb,Java,Azure,Spring Boot,Azure Cosmosdb,Scalardb,我尝试用Azure Cosmos DB启动scalardb后端。Spring引导应用程序显示为已启动。但是我无法使用端口8090访问QA后端应用程序。端口8090未列在侦听端口中lsof-i-P-n | grep LISTEN QA后端应用程序 当我们将其与QA前端应用程序连接时,它会显示一条错误消息登录过程中发生的错误 QA前端应用程序 复制步骤 Cosmos数据库帐户创建 使用Core(SQL)API创建Azure Cosmos DB帐户 将默认一致性更改为STRONG 使用创建架构 s
lsof-i-P-n | grep LISTEN
QA后端应用程序
当我们将其与QA前端应用程序连接时,它会显示一条错误消息登录过程中发生的错误
QA前端应用程序
复制步骤
Cosmos数据库帐户创建
使用Core(SQL)
API创建Azure Cosmos DB帐户
将默认一致性更改为STRONG
使用创建架构
schema.json
"qa.question": {
"transaction": false,
"partition-key": [
"date"
],
"clustering-key": [
"created_at"
],
"columns": {
"date": "TEXT",
"created_at": "BIGINT",
"title": "TEXT",
"user": "TEXT",
"context": "TEXT",
"updated_at": "BIGINT",
"number_of_answers": "INT"
},
"ru": 400
},
"qa.answer": {
"transaction": false,
"partition-key": [
"question_created_at"
],
"clustering-key": [
"created_at"
],
"columns": {
"question_created_at": "BIGINT",
"context": "TEXT",
"user": "TEXT",
"created_at": "BIGINT"
},
"ru": 400
},
"qa.account": {
"transaction": false,
"partition-key": [
"email"
],
"clustering-key": [],
"columns": {
"email": "TEXT",
"password": "TEXT"
},
"ru": 400
},
"qa.firstQuestionDate": {
"transaction": false,
"partition-key": [
"id"
],
"clustering-key": [],
"columns": {
"id": "TEXT",
"first_question_date": "TEXT"
},
"ru": 400
}
}
QA后端应用程序设置
应用程序克隆自
使用cosmos db详细信息更新scalardb.properties(backend/QA/src/main/resources/scalardb.properties)文件
scalardb.properties
# Comma separated contact points
scalar.db.contact_points=<Cosmos DB URI>
# Port number for all the contact points. Default port number for each database is used if empty.
#scalar.db.contact_port=
# Credential information to access the database
scalar.db.username=
scalar.db.password=<PRIMARY KEY>
# Storage implementation. Either cassandra or cosmos can be set. Default storage is cassandra.
scalar.db.storage=cosmos
执行export SPRING\u PROFILES\u ACTIVE=“storage”
使用sh gradlew bootRun
命令启动后端QA应用程序
设置前端应用程序
转到/frontend
执行make
命令
在浏览器中打开QA应用程序http://localhost:8080/#/login
QA前端应用程序显示一条错误消息当我们尝试登录时,在登录过程中发生了一个错误
QA后端应用程序不以端口8090启动
有人已经解决了这个问题吗?你能提出一些解决这个问题的建议吗
....
dependencies {
//Scalar DB library
compile group: 'com.scalar-labs', name: 'scalardb', version: '2.2.0'
//Spring dependencies
compile("org.springframework.boot:spring-boot-starter-web:${springBootVersion}") {
exclude(group: 'ch.qos.logback')
}
compile("org.springframework.boot:spring-boot-starter:${springBootVersion}") {
exclude(group: 'ch.qos.logback')
}
//Spring security layer for authentication
compile("org.springframework.boot:spring-boot-starter-security:${springBootVersion}") {
exclude(group: 'ch.qos.logback')
}
//Handle Json Web Token authentication
compile group: 'io.jsonwebtoken', name: 'jjwt', version: '0.9.1'
testCompile group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: "${springBootVersion}"
}