我倾向于让我的cf cli(Cloud Foundry客户端)登录并设置为Bluemix中的特定目标.我会在长时间停顿后返回并再次发出命令.最近我得到了意想不到的回应:
Invalid Auth Token
Run Code Online (Sandbox Code Playgroud)
发生了什么,接下来我该怎么办?
在Bluemix上运行的几个实例之间使用什么算法来平衡HTTP负载?我似乎可以使用自动缩放服务来水平扩展,并且想知道在平衡负载时使用什么算法.
我正在使用Node-RED在Bluemix上运行应用程序.我添加了一个调试节点来输出完整的msg对象,但它在调试控制台中被截断.我怎样才能看到完整的物体?
我想将许多照片上传到Bluemix Object Storage服务,然后将其显示在Web应用程序中.现在,对对象存储容器中的照片的GET请求需要和auth令牌.有没有什么办法可以创建一个公共URL到对象,不需要GET请求的身份验证令牌?
我看到有一个选项可以创建对象的临时URL,但我不希望URL是临时的,我希望它永远存在.是创建长期临时URL的唯一选择吗?
我想将以下curl代码转换为pycurl.我不想使用请求.我需要使用pycurl,因为请求在我的旧python版本中不能完全正常工作.
curl
-X POST
-H "Accept-Language: en"
-F "images_file=@fruitbowl.jpg"
-F "parameters=@myparams.json"
"https://gateway-a.watsonplatform.net/visual-recognition/api/v3/classify?api_key={api-key}&version=2016-05-20"
Run Code Online (Sandbox Code Playgroud)
有人可以告诉我如何在PyCurl中写出来吗?
从我的本地主机,我连接到 blue mix
cf api https://api.ng.bluemix.net
Run Code Online (Sandbox Code Playgroud)
我登录然后用以下命令推送更改
cf push
Run Code Online (Sandbox Code Playgroud)
然而,在控制台中,
Uploading MY_PROJECT...
Uploading app files from: /Users/MyName/Documents/MY_PROJECT
Uploading 437.7K, 386 files
Done uploading
FAILED
Error processing app files: Error uploading application.
The resource file mode is invalid: File mode '0444' is invalid.
(venv) My-iMac:MY_PROJECT MyName$
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个问题?
我正在按照本教程在 IBM Bluemix 中设置语音到文本服务:https ://www.ibm.com/watson/developercloud/doc/speech-to-text/tutorial.shtml
我已经安装并测试了先决条件,但不知何故,当我尝试输入时出现错误:
curl -X POST -u <username>:<password>
--header "Content-Type: audio/flac"
--header "Transfer-Encoding: chunked"
--data-binary @<path>audio-file.flac
"https://stream.watsonplatform.net/speech-to-text/api/v1/recognize?continuous=true"
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
curl: no URL specified!
curl: try 'curl --help' or 'curl --manual' for more information
Run Code Online (Sandbox Code Playgroud)
我在直接访问 url 时测试了用户名和密码并且它工作正常。我为音频文件输入的路径也是正确的,因为我刚刚复制了它。
有谁知道如何解决这一问题?提前致谢!:)
我有一个在 IBM BlueMix 上运行的用 Python 编写的烧瓶服务器。我希望此服务器侦听 MQTT 通道并在收到消息时发布消息。我有以下代码,但从未调用过 on_connect 和 on_message。
app = Flask(__name__)
def on_connect(client):
client.publish(topic2, "CONNECTED")
def on_message(client, userdata, msg):
client.publish(topic2, "MESSAGE")
@app.route('/')
def hello_world():
return 'Hello World! I am running on port ' + str(port)
if __name__ == '__main__':
client = mqtt.Client()
client.username_pw_set(username, password)
client.on_connect = on_connect
client.on_message = on_message
client.connect('broker.example.com')
client.subscribe(topic)
client.publish(topic2, "STARTING SERVER")
app.run(host='0.0.0.0', port=port)
Run Code Online (Sandbox Code Playgroud)
我试过 client.loop 和 client.loop_forever 但它不起作用。
编辑:client.publish(topic2, "STARTING SERVER") 正在工作,我的凭据被删除。
我正在尝试将 Spring Boot 创建的微服务推送到 ibm 云托管的 K8 集群,但在启动时不断收到以下错误:
Error: Invalid or corrupt jarfile /app.jar
Run Code Online (Sandbox Code Playgroud)
我的泊坞窗文件:
FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
Run Code Online (Sandbox Code Playgroud)
我的 pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>projects</groupId>
<artifactId>mydb2jdbcproject</artifactId>
<version>1</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<java.version>1.8</java.version>
<spring-cloud.version>Dalston.SR4</spring-cloud.version>
<docker.image.prefix>springio</docker.image.prefix>
<app.name>mydb2jdbcproject</app.name>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.15.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>com.ibm.db2.jcc</groupId>
<artifactId>db2jcc4</artifactId>
<version>4.26.14</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId> …Run Code Online (Sandbox Code Playgroud) 我正在开展一个实验室,展示如何在 IBM Cloud 上设置 Kubernetes 和 CLI。
我有 Kubernetes 集群设置和容器注册表。我在 CLI 上登录到 IBM Cloud 和 Container Registry。镜像已创建并推送。
我可以使用带有命令式命令的图像创建一个 pod:
kubectl create -f hello-world-create.yaml
Run Code Online (Sandbox Code Playgroud)
文件yaml如下所示:
kubectl create -f hello-world-create.yaml
Run Code Online (Sandbox Code Playgroud)
但是当我尝试对运行的同一图像使用声明性命令时
kubectl apply -f hello-world-apply.yaml
Run Code Online (Sandbox Code Playgroud)
文件yaml的样子
apiVersion: v1
kind: Pod
metadata:
name: hello-world
spec:
containers:
- name: hello-world
image: us.icr.io/earlyprogramimages/hello-world:1
ports:
- containerPort: 80
imagePullSecrets:
- name: icr
Run Code Online (Sandbox Code Playgroud)
ErrImagePull我获取事件堆栈所在的每个 Pod的状态
Successfully assigned default/hello-world-6fd8bd67dc-79gbz to xx.xx.xx.xx
Pulling image "us.icr.io/earlyprogramimages/hello-world:1
Failed to pull image "us.icr.io/earlyprogramimages/hello-world:1": rpc error: code = …Run Code Online (Sandbox Code Playgroud)