我正在尝试在Openshift平台上部署hyperledger / fabric-couchdb:x86_64-1.0.1。 我的环境细节: openshift v3.4.1.44 kubernetes v1.4.0 + 776c994
我使用以下yaml脚本部署了fabric-couchDB。 我正在使用admin用户运行yaml。此用户在openshift中具有受限访问权限。
apiVersion: v1
items:
#creating Shared PVC
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
io.kompose.service: shared-pvc
name: shared-pvc
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 100Mi
#creating ImageStream couchdb
- apiVersion: v1
kind: ImageStream
metadata:
creationTimestamp: null
name: couchdb
spec:
tags:
- annotations: null
from:
kind: DockerImage
name: hyperledger/fabric-couchdb:x86_64-1.0.1
generation: null
importPolicy: {}
name: x86_64-1.0.1
status:
dockerImageRepository: ""
#Creating couchdb POD
- apiVersion: v1
kind: Pod
metadata:
name: couchdb
spec:
containers:
- env:
- name: DB_URL
value: http://localhost:5984/member_db
- name: COUCHDB_USER
value: admin
- name: COUCHDB_PASSWORD
value: password
- name: CORE_LOGGING_LEVEL
value: DEBUG
image: hyperledger/fabric-couchdb:x86_64-1.0.1
imagePullPolicy: IfNotPresent
name: couchdb
ports:
- containerPort: 5984
resources: {}
volumeMounts:
- mountPath: /opt/couchdb/etc/local.d
name: couchdb-claim0
- mountPath: /opt/couchdb/data
name: couchdb-claim1
restartPolicy: Always
volumes:
- name: couchdb-claim0
persistentVolumeClaim:
claimName: shared-pvc
- name: couchdb-claim1
emptyDir: {}
test: false
triggers:
- type: ConfigChange
- imageChangeParams:
automatic: true
containerNames:
- couchdb
from:
kind: ImageStreamTag
name: couchdb:x86_64-1.0.1
type: ImageChange
kind: List
metadata: {}
使用此脚本POD可以创建并成功运行。 在终端日志下面生成。
[info] 2017-08-23T06:24:51.030925Z nonode@nohost <0.7.0> -------- Application couch_log started on node nonode@nohost
[info] 2017-08-23T06:24:51.035923Z nonode@nohost <0.7.0> -------- Application folsom started on node nonode@nohost
[info] 2017-08-23T06:24:51.074775Z nonode@nohost <0.7.0> -------- Application couch_stats started on node nonode@nohost
[info] 2017-08-23T06:24:51.074892Z nonode@nohost <0.7.0> -------- Application khash started on node nonode@nohost
[info] 2017-08-23T06:24:51.084266Z nonode@nohost <0.7.0> -------- Application couch_event started on node nonode@nohost
[info] 2017-08-23T06:24:51.090430Z nonode@nohost <0.7.0> -------- Application ibrowse started on node nonode@nohost
[info] 2017-08-23T06:24:51.096120Z nonode@nohost <0.7.0> -------- Application ioq started on node nonode@nohost
[info] 2017-08-23T06:24:51.096256Z nonode@nohost <0.7.0> -------- Application mochiweb started on node nonode@nohost
[info] 2017-08-23T06:24:51.096382Z nonode@nohost <0.7.0> -------- Application oauth started on node nonode@nohost
[info] 2017-08-23T06:24:51.105579Z nonode@nohost <0.198.0> -------- Apache CouchDB 2.0.0 is starting.
[info] 2017-08-23T06:24:51.105638Z nonode@nohost <0.199.0> -------- Starting couch_sup
[notice] 2017-08-23T06:24:51.140601Z nonode@nohost <0.82.0> -------- config: [admins] admin set to -pbkdf2-ea9beb38474607c1ffb9304d288ba2ff93e2f38a,3ecf788116d8c27020f5012f72114bed,10 for reason nil
[notice] 2017-08-23T06:24:51.173160Z nonode@nohost <0.82.0> -------- config: [couchdb] uuid set to 5b92249aebb2e742f2a86b0cfaeca017 for reason nil
[info] 2017-08-23T06:24:51.219024Z nonode@nohost <0.204.0> -------- open_result error {not_found,no_db_file} for _users
[info] 2017-08-23T06:24:51.284558Z nonode@nohost <0.198.0> -------- Apache CouchDB has started. Time to relax.
[info] 2017-08-23T06:24:51.284667Z nonode@nohost <0.198.0> -------- Apache CouchDB has started on http://127.0.0.1:5986/
[info] 2017-08-23T06:24:51.284794Z nonode@nohost <0.7.0> -------- Application couch started on node nonode@nohost
[info] 2017-08-23T06:24:51.284944Z nonode@nohost <0.7.0> -------- Application ets_lru started on node nonode@nohost
[info] 2017-08-23T06:24:51.293670Z nonode@nohost <0.7.0> -------- Application rexi started on node nonode@nohost
[info] 2017-08-23T06:24:51.304787Z nonode@nohost <0.204.0> -------- open_result error {not_found,no_db_file} for _nodes
[info] 2017-08-23T06:24:51.326838Z nonode@nohost <0.204.0> -------- open_result error {not_found,no_db_file} for _dbs
[error] 2017-08-23T06:24:51.327172Z nonode@nohost emulator -------- Error in process <0.287.0> with exit value:
{{badmatch,file_exists},[{mem3_shards,fold,2,[{file,"src/mem3_shards.erl"},{line,156}]},{mem3_sync,initial_sync,1,[{file,"src/mem3_sync.erl"},{line,241}]}]}
[info] 2017-08-23T06:24:51.332055Z nonode@nohost <0.7.0> -------- Application mem3 started on node nonode@nohost
[info] 2017-08-23T06:24:51.332224Z nonode@nohost <0.7.0> -------- Application fabric started on node nonode@nohost
[info] 2017-08-23T06:24:51.345163Z nonode@nohost <0.7.0> -------- Application chttpd started on node nonode@nohost
[notice] 2017-08-23T06:24:51.352322Z nonode@nohost <0.325.0> -------- chttpd_auth_cache changes listener died database_does_not_exist at mem3_shards:load_shards_from_db/6(line:327) <= mem3_shards:load_shards_from_disk/1(line:315) <= mem3_shards:load_shards_from_disk/2(line:331) <= mem3_shards:for_docid/3(line:87) <= fabric_doc_open:go/3(line:38) <= chttpd_auth_cache:ensure_auth_ddoc_exists/2(line:187) <= chttpd_auth_cache:listen_for_changes/1(line:134)
[error] 2017-08-23T06:24:51.352374Z nonode@nohost emulator -------- Error in process <0.326.0> with exit value:
{database_does_not_exist,[{mem3_shards,load_shards_from_db,"_users",[{file,"src/mem3_shards.erl"},{line,327}]},{mem3_shards,load_shards_from_disk,1,[{file,"src/mem3_shards.erl"},{line,315}]},{mem3_shards,load_shards_from_disk,2,[{file,"src/mem3_shards.erl"},{line,331}]},{mem3_shards,for_docid,3,[{file,"src/mem3_shards.erl"},{line,87}]},{fabric_doc_open,go,3,[{file,"src/fabric_doc_open.erl"},{line,38}]},{chttpd_auth_cache,ensure_auth_ddoc_exists,2,[{file,"src/chttpd_auth_cache.erl"},{line,187}]},{chttpd_auth_cache,listen_for_changes,1,[{file,"src/chttpd_auth_cache.erl"},{line,134}]}]}
[info] 2017-08-23T06:24:51.355973Z nonode@nohost <0.7.0> -------- Application couch_index started on node nonode@nohost
[info] 2017-08-23T06:24:51.356033Z nonode@nohost <0.7.0> -------- Application couch_mrview started on node nonode@nohost
[info] 2017-08-23T06:24:51.356059Z nonode@nohost <0.7.0> -------- Application couch_plugins started on node nonode@nohost
[info] 2017-08-23T06:24:51.364246Z nonode@nohost <0.204.0> -------- open_result error {not_found,no_db_file} for _replicator
[notice] 2017-08-23T06:24:51.369132Z nonode@nohost <0.344.0> -------- creating replicator ddoc
[info] 2017-08-23T06:24:51.383827Z nonode@nohost <0.7.0> -------- Application couch_replicator started on node nonode@nohost
[info] 2017-08-23T06:24:51.383960Z nonode@nohost <0.7.0> -------- Application couch_peruser started on node nonode@nohost
[info] 2017-08-23T06:24:51.401242Z nonode@nohost <0.7.0> -------- Application ddoc_cache started on node nonode@nohost
[info] 2017-08-23T06:24:51.417532Z nonode@nohost <0.7.0> -------- Application global_changes started on node nonode@nohost
[info] 2017-08-23T06:24:51.417678Z nonode@nohost <0.7.0> -------- Application jiffy started on node nonode@nohost
[info] 2017-08-23T06:24:51.429375Z nonode@nohost <0.7.0> -------- Application mango started on node nonode@nohost
[info] 2017-08-23T06:24:51.434651Z nonode@nohost <0.7.0> -------- Application setup started on node nonode@nohost
[info] 2017-08-23T06:24:51.434778Z nonode@nohost <0.7.0> -------- Application snappy started on node nonode@nohost
[notice] 2017-08-23T06:24:56.352930Z nonode@nohost <0.325.0> -------- chttpd_auth_cache changes listener died database_does_not_exist at mem3_shards:load_shards_from_db/6(line:327) <= mem3_shards:load_shards_from_disk/1(line:315) <= mem3_shards:load_shards_from_disk/2(line:331) <= mem3_shards:for_docid/3(line:87) <= fabric_doc_open:go/3(line:38) <= chttpd_auth_cache:ensure_auth_ddoc_exists/2(line:187) <= chttpd_auth_cache:listen_for_changes/1(line:134)
[error] 2017-08-23T06:24:56.353035Z nonode@nohost emulator -------- Error in process <0.452.0> with exit value:
{database_does_not_exist,[{mem3_shards,load_shards_from_db,"_users",[{file,"src/mem3_shards.erl"},{line,327}]},{mem3_shards,load_shards_from_disk,1,[{file,"src/mem3_shards.erl"},{line,315}]},{mem3_shards,load_shards_from_disk,2,[{file,"src/mem3_shards.erl"},{line,331}]},{mem3_shards,for_docid,3,[{file,"src/mem3_shards.erl"},{line,87}]},{fabric_doc_open,go,3,[{file,"src/fabric_doc_open.erl"},{line,38}]},{chttpd_auth_cache,ensure_auth_ddoc_exists,2,[{file,"src/chttpd_auth_cache.erl"},{line,187}]},{chttpd_auth_cache,listen_for_changes,1,[{file,"src/chttpd_auth_cache.erl"},{line,134}]}]}
[notice] 2017-08-23T06:25:01.354009Z nonode@nohost <0.325.0> -------- chttpd_auth_cache changes listener died database_does_not_exist at mem3_shards:load_shards_from_db/6(line:327) <= mem3_shards:load_shards_from_disk/1(line:315) <= mem3_shards:load_shards_from_disk/2(line:331) <= mem3_shards:for_docid/3(line:87) <= fabric_doc_open:go/3(line:38) <= chttpd_auth_cache:ensure_auth_ddoc_exists/2(line:187) <= chttpd_auth_cache:listen_for_changes/1(line:134)
[error] 2017-08-23T06:25:01.354101Z nonode@nohost emulator -------- Error in process <0.549.0> with exit value:
{database_does_not_exist,[{mem3_shards,load_shards_from_db,"_users",[{file,"src/mem3_shards.erl"},{line,327}]},{mem3_shards,load_shards_from_disk,1,[{file,"src/mem3_shards.erl"},{line,315}]},{mem3_shards,load_shards_from_disk,2,[{file,"src/mem3_shards.erl"},{line,331}]},{mem3_shards,for_docid,3,[{file,"src/mem3_shards.erl"},{line,87}]},{fabric_doc_open,go,3,[{file,"src/fabric_doc_open.erl"},{line,38}]},{chttpd_auth_cache,ensure_auth_ddoc_exists,2,[{file,"src/chttpd_auth_cache.erl"},{line,187}]},{chttpd_auth_cache,listen_for_changes,1,[{file,"src/chttpd_auth_cache.erl"},{line,134}]}]}
[notice] 2017-08-23T06:25:06.354952Z nonode@nohost <0.325.0> -------- chttpd_auth_cache changes listener died database_does_not_exist at mem3_shards:load_shards_from_db/6(line:327) <= mem3_shards:load_shards_from_disk/1(line:315) <= mem3_shards:load_shards_from_disk/2(line:331) <= mem3_shards:for_docid/3(line:87) <= fabric_doc_open:go/3(line:38) <= chttpd_auth_cache:ensure_auth_ddoc_exists/2(line:187) <= chttpd_auth_cache:listen_for_changes/1(line:134)
[error] 2017-08-23T06:25:06.355051Z nonode@nohost emulator -------- Error in process <0.614.0> with exit value:
{database_does_not_exist,[{mem3_shards,load_shards_from_db,"_users",[{file,"src/mem3_shards.erl"},{line,327}]},{mem3_shards,load_shards_from_disk,1,[{file,"src/mem3_shards.erl"},{line,315}]},{mem3_shards,load_shards_from_disk,2,[{file,"src/mem3_shards.erl"},{line,331}]},{mem3_shards,for_docid,3,[{file,"src/mem3_shards.erl"},{line,87}]},{fabric_doc_open,go,3,[{file,"src/fabric_doc_open.erl"},{line,38}]},{chttpd_auth_cache,ensure_auth_ddoc_exists,2,[{file,"src/chttpd_auth_cache.erl"},{line,187}]},{chttpd_auth_cache,listen_for_changes,1,[{file,"src/chttpd_auth_cache.erl"},{line,134}]}]}
[notice] 2017-08-23T06:25:11.355838Z nonode@nohost <0.325.0> -------- chttpd_auth_cache changes listener died database_does_not_exist at mem3_shards:load_shards_from_db/6(line:327) <= mem3_shards:load_shards_from_disk/1(line:315) <= mem3_shards:load_shards_from_disk/2(line:331) <= mem3_shards:for_docid/3(line:87) <= fabric_doc_open:go/3(line:38) <= chttpd_auth_cache:ensure_auth_ddoc_exists/2(line:187) <= chttpd_auth_cache:listen_for_changes/1(line:134)
[error] 2017-08-23T06:25:11.355906Z nonode@nohost emulator -------- Error in process <0.711.0> with exit value:
{database_does_not_exist,[{mem3_shards,load_shards_from_db,"_users",[{file,"src/mem3_shards.erl"},{line,327}]},{mem3_shards,load_shards_from_disk,1,[{file,"src/mem3_shards.erl"},{line,315}]},{mem3_shards,load_shards_from_disk,2,[{file,"src/mem3_shards.erl"},{line,331}]},{mem3_shards,for_docid,3,[{file,"src/mem3_shards.erl"},{line,87}]},{fabric_doc_open,go,3,[{file,"src/fabric_doc_open.erl"},{line,38}]},{chttpd_auth_cache,ensure_auth_ddoc_exists,2,[{file,"src/chttpd_auth_cache.erl"},{line,187}]},{chttpd_auth_cache,listen_for_changes,1,[{file,"src/chttpd_auth_cache.erl"},{line,134}]}]}
[notice] 2017-08-23T06:25:16.356958Z nonode@nohost <0.325.0> -------- chttpd_auth_cache changes listener died database_does_not_exist at mem3_shards:load_shards_from_db/6(line:327) <= mem3_shards:load_shards_from_disk/1(line:315) <= mem3_shards:load_shards_from_disk/2(line:331) <= mem3_shards:for_docid/3(line:87) <= fabric_doc_open:go/3(line:38) <= chttpd_auth_cache:ensure_auth_ddoc_exists/2(line:187) <= chttpd_auth_cache:listen_for_changes/1(line:134)
[error] 2017-08-23T06:25:16.357344Z nonode@nohost emulator -------- Error in process <0.776.0> with exit value:
{database_does_not_exist,[{mem3_shards,load_shards_from_db,"_users",[{file,"src/mem3_shards.erl"},{line,327}]},{mem3_shards,load_shards_from_disk,1,[{file,"src/mem3_shards.erl"},{line,315}]},{mem3_shards,load_shards_from_disk,2,[{file,"src/mem3_shards.erl"},{line,331}]},{mem3_shards,for_docid,3,[{file,"src/mem3_shards.erl"},{line,87}]},{fabric_doc_open,go,3,[{file,"src/fabric_doc_open.erl"},{line,38}]},{chttpd_auth_cache,ensure_auth_ddoc_exists,2,[{file,"src/chttpd_auth_cache.erl"},{line,187}]},{chttpd_auth_cache,listen_for_changes,1,[{file,"src/chttpd_auth_cache.erl"},{line,134}]}]}
[notice] 2017-08-23T06:25:21.357853Z nonode@nohost <0.325.0> -------- chttpd_auth_cache changes listener died database_does_not_exist at mem3_shards:load_shards_from_db/6(line:327) <= mem3_shards:load_shards_from_disk/1(line:315) <= mem3_shards:load_shards_from_disk/2(line:331) <= mem3_shards:for_docid/3(line:87) <= fabric_doc_open:go/3(line:38) <= chttpd_auth_cache:ensure_auth_ddoc_exists/2(line:187) <= chttpd_auth_cache:listen_for_changes/1(line:134)
[error] 2017-08-23T06:25:21.358180Z nonode@nohost emulator -------- Error in process <0.873.0> with exit value:
{database_does_not_exist,[{mem3_shards,load_shards_from_db,"_users",[{file,"src/mem3_shards.erl"},{line,327}]},{mem3_shards,load_shards_from_disk,1,[{file,"src/mem3_shards.erl"},{line,315}]},{mem3_shards,load_shards_from_disk,2,[{file,"src/mem3_shards.erl"},{line,331}]},{mem3_shards,for_docid,3,[{file,"src/mem3_shards.erl"},{line,87}]},{fabric_doc_open,go,3,[{file,"src/fabric_doc_open.erl"},{line,38}]},{chttpd_auth_cache,ensure_auth_ddoc_exists,2,[{file,"src/chttpd_auth_cache.erl"},{line,187}]},{chttpd_auth_cache,listen_for_changes,1,[{file,"src/chttpd_auth_cache.erl"},{line,134}]}]}
[notice] 2017-08-23T06:25:26.358993Z nonode@nohost <0.325.0> -------- chttpd_auth_cache changes listener died database_does_not_exist at mem3_shards:load_shards_from_db/6(line:327) <= mem3_shards:load_shards_from_disk/1(line:315) <= mem3_shards:load_shards_from_disk/2(line:331) <= mem3_shards:for_docid/3(line:87) <= fabric_doc_open:go/3(line:38) <= chttpd_auth_cache:ensure_auth_ddoc_exists/2(line:187) <= chttpd_auth_cache:listen_for_changes/1(line:134)
[error] 2017-08-23T06:25:26.359290Z nonode@nohost emulator -------- Error in process <0.938.0> with exit value:
{database_does_not_exist,[{mem3_shards,load_shards_from_db,"_users",[{file,"src/mem3_shards.erl"},{line,327}]},{mem3_shards,load_shards_from_disk,1,[{file,"src/mem3_shards.erl"},{line,315}]},{mem3_shards,load_shards_from_disk,2,[{file,"src/mem3_shards.erl"},{line,331}]},{mem3_shards,for_docid,3,[{file,"src/mem3_shards.erl"},{line,87}]},{fabric_doc_open,go,3,[{file,"src/fabric_doc_open.erl"},{line,38}]},{chttpd_auth_cache,ensure_auth_ddoc_exists,2,[{file,"src/chttpd_auth_cache.erl"},{line,187}]},{chttpd_auth_cache,listen_for_changes,1,[{file,"src/chttpd_auth_cache.erl"},{line,134}]}]}
[notice] 2017-08-23T06:25:31.359967Z nonode@nohost <0.325.0> -------- chttpd_auth_cache changes listener died database_does_not_exist at mem3_shards:load_shards_from_db/6(line:327) <= mem3_shards:load_shards_from_disk/1(line:315) <= mem3_shards:load_shards_from_disk/2(line:331) <= mem3_shards:for_docid/3(line:87) <= fabric_doc_open:go/3(line:38) <= chttpd_auth_cache:ensure_auth_ddoc_exists/2(line:187) <= chttpd_auth_cache:listen_for_changes/1(line:134)
[error] 2017-08-23T06:25:31.360380Z nonode@nohost emulator -------- Error in process <0.1019.0> with exit value:
{database_does_not_exist,[{mem3_shards,load_shards_from_db,"_users",[{file,"src/mem3_shards.erl"},{line,327}]},{mem3_shards,load_shards_from_disk,1,[{file,"src/mem3_shards.erl"},{line,315}]},{mem3_shards,load_shards_from_disk,2,[{file,"src/mem3_shards.erl"},{line,331}]},{mem3_shards,for_docid,3,[{file,"src/mem3_shards.erl"},{line,87}]},{fabric_doc_open,go,3,[{file,"src/fabric_doc_open.erl"},{line,38}]},{chttpd_auth_cache,ensure_auth_ddoc_exists,2,[{file,"src/chttpd_auth_cache.erl"},{line,187}]},{chttpd_auth_cache,listen_for_changes,1,[{file,"src/chttpd_auth_cache.erl"},{line,134}]}]}
[notice] 2017-08-23T06:25:36.360980Z nonode@nohost <0.325.0> -------- chttpd_auth_cache changes listener died database_does_not_exist at mem3_shards:load_shards_from_db/6(line:327) <= mem3_shards:load_shards_from_disk/1(line:315) <= mem3_shards:load_shards_from_disk/2(line:331) <= mem3_shards:for_docid/3(line:87) <= fabric_doc_open:go/3(line:38) <= chttpd_auth_cache:ensure_auth_ddoc_exists/2(line:187) <= chttpd_auth_cache:listen_for_changes/1(line:134)
[error] 2017-08-23T06:25:36.361417Z nonode@nohost emulator -------- Error in process <0.1100.0> with exit value:
{database_does_not_exist,[{mem3_shards,load_shards_from_db,"_users",[{file,"src/mem3_shards.erl"},{line,327}]},{mem3_shards,load_shards_from_disk,1,[{file,"src/mem3_shards.erl"},{line,315}]},{mem3_shards,load_shards_from_disk,2,[{file,"src/mem3_shards.erl"},{line,331}]},{mem3_shards,for_docid,3,[{file,"src/mem3_shards.erl"},{line,87}]},{fabric_doc_open,go,3,[{file,"src/fabric_doc_open.erl"},{line,38}]},{chttpd_auth_cache,ensure_auth_ddoc_exists,2,[{file,"src/chttpd_auth_cache.erl"},{line,187}]},{chttpd_auth_cache,listen_for_changes,1,[{file,"src/chttpd_auth_cache.erl"},{line,134}]}]}
以下是我的观察: 1. CouchDB使用nonode @nohost创建节点 2. CouchDB默认数据库_nodes,_dbs,_replicator未创建。
我是否需要任何特定的配置/权限。 我试图分析couchDB源但没有成功:(
答案 0 :(得分:1)
fabric-couchDB映像创建了couchDB容器,它应该作为Hyperledger Fabric对等体的stateDB持有者,因此每个沙发容器应该与对等体一对一地连接。您可以查看docker-compose示例here in the official doc.
话虽如此,这里的错误看起来很正常,因为在沙发中需要一些初始设置来创建一些默认数据库。(Fabric同行将这作为陈述的建立例程的一部分)请参阅官方{{3} }。