2016-11-03 50 views
0

我是openshift的新手。我正在嘗試通過一些基本的安裝選項。首先,我能夠下載和運行流浪漢形象。當我這樣做時,我能夠登錄並看到幾個項目和容器正在運行。接下來我嘗試了二進制安裝。所以,我下載openshift原始服務器V1.3.1 untared它就跑了以下內容:用戶「系統」無法列出羣集中的所有服務

須藤openshift開始

似乎openshift開始,但我也注意到在輸出幾個可疑線路如下:

W1103 09:06:47.360850 4647 start_master.go:272] Warning: assetConfig.loggingPublicURL: Invalid value: "": required to view aggregated container 
logs in the console, master start will continue. 
W1103 09:06:47.360906 4647 start_master.go:272] Warning: assetConfig.metricsPublicURL: Invalid value: "": required to view cluster metrics in t 
he console, master start will continue. 
E1103 09:06:47.373823 4647 cacher.go:220] unexpected ListAndWatch error: pkg/storage/cacher.go:163: Failed to list *api.ClusterPolicy: client: 
etcd cluster is unavailable or misconfigured 
E1103 09:06:47.374026 4647 cacher.go:220] unexpected ListAndWatch error: pkg/storage/cacher.go:163: Failed to list *api.ClusterPolicyBinding: c 
lient: etcd cluster is unavailable or misconfigured 
E1103 09:06:47.374102 4647 cacher.go:220] unexpected ListAndWatch error: pkg/storage/cacher.go:163: Failed to list *api.PolicyBinding: client: 
etcd cluster is unavailable or misconfigured 
E1103 09:06:47.374254 4647 cacher.go:220] unexpected ListAndWatch error: pkg/storage/cacher.go:163: Failed to list *api.Group: client: etcd clu 
ster is unavailable or misconfigured 
E1103 09:06:47.374420 4647 cacher.go:220] unexpected ListAndWatch error: pkg/storage/cacher.go:163: Failed to list *api.Policy: client: etcd cl 
uster is unavailable or misconfigured 
E1103 09:06:47.376485 4647 reflector.go:203] github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/admission/limitranger/admission.go 
:154: Failed to list *api.LimitRange: Get https://XXX.XXX.XXX.XXX:8443/api/v1/limitranges?resourceVersion=0: dial tcp XXX.XXX.XXX.XXX:8443: getsockopt: 
connection refused 

一旦服務器啓動,我可以登錄,但系統用戶似乎沒有很多的權限。例如,系統用戶無法看到集羣中的任何項目或服務。運行一些OC命令似乎表明系統用戶沒有適當的權限如下:

#./oc login https://localhost:8443 Authentication required for https://localhost:8443 (openshift) Username: system Password: Login 
successful. 

You don't have any projects. You can try to create a new project, by 
running 

    oc new-project <projectname> 

# ./oc new-project default 
Error from server: project "default" already exists 
# ./oc get services --all-namespaces 
User "system" cannot list all services in the cluster 

看來我必須失去了一些關於如何從二進制啓動openshift了非常基本的分配。我無法在文檔中找到任何與此問題相關的內容。

回答

0

不知道你的環境是什麼樣的,所以下面的內容可能無法正常工作。

但是你可以嘗試以下方法:

oc whoami 
oc login -u system:admin 
oc whoami 

系統:管理員帳戶是root賬戶,並從他們可以創建其他用戶帳戶。

我發現運行OpenShift開發實例的最佳方式是通過oc集羣。 https://github.com/openshift/origin/blob/master/docs/cluster_up_down.md。這在Docker中的openshift上運行一個容器化的版本。可能值得一看,因爲你以前的安裝方法似乎有一些錯誤。

+0

所以使用我從壓縮包我得到以下安裝的版本: –

+0

因此,使用該版本我從tarball安裝時遇到錯誤,當我嘗試做你的建議。首先「oc登錄-u系統:admin」提示輸入密碼。我需要使用「oc登錄-u系統-p管理員」進行身份驗證。返回的項目列表是空的。如果我執行「oc聚簇」命令,如果我以「root」或其他用戶身份登錄,我會得到不同的響應。運行「oc login -u system:admin」並返回適當的項目列表,但Web UI在登錄後仍然沒有返回任何項目。 –

+0

BTW,安裝我做了以下內容: 'wget的 焦油xvzf openshift原始服務器-V1.3.1-dad658de7465ba8a234a4fb40b5b446a45a4cee1-Linux的64bit.tar.gz' 'CD <通過壓縮包創建openshift DIR>' '。/ openshift start' –

0

,如果你想手動做到這一點(沒有超頻集羣起來如上所述)

export KUBECONFIG=/full/path/to/openshift.local.config/master/admin.kubeconfig 

sudo chmod a+rwX -R /path/to/openshift.local.config/ 

oadm policy add-cluster-role-to-user cluster-admin demo (demigod mode) 

oc whoami 
system:admin 

oc projects 
You have access to the following projects and can switch between them with 'oc project <projectname>': 

    default 
    kube-system 
    openshift 
    openshift-infra 
    * test 

這不是一個生產設置,這只是瞎搞。

PS:無視clusterbinding政策錯誤的錯誤,問題是已知的,並不會影響您在登錄

相關問題